| 1. Create a new movie.
2. Draw an oval on your stage. Convert it to a symbol by clicking
insert=> convert to symbol. Select Movie clip for behavior and call it myoval.
3. Name the instance Oval on the instance panel.
4. Click in frame 5 and hit F5 to increase the keyframe out to frame 5.
5. Insert a new layer.
6. Insert a keyframe on Frame 1, layer 2
7. Naming your variable.
- Open your actions panel.
- Click the + symbol => actions => var
- Name your variable count = 0
7. Setting up your clockwise loop.
- Insert a single keyframe on frame 3.
- Click the + => actions => Set Variable.
- Type count in the box for variable
- Set the value to count+10 to increase the value of count by 10 each
time this frame is played.
- Check the box for expression under value.
- Click the + => actions => IF to set the condition for the count loop.
- Type in count>=370 (370 is 10 more degrees than a full
circle.)
- Click go to and play and set frame number to 4.
- Click + => actions => else.
- Click + => actions => Set Variable
- Type in the path for the clip: _root.oval
- Add the action: ._rotation
- Set the value of rotation: = count
- Check Expression
- Resulting line reads _root.oval._rotation=count
- Click + => basic actions => goto
Result of actionscripting on frame 3:
Setting up your counterclockwise loop.
- Insert a single keyframe on frame 5.
- Click the + => actions => Set Variable.
- Type count in the box for variable
- Set the value to count-10 to decrease the value of count by 10 each
time this frame is played.
- Check the box for expression under value.
- Click the + => actions => IF to set the condition for the count loop.
- Type in count<= -10 (-10 is 10 more degrees than a full
circle.)
- Click + => basic actions =>goto and set frame number to 4.
- Click + => actions => else.
- Click + => actions => Set Variable
- Type in the path for the clip: _root.oval
- Add the action: ._rotation
- Set the value of rotation: = count
- Check Expression
- Resulting line reads _root.oval._rotation=count
- Click + => basic actions => goto
Result of action scripting on frame 3:
You can make faster rotations by increasing the increment for count. You
can slwo it down by decreasing the increment for count.
It's That EASY!
|