Flash Actions Moving Objects with Buttons and Actions
Hi everyone, good day to you. You know, I’ve often wondered how can you make a simple game using flash, or at least how do you make an object move on screen, based on user input. Well, wonder no more, as I’ll show you a simple example of how you can move a teddy bear to different positions on screen using buttons and actions.
1. select Window > Actions, to open Actions panel
2. select symbol instance, in this case its an instance called myTeddy to be moved
3. move symbol instance to the up position, and note the x and y position of the instance, in the Info panel, eg. x is 275 and y is 80
note: if registration point of symbol (shown in library) is at center, then also click the center position registration point for the Info panel
4. select button instance labeled up
5. under Global functions > Movie Clip Control, double-click the ‘on’ action, and double-click press event
note: the script for button instance labeled up should now be:
on(press){
}
6. enter the following script after the opening bracket, so script will look like below:
on(press){
_root.myTeddy._x=275;
_root.myTeddy._y=80;
}
7. repeat steps#3 to 6, for the other positions (down, left and right), and other buttons, and change the value of x and y position accordingly for the different buttons
8. press Ctrl + S, to save file
9. press Ctrl + Enter, to test movie

Flash is my favourite software.My dream every day is to become a prefect user of flas because i love em
Comment by Aaron Agah — December 23, 2008 @ 8:47 pm
Good for you Aaron, just keep practising, and good luck with your goal of becoming a master flash developer.
Comment by Administrator — December 27, 2008 @ 5:02 pm
great!!!!
I can now learn from home with your tutorials….
hope you will continue helping us..
God bless you guys…
Comment by rey cris miguel — January 21, 2009 @ 12:22 pm
thanks for your comments miguel, I’m always happy to help out whenever possible ^^.
try dropping me an email or comment about what other tutorials you might be interested in, or just to say hi ^^
Comment by Administrator — January 21, 2009 @ 4:07 pm
Thanks! Cool tutorial. Now I can make my own object to move.
It’s my first time to try this co’z I really love Flash. Hope you’ll continue to share your talents to us.
Comment by Bryan — February 12, 2009 @ 3:24 am
Hi Bryan,
I’m glad you like the tutorial, hope you have fun with your own flash objects, and thanks for your encouragement, they mean a lot to me ^_^
Comment by Administrator — February 15, 2009 @ 1:38 pm