ok
i want to use a variable path
first i make an array
var menuArray:Array = new Array("trip", "total", "time", "mxs", "avs");
theres also a variable, called currentvalue, that gets a certain array value loaded into it. currentvalue = menuArray[2]changing the value of currentvalue works fine.
What i want is not this:
this.movieclip.trip.play();
but something like
this.movieclip.[currentvalue].play();
problem is i dont recall how :'(
in AS2 you were close, it's:
this.movieclip[currentvalue].play();
that's if you have a movieclip named "movieclip" on your root (which is bad form). If the movieclip's name is currentvalue and it's just on the root, its like this:
this[currentvalue].play();
and in AS3 its:
this.getChildByName(currentvalue).play();
ah thx alot, pineaple, indeed i knew i was close!
Im allready taking my first steps in as 3.0 but ive with a rather short deadline on this project, hence the 2.0.
cool - let me know if there's any AS3 tutorials you'd like to see, I did one on particle systems (http://www.clockcrew.cc/tutorials/as3particles/) but I'd like to do more in the future.
New problem,
Ive made an movieclip(compleet)draggable and shifted along the Y axis.
_root.compleet._y = 80;
_root.compleet.onPress = function() {
this.startDrag();
}
What i want is for the user to be able to drag the "compleet" movieclip into the original area. Where the movieclip will snap back into its old place and becomes undraggable again.
Problem is i dont know how to make it snap.
ok wait, will this also work with a hittest?
EDIT: yes, a hittest did the trick.
now to find a way to make the "compleet" movieclip undraggable and fully functional(it contains buttons) again.
EDIT: alos fixed.
turns out this wasnt hard at all