Hello,
Sorry for posting this message twice - I hadn’t seen that you had a specific forum dedicated to AS3 scripting when I posted initially to the Flash CS3 general forum. I should have looked closer.
I’ve finished Kirupa’s great tutorial on loading an external image into flash using AS3. I have to say that this is the clearest and most useful set of instructions on how to do so that I’ve come across over four days of searching! As simple as it might be for many of you, the initial instructions on how to create the empty movie clip container are especially appreciated!
Now, I’m wondering how to extend this concept one step further. I have a single flash CS3 file into which I’d like to load and play at different times as the main movie plays different swf files. My goal is creating a presentation that will be displayed on a large TV at a conference, that will run without user input (no buttons). Essentially I’m creating a “flashier” powerpoint presentation.
-
At different times in the main movie’s timeline, how can I use AS3 to call different swfs for playback? I’d need to somehow unload previously played swfs, wouldn’t I? What code addition to Kirupa’s tutorial would accomplish this?
-
Would I somehow have to read the individual swfs into some sort of array, somehow?
-
Would all of this be accomplishe by a single script placed on a single frame of the main movie’s timeline?
Thanks in advance for any help!
Here’s the script from Kirupa’s tutorial as provided on www.kirupa.com:
var imageLoader:Loader;
function loadImage(url:String):void {
// Set properties on my Loader object
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage(“pixelHouses.jpg”);
function imageLoaded(e:Event):void {
// Load Image
imageArea.addChild(imageLoader);
}
function imageLoading(e:ProgressEvent):void {
// Use it to get current download progress
// Hint: You could tie the values to a preloader
}