PlaviZG Posted November 30, 2010 Share Posted November 30, 2010 hi, how to move a movieclip (MC) on x axes left or right using two MC buttons?NOTE : I am working with AS3 Link to comment Share on other sites More sharing options...
justsomeguy Posted December 14, 2010 Share Posted December 14, 2010 Each object on the stage has _x and _y properties which hold the coordinates of the origin. Link to comment Share on other sites More sharing options...
brart Posted January 4, 2011 Share Posted January 4, 2011 Each object on the stage has _x and _y properties which hold the coordinates of the origin.In As3.0 it's called x and y. So let's say you have a button on stage called button_left and a button called button_right, the code would be similar to this:button_left.addEventListener(MouseEvent.CLICK,moveLeft);button_right.addEventListener(MouseEvent.CLICK,moveRight);function moveLeft(event:MouseEvent){ movieclipyouwantedtomove.x += -3; // 3 is the speed of traveling}function moveRight(event:MouseEvent){ movieclipyouwantedtomove.x += 3; // 3 is the speed of traveling} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.