Copy link to clipboard
Copied
Hi, I want to do righr/left button controlled movieclip but dont know how to set X axis limit, the movieclip dont leave stage. Want the movieclip move only move to right or left side. Will anybody help me?
Copy link to clipboard
Copied
You need to make use of conditional code that checks the current x property to see if moving further will vilate the limit and if so you skip the movement.
In your right movement code it would be something like...
if(movieclip.x + stepsize < right_side_limit){
movieclip.x += stepsize;
} else {
// do nothing (or something else )
}
Similar code would be used in the left direction movement code.
Copy link to clipboard
Copied
Thanks a lot for help and my second question, the movieclip can have only one registration point or more than one?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now