This content has been marked as final. Show 4 replies
You're going to need to write your code to a frame space instead of directly on the buttons themselves. Add a layer and, if necessary, set a new keyframe in the timeline where these buttons exist. Then you can add some actionscript something like this:
Both works for me!! thank you so much!!
@Shan: in ur code, which value determine how much the object goes out from the scene??
u're the masters. :D
For the moveLeft function, it's the value of mcObject._x<0. This is assuming your mcObject is on the main time line, so anything <0 would mean the object has exceeded the left boundary (of course, this also depends on the registration point of mcObject). The registration point for that symbol is in the middle, so that's why it stops once the middle of the object has reached 0. For the moveRight function, Stage.width determines the right boundary. Again, this assumes the object is on the main time line. Otherwise, if the object is nested in another object, you would have to check its parent.