swf -swf-version 8 -main Main --flash-strict -swf-header
280:280:21:ffffff
Chapter 12: Building Interactive Content with Flash
321
The resulting sample.swf can be opened in the standalone Flash Player or embedded in a web page.
You can change the - swf - version to also target the Flash Player version 6 or 7 and you will obtain the
same exact visual result.
The duplicateMovieClip() just creates a copy of the movie clip it is executed with; the
attachMovie() will be described later in the ??? Extending the MovieClip class ??? section.
Creating a MovieClip in Flash 9
As you may have already discovered, the code in Flash 9 has been partitioned a lot; classes have been
broken apart in a more organized way that fits better in a modern OOP environment. The MovieClip
class is part of the flash.display package and inherits from a long chain of super classes.
The previous example has been rewritten to target the last Flash version currently available. In this
version, you can instantiate a MovieClip object directly using the new keyword; the Movie Clip is
automatically displayed as soon as it is appended to a visible container using the addChild() method
as illustrated in the following example.
Pages:
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630