Moving the pendulum
Now we can see how to associate the function to the movement of the pendulum: in Flash we select the control panel movie clip and choose from the menu of the actions setProperty(); in the Property field we choose _rotation(Rotation), in the Target field we write _root.pend, and in order to reference the pendulum movieclip as the object to be rotated, in the Value field we write our function. Done!
obviously the action must be put to the inside of the onClipEvent (enterFrame)
action in order to be repeated to every frame. Finally there is a=a+0.1
that it is needed to increase the value of the a variable, every frame.
|» Level Advanced|
Rating: 8.99 Votes: 962
|No author details given.|
|Download the files used in this tutorial.|
|Download (67 kb)|
|More help? Search our boards for quick answers!|