Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make animations interact each other?

Status
Not open for further replies.

ptitbob

Technical User
Oct 17, 2000
8
FR
How to command an animation from a second one?

For example, let's say that the "menu" animation is composed of buttons which should command a second animation on the same html page.

Let's say that by clicking on a button on the menu, the alpha property of a movie clip (its name is "round") on the second animation (its name is "toto") would be set to 30.


The code
setProperty ("toto", _alpha, "30");
of course does'nt work as it does'nt specify the path to the second animation where the "toto" movie clip is located.


What would be the correct code?

Thanks

Merci.
 
From the Help files:


Specifying targets
The Expression Editor has a Target button for inserting target names. In some situations, once you click the Target button, the area above the Target field displays movie clips that can be targeted. If this is the case and one of these movie clips is to be targeted, double-click the movie clip's name. The correct information is automatically entered in the Target field. At other times, the Timeline that you wish to target will not be in the window and the path will need to be entered manually.

Similar to the hierarchy of files and folders on a web server, Flash has a hierarchy of Timelines. To specify targets at different levels in the hierarchy, add a path to the target's instance name using the same system as for file paths or URLs. Movies (SWF files) are at the top of the hierarchy with movie clips below them.

The syntax for identifying targets is similar to that for folders in a file system. For example, a leading "/" identifies a movie clip at the root of the current layer. Targets without the "/" are identified relative to the current movie clip.

The following Tell Target paths use the seven Timeline example from the previous section:

/Jack targets the movie clip named ClipA from the main Timeline of MovieX.
../ targets the Timeline of MovieX from the movie clip named ClipA.
/Jack/Bert targets movie clip ClipA1 from any other movie clip.
Bert targets movie clip ClipA1 from the Timeline of movie clip ClipA.
../Ernie targets movie clip ClipA2 from the Timeline of ClipA1.
_level1/Smith targets movie clip ClipC in MovieY from any other movie clip.
A blank target field name targets the current Timeline.


The same movie clip can be targeted using more detailed variations of the path name. For example, /Jack targets the movie clip named ClipA from the main Timeline of MovieX; so does _level0/Jack which merely includes more information. A more detailed path name might be useful if you copy buttons with Tell Target statements from one movie to the next, changing the context of the button.

You can also use an expression to specify a target. For example, the expression "/"&ButtonName in the Parameters pane has Tell Target send a message to the movie clip contained in the variable ButtonName.

A Timeline must currently be in the Flash Player in order to be targeted. A movie clip Timeline is present in the Player when the playback head is positioned within the movie clip's frames. For example, if a movie clip is placed on the Timeline in frames 1 through 20, the movie clip can be targeted while the movie is playing or stopped at any frame between 1 and 20. After the movie reaches frame 21 the movie clip is no longer in the Player and cannot be targeted. See Checking whether a frame is loaded to set up a statement to check for a frame before executing the Tell Target statement.

The following sample action is for a button on the main Timeline that, when pressed, stops the movie clip instance Jack from playing. When the button is released, the action starts frame 55 of the movie clip instance Bert:

On (Press)
Begin Tell Target ("/Jack")
Stop
End Tell Target
End On
On (Release)
Begin Tell Target ("/Jack/Bert")
Go to and Play (55)
End Tell Target
Go to Next Frame
End On


;-)



"If nothing else, I can always serve as a bad example!”

 
Infact, there are two animations (in two .swf) on the same html page and I want to control the second one from the first one.

HOw can I manage it?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top