Projects
Example 2 - Multiple MovieClip Instances
Intro : Example 1 : Example 2 : Example 3 : Example 4
Library
- button - Movie Clip
- content - Movie Clip
- invisible - Button
Construction
- Create MovieClip containing:
- invisible button
- dynamic textfield
- background
- actionscript attached to button instance
- Create MovieClip containing content on sequential frames. Place on timeline, giving instance name
- Create as many instances of button movieclip as needed, assigning instance names
- Frame 1, actions layer, assign button movieclip variables: textfield and frame number to jump to
Actionscript
Attached to invisible button on button movieclip timeline
on(release) {
_parent.content.gotoAndStop(frame);
}
Attached to Frame 1 on root timeline
button1.text = "Home";
button1.frame = 1;
Repeat for each button
Advantages
- Easier to customize
- All variable assignments in one place
- Content is placed on its own timeline - easier to change
Disadvantages
- Need to assign instance names to each button (really not that big of a deal)
Recently Played on iTunes
-
“Heroin”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:26 -
“All Tomorrow's Parties”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:20 -
“Run Run Run”
The Velvet Underground & Nico
The Velvet Underground
11/17/08 16:16