A (hopefully) simple intro to Tell Target...
(click on the red button to make the asterisk rotate)
|
Version Flash 3
Difficulty Easy
|
|
|
|
What does it do?
Tell Target allows one object (usually, but not always, a button) in your Flash scene to alter the behaviour of a movie symbol.
How does it work?
Basically, you give your Target (the object whose behaviour you want to change) a label, then use a Tell Target action to specify the behaviour.
Try this simple, step-by-step guide:
- Open a new document
- Change the name of Layer 1 to Target (click on the pencil icon next to the layer name and select Properties)
- Open the Movie Clips library (Libraries: Movie Clips)
- Drag the Animated Asterisk movie into your scene - doesn't matter where
- Close the library, select the asterisk
- Edit the movie (Edit: Edit Selected)
- Select the first frame in the asterisk movie. Now edit the frame's properties (Modify:Frame), go to the Actions tab and hit the plus (+) sign, then select Stop from the drop-down menu. Hit OK.
- Go back to the main movie (Edit: Edit Movie)
- Select the asterisk and edit its properties (Modify: Instance)
- In the Definition tab, under the heading Instance Options, enter the Instance Name as asterisk. Hit OK. You have now got a target called asterisk.
- Create a new layer, and call it Button.
- Open the Buttons library (Libraries: Buttons)
- Drag the Animated Button button into your scene (doesn't matter where, but not on top of the asterisk!)
- Edit the button's properties (Modify:Instance)
- Under the Actions tab, click on the plus (+) sign and select Tell Target. A number of lines of code should appear in the box below, like this:
On (Release)
Begin Tell Target
End Tell Target
End On
- In the box just to the right of this code, you should see the word asterisk next to a movie clip icon. Double click on the word asterisk, and it should appear in the box below (with a forward slash like this: /asterisk), labelled Target
- Click on the plus (+) sign again, and select Go To. Another line of code will appear, reading:
Go To and Stop
- In the box to the right, click in the circle where it says Go to Next Frame. Notice the code to the left changes to reflect this. Hit OK.
- You've now set the button up so that when clicked, it will make the asterisk play the next frame of its animation (it will rotate slightly). To test this, either go to Control: Test Movie or export the movie and load it in a browser.
- You should now have something like the movie at the top of this page (note: the red button has a built-in rotating black circle thing, this is nothing to do with Tell Target!). You can download the .fla file here in .zip form.
Good luck!
Stickman
All files and text copyright ©Stickman 1998 - 2003. For copyright and terms of use information, please read this page.