Working with Properties in Stack: Creating a Preview Clip for Items
Updated: Jan 15, 2008
Views: 768
Description: This tutorial will show you how to take a movie Cclip from your library and connect it to your Stack AS3.0 Component so that it displays as a placeholder immediately at the start until your images load.
Components Used in this Tutorial: Stack AS3.0 and a movie clip created inside of Flash.
The Completed Project:
Set-Up and Add Content Using through XML
Before you begin make sure that you have successfully installed the component inspector have been able to load content into the Stack component using XML. Also if plan on using ActionScript make sure that you give your Stack an instance name of myStack.
Creating the Preview Clip Movie Clip
Next, you will need to create your Preview Clip. Create a new movie clip (Insert > New Symbol). Give it a name: PreviewClip and select type: Movie Clip. You can now create your graphic or animation using the timeline.
Export our Preview Clip for ActionScript
We now need to export our new preview clip for ActionScript. We do this by opening our library (Window > Library) and finding our Movie Clip that we created and right clicking and selecting Linkage. Check the box Export for ActionScript, make sure Export for first frame is checked, and give it a Class name of PreviewClip.
Setting the Preview Clip Property of the Stack Component
Next, we need to connect our preview clip to our Stack Component. We do this by selecting our Stack Component on the stage and opening either the Parameters Panel (Window > Properties) or Component Inspector (Window > Component Inspector). We find the previewClip property and set this to the class name that we used in the last step: PreviewClip.
This can also be done in ActionScript:
The Completed Project:
Set-Up and Add Content Using through XML
Before you begin make sure that you have successfully installed the component inspector have been able to load content into the Stack component using XML. Also if plan on using ActionScript make sure that you give your Stack an instance name of myStack.
Creating the Preview Clip Movie Clip
Next, you will need to create your Preview Clip. Create a new movie clip (Insert > New Symbol). Give it a name: PreviewClip and select type: Movie Clip. You can now create your graphic or animation using the timeline.
Export our Preview Clip for ActionScript
We now need to export our new preview clip for ActionScript. We do this by opening our library (Window > Library) and finding our Movie Clip that we created and right clicking and selecting Linkage. Check the box Export for ActionScript, make sure Export for first frame is checked, and give it a Class name of PreviewClip.
Setting the Preview Clip Property of the Stack Component
Next, we need to connect our preview clip to our Stack Component. We do this by selecting our Stack Component on the stage and opening either the Parameters Panel (Window > Properties) or Component Inspector (Window > Component Inspector). We find the previewClip property and set this to the class name that we used in the last step: PreviewClip.
This can also be done in ActionScript:
myStack.previewClip = "PreviewClip";
If you want to change how other things such as the containers in the Stack, there are other properties that you can customize: Stack API.
Other Tutorials
