View Full Version : Readjusting Movie Clips
yopugged
10-03-2008, 06:51 AM
So, I have a movie clip by the name of 'char' that moves around with the arrow keys. When it hits another movie clip by the name 'door' i would like the movie clip to transfer to a new location without having to direct it mathematically. When I put a new frame and reposition the movie clip 'char', when the timeline hits that point, the movie clip 'char' doesn't switch positions.
drumn4life0789
10-03-2008, 07:01 AM
use the hittest function.
Not the right syntax here but you can look that part up.
char.hitTest(door) = function
move char to next scene or frame thats it prettymuch
xdeath
10-03-2008, 08:57 AM
use the hittest function.
Not the right syntax here but you can look that part up.
char.hitTest(door) = function
move char to next scene or frame thats it prettymuch
judging by the question i take it you have no idea what hitTest is so the above quote may confuse you with the incorrect syntax. here let me fix it up a bit for you.
this.onEnterFrame = function(){ // this makes sure we are always
// checking for the collision below
if (char.hitTest(door)){ // this controls the collison
gotoAndStop(/*place frame number in here*/);
}}
that code should go on the main timeline and should work in all versions of actionscript. now if you want to put that code on a movieclip you may have to change the code a bit to make it work but should solve your problem.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.