Example:
Playing a different Flash animation

Actions used:

Control Structure - END IF

Control Structure - IF

Control Structure - RETURN

Flash Object - Is Visible

Flash Object - Load

Flash Object - Play

Flash Object - Seek

In this example, we'll change the Flash animation that is currently playing in a Flash Object, set the position to the 10th frame, and then play the animation.

Here's what the action list looks like:

First we use a "Flash Object – Is Visible" action to make sure the Flash Object isn't hidden.

That sets the value of the variable %IsVisible% to either TRUE or FALSE, according to whether the Flash Object is currently visible or hidden. If the object is hidden, we don't want to load another Flash animation in the object (we'll assume that the object was hidden on purpose).

So, we use a "Control Structure - IF" action to test whether %IsVisible% was set to FALSE. Note that instead of doing a direct comparison like this:

%IsVisible% = FALSE

...we've chosen to do it the "programmer's way," which is to use the NOT operator (represented by an exclamation mark), like so:

!%IsVisible%

This is just like saying "if %IsVisible% is not true".

(Programmers prefer this method because it's shorter, and because in some compiled languages the two methods are actually implemented in slightly different ways, with the ! version being a bit more efficient. In AutoPlay Media Studio, there is no advantage to using one over the other...aside from having a bit less to type, and perhaps impressing your programmer friends.)

If %IsVisible% is FALSE, we use a "Control Structure - RETURN" action to exit from this action list. That way, the rest of the actions in this action list will only be performed if %IsVisible% is true.

Next (after ending the IF block with a "Control Structure - END IF" action) we use a "Flash Object - Load" action to load a different Flash file into the Flash Object.

In this case, we'll assume that the AutoPlay application is running directly off a CD, that the Flash animation we want to load is called "MyAnim.swf", and that it is located in a folder called "Flash" on the root of the CD.

Then we use a "Flash Object - Seek" action to set the position in the animation to the 10th frame.

Finally, we use a "Flash Object - Play" action to start playing the animation.

Here's a link to the finished example, as an AutoPlay Media Studio 4.0 actions XML file that you can import into an action list:

(Note: save this file to your hard drive and use a tool like WinZip to extract the XML file)