|
-
Loading SWF files in order???
Please!!!!
Could someone tell me an easy way or write out the script. I'm trying to load 30 external SWF files in order from 1.swf -30.swf ???
Thank you,
Liz
-
Flashmatics
With a preloader or without? simple bar preloader?
-
Without a preloader. These will be loading in the background of another movie.
Liz
-
Flashmatics
This will load movies 1.swf to 30.swf in levels 1 to 30 respectively, one by one in order:
Code:
var count:Number = 0;
var my_mcl:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
my_mcl.addListener(loadListener);
_global.aQueue = new Array();
_global.startQueue = function():Void {
my_mcl.loadClip(aQueue[0].source, aQueue[0].level);
}
loadListener.onLoadInit = function() {
count++;
if (count<aQueue.length) {
my_mcl.loadClip(aQueue[count].source, aQueue[count].level);
}
if (count == aQueue.length) {
count = 0;
aQueue.length = 0; //everything has loaded so now empty array so its ready for another queue push
}
};
//load movies 1.swf - 30.swf in levels 1 to 30
for(var i:Number = 1 ; i <=30 i++){
aQueue.push({source: i+".swf", level: i});
}
startQueue();
P.S ive defined the array and startQueue function as global, so no matter where you are you can easily start and run a queue..
Last edited by silentweed; 06-13-2006 at 04:16 AM.
-
Thank you... Thank you.... Thank you....
Liz
-
Flashmatics
yw yw yw
-
I am trying to do this exact same thing but when I try to use your code I am getting errors. I am really bad with action scripts - I really need some help, please! I have spent the last three days trying to figure this out. The problem is with this section:
_global.startQueue = function():Void {
my_mcl.loadClip(aQueue[0].source, aQueue[0].level);
}
These are the error messages I am getting:
**Error** Scene=Scene 1, layer=Layer 18, frame=1:Line 8: '{' expected
_global.startQueue = function():Void {
**Error** Scene=Scene 1, layer=Layer 18, frame=1:Line 10: Unexpected '}' encountered
}
Please help me!
-
Flashmatics
Make sure your publish settings are set for flash player 7 and actionscript 2
-
ok. I have got it to work - to load all the movies. Now how do I controll how they play back - right now they just all show up at the same time. I know should have posted these questions in the newbie section - I am in way over my head. Please help!
-
Flashmatics
locally they will show up at the same time as there is no speed issue..online they will show one by one as they load..
-
So it will play all of 1 and then when that is finished it will start 2 and when that is finished it will start 3, etc? I want all of the movies to load and then play in order.
-
Flashmatics
Hi
No the above script only loads them in order it does not play them in order.. to do that what u need to do is put a stop action at the beginning of each of the movies(except the first movie) and on the end frame of each movie you tell the next movie to start playing
-
Is there a way to control the movies from the main movie? If I wanted to have a stop, play, and rewind button. And also, there is a little pause between each movie, is there any way to get rid of that? Thanks for answering all my questions!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|