PDA

Volledige versie bekijken : Dragable items > meerdere targets


cameri
%Europe/Berlin %706 %2009, 16:57
Ik probeer een animatie te maken waarbij je 1 opject (movieclip) op meerdere plaatsen kan schuifen, deze moeten hier dan vastklikken. ik krijg hem maar aan 1 plek gekoppelt ipv dat hij op meerdere plaatsen kan vastklikken. hierbij de code:

on(press) {
startDrag(this);
}
on(release) {
stopDrag();
if (this._droptarget == "/ovaal1") {
this._x = _root.ovaal1._x ;
this._y = _root.ovaal1._y ;
}
else{
this._x = 14.7;
this._y = 178.1;
}
}

hoe krijg ik hem dat hij bijvoorbeeld ook naar instance naam: ovaal2 of 3 etc kan schuifen?
gr

-ADV-
%Europe/Berlin %717 %2009, 17:13
mijn_btn.onPress = function() {
startDrag(this);
};
mijn_btn.onRelease = function() {
stopDrag();
if (this._droptarget == "/ovaal1") {
this._x = _root.ovaal1._x;
this._y = _root.ovaal1._y;
} else if (this._droptarget == "/ovaal2") {
this._x = 14.7;
this._y = 178.1;
} else if (this._droptarget == "/ovaal3") {
this._x = 50;//voorbeeldwaarde;
this._y = 50;//voorbeeldwaarde;
}
};

Groet,

-Adv-

cameri
%Europe/Berlin %396 %2009, 09:31
bedankt gr c