Accessibility

TechNote (Archived)

How to ''park'' a movie clip so it can be preloaded and reused

"Parking" a movie clip is a useful technique. A parked movie clip can sit invisibly on stage waiting for instructions. This allows the movie clip to be preloaded along with the main timeline and avoids playback delays later in the movie.

Follow the steps below to create the movie clip:
1 Create a new movie clip using Insert > New Symbol. Choose Movie Clip as the symbol's behavior.
2 Double click the keyframe in frame 1 and add aStopaction to the frame. Do not place any graphics in this frame.
3 Add a new keyframe at frame 2 (or at any frame after frame 1). The actual animation starts in this keyframe and can contain graphics or other movie clips

For convenience, add a frame label to this keyframe such as "Play".
4 Choose Edit> Edit Movie to return to edit movie mode.
5 Open the Library and drag an instance of this movie clip onto the stage.

Because there are no graphics in the first frame of the movie clip it will be invisible in edit movie mode. Also, because the clip has a Stop action on it's first frame nothing will display by default when previewing the movie.

6 Using the Instance panel, give the movie clip an instance name.

To make use of this parked movie clip you use the tellTarget or withactions to send the movie clip to the frame that contains the actual graphics or animation. For example, to "activate" the movie clip from a button instance, attach the following script to the instance:

 

 on (release) {  tellTarget ("instanceName") {         gotoAndPlay ("Play");     } } 

 

Or, using the withaction,

 

 on (release) {  with (instanceName) {   gotoAndPlay ("Play");  } } 

 

Similarly, to "deactivate" the parked clip, or send it back to the empty keyframe in frame 1, use a similar action to send the clip to frame 1, which contains no content.

Addtional Information
For more information on using the tellTarget action see How to use the Tell Target action (TechNote 13479). For more advanced information on working with movie clips, please refer to the Flash MX Application Development Center at Macromedia's Designer and Developer Center.

Note: Although a similar effect to the one described here can be achieved by changing the_visible property of a movie clip instance, this occasionally causes the movie clip to "flash" briefly before becoming invisible. Parking a movie clip can provide more consistent display performance.

 

AlertThis content requires Flash

To view this content, JavaScript must be enabled, and you need the latest version of the Adobe Flash Player.

Download the free Flash Player now!

Get Adobe Flash Player

Creative Commons License

Search Support

Document Details

ID:tn_14404
Browser:Chrome
Internet Explorer
Netscape
Opera
Safari
Firefox
Database:DB2
Informix
MySQL
Oracle
SQL Server
Sybase
MS Access

Products Affected: