Thursday, January 26, 2012

How do i stop the motion tween in CS4 looping?

ive motion tweened a word in flash cs4 and when i hit playback it loops it continuously.

i only want it to do this once,

so....

anyone have any idea how i could do this?

ive tried typings stop into actions but it says "current selection cannot have actions applied to it"

short of inserting abouta million blank frames im stuck.

help?How do i stop the motion tween in CS4 looping?This is an easy answer, and easy to fix!



What you are trying to do is add an action to an object that hasn't been assigned a type yet, its just an object.



What you want to do is right click on the ending frame, and select Actions, or if you don't have that option or it is already open, you should be allowed to enter an action (with that frame just being clicked, nothing inside the frame (no text or anything) being clicked. when you click on a frame, everything inside the frame will be selected. what you want to type in the actions is:

stop();



that will stop it at the that frame.

Now since you haven't stated whether you are working in ActionScript 1, 2 or 3, ive made sure that this will work with all versions (and it does!).



Now, i know thats the end of what you asked, but im going to offer a little bit more advice:



To create a button, what you want to do is select an object (ie: a square or text), and press F8 on your keyboard. A dialogue box will come up titled "Conver to Symbol", and this is where you define what type of symbol this will be. Your choices are: Movie Clip, Button, Graphic. By making it a button, you will make it clickable.



Now, when working with ActionScript 2, scripting the button is easy, all you would need to do would be select the button and add the following actions:

on (press) {

stop();

}

Its that easy, not with ActionScript 3..Its basically ActionScript2 Classes on Steroids!



So you have your button created, and all is good, but theres an extra step. What you have to do is click on the button you have created, and in the properties panel, you will see %26lt;Instance Name%26gt;, this is where you name your button. Name it something you will remember. Now, click on the frame (like you did above), and this is what you would type:



your_Button_Name.addEventListener(Mous鈥?Function_Name);



function Function_Name(event_object:MouseEvent) {

stop();

}



Okay, now, for this to work you have to plug in 2 things..

your_Button_Name is what you called your button in the %26lt;Instance Name%26gt; area

Function_Name is the name for the function for it to activate



More Explination:

"your_Button_Name.addEventListener(Mou鈥?Function_Name);" Adds a 'listener', or basically tells the program to 'listen' for that even to happen ie: a mouse event: click, you can have as many as these as you want, and they can all tell the program to run its own function or run the same function.



"function Function_Name(event_object:MouseEvent)" is exactly what the first word says, its a function. Basically a set of instructions, when a button tells the program to run this function, the program will look for it, and then run it. Everything between the { }s are what the program will do when it is told to run that function.





I hope this helps you and you have learned the basics of buttons and actions in flash, if you have any troubles feel free to email me.

DWilly92

No comments:

Post a Comment