 |

Dragable Objects
This tutorial will show you how to make your hoopy vectors and bitmaps dragable, in Flash 4. Dragable objects can be used to add important interactivity to keep your visitors satisfied, or pointless detail, as seen in the header above (drag the dot in phong.com.)
The diagram to the left shows what the final effect of a dragable object.
1.
Press Ctrl+F8 to create a new symbol named DragBall, with behavior set to Movie Clip.
Create, or File > Import... the object that you want to drag, in this symbol.
I imported a bitmap of the transparent green sphere.
2.
Select the objects you created, or imported and then press F8 to create an instance of them.
The symbol properties window will pop up. Change the behavior to Button, and name it BallButton.
Now, there will be an instance of the button BallButton inside the movie clip DragBall.
If you ever need to edit the dragable object, edit the BallButton symbol.
3.
Double click on the object to bring up the Instance Properties window. Click on the Actions tab, and then add a Drag Movie Clip action.
Change it to On(Press) and set the Start Drag() target to /Ball
Click on the End On and then add another Drag Movie Clip, this time leaving the action On(Release), but selecting Stop Drag Operation for the action. Press OK to save and exit the Instance Properties.
4.
Go back to the scene that you want the dragable object inserted into. If you created a new file for this tutorial, go to Scene 1 by clicking the Scene 1 button near the top-left of the document window.
Open the Library Window Ctrl+L, and then drag the DragBall Movie Clip from the Library window into the scene, on Layer 1. Rename Layer 1 to DragBall.
5.
Double click on the object in the scene to bring up the Instance Properties window, and set the instance name to Ball.
Press OK, now press Ctrl+Enter to test your movie, and drag that ball around!
If it appears too choppy, close the preview window to return to the editor, and press Ctrl+M to edit the Movie Properties, and increase the frame rate.
|
|