The Movie
In order to complete this movie you need to use the Flashscript biz classes (description here). They are included in the files to download. The reason we are using these classes is that they contain scripts, which save us work such as for loading or effects like fading etc. Our movie is very simple. We create a background for the movie, which is a graphic. Don't waste any extra bytes for MovieClips when a graphic is sufficient. We also add a line in the bottom of the movie to separate the thumbnails from the rest of the movie. We position a textfield above the white line, which we name imName. This textfield will show the name attribute text.
Next we start writing the script. Let's review what we need. We need to (1) load the XML file, (2) create and arrange thumbnails, (3) be able to show a slide by clicking on a thumbnail. Let's start with any classes we need to import as shown below. Those are classes from the Flashscript biz library and I will explain them when we get to use them.
import biz.Flashscript.utils.TextLoader; import biz.Flashscript.utils.LoaderClass; import biz.Flashscript.utils.LoaderClassStatic; import biz.Flashscript.tweens.ApplyTweensTimer;
Next we need to declare some variables, which we need at a later point in the movie. Those are a variable for an array, which will hold the XML information and a varaible for the LoaderClassStatic class, which we use to show the individual slides.
var imageArray:Array = new Array (); var lcs:LoaderClassStatic=new LoaderClassStatic();
The we need to add a holder for the individual slides to show. This is just an object created from the Sprite class. Use the Sprite class here, since it takes less bytes than the MovieClip class, since we do not need any timeline.
var imageHolder:Sprite=new Sprite(); imageHolder.x=50; imageHolder.y=15; addChild(imageHolder);
Next we will load and parse the XML file.