Jump to content
Search Community

sequential loading swfs

gvdheyning test
Moderator Tag

Recommended Posts

HI Jack, I've been going through your forum for sequential loading swfs, and a previous post did not work for me, see also attached files, seems a simple enough problem, but I can't get it to work, grid.swf and grid1.swf keep loading simultaneously.

What am I doing wrong?

 

also, (and this is nothing to do with your wonderful tweening classes, but I thought I'ld throw it in there in any case, what If I upon loading the swfs, in the end there will be four of these, I want a movie clip button to appear? the loaded swfs keep covering anything I put on stage...I know this is real beginner's stuff, but whatever I try with addChild just won't work...:( I have a flashBnt0 movie clip in the library of HomePg1.fla.)

 

Thank you as always, so much for your help,

 

Fam

 

PS: I am really vdheyning but I couldn't manage to log in under that name...so I re-registered. Sorry about that.

 

 

here's my failing code:

 

 

here's my code:

 

 

stop();

 

 

import com.greensock.*;

import com.greensock.loading.*;

import com.greensock.events.LoaderEvent;

import com.greensock.loading.display.*;

 

 

 

var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete:completeHandler, maxConnections:1});

 

 

queue.append( new SWFLoader("grid.swf", {name:"mainClip", estimatedBytes:3000, container:this, autoPlay:false}) );

queue.append( new SWFLoader("grid1.swf", {name:"dotClip", estimatedBytes:20, container:this, autoPlay:false, delay:3}) );

 

 

LoaderMax.prioritize("mainClip", true)

 

queue.load();

 

function completeHandler(event:LoaderEvent):void {

var image:ContentDisplay = LoaderMax.getContent("mainClip");

TweenLite.to(image, 3, {alpha:0, delay:3});

trace(event.target + " is complete!");

}

Link to comment
Share on other sites

...seems a simple enough problem, but I can't get it to work, grid.swf and grid1.swf keep loading simultaneously.

What am I doing wrong?

I just tried your file and things loaded sequentially exactly as I'd expect - what makes you think things are loading simultaneously? What's the evidence you're looking at?

 

what If I upon loading the swfs, in the end there will be four of these, I want a movie clip button to appear? the loaded swfs keep covering anything I put on stage...I know this is real beginner's stuff, but whatever I try with addChild just won't work...:( I have a flashBnt0 movie clip in the library of HomePg1.fla.)

 

I'm not exactly sure how you're trying to do this. You should be able to just put an instance of flashBtn0 on the stage and then if you want it to rise to the top, just addChild() it or setChildIndex(). Like this.addChild(myInstance). And just because something is in the library doesn't mean that it'll be available for scripting - you need to "export for actionscript" that particular library item and associate a class with it in order to be able to dynamically create instances of that button. For more info on that, check Adobe's docs or Google it. Or there are general forums for that type of stuff at kirupa.com and actionscript.org

Link to comment
Share on other sites

HI Jack,

Thank you for your reply,

It's probably a bit hard to see as the swfs are kinda abstract, but if you look at the 2 swfs (grid and grid1) you see that one is the image of a building, tho other one is the image of a plug, and one swf comes up in squares, and then the second swf should come up, but you can see the first swf through the second one, right from the start, which means they start simultaneously.

The tutorial is great and I can get it all to work no problem with jpegs, but these swfs appear at the same time, I want one to load when the other one is done loading completely and not at the same time, so that you first see one image build up and then the next one builds up. I can probably do this much easier if I just use layers and fade square white movieclips out on top of them and use your timeline manager, but I'm sure it can be done better by a better person than me!

Thanks for your reply though, I wish I could explain it better, maybe I'll try the same code with movieclips that have no transparency in them so you cant' see anything happening underneath the other one,

 

thanks again,

Fam

 

I figured out the addChild bit, I have to make a container for it as far as I can tell...

Link to comment
Share on other sites

I don't think that's accurate. In fact, I noticed that you put a "delay" value in your loader's vars parameter which is odd because there is no such special property - I wonder if you were expecting it to wait 3 seconds before loading. Is that true?

 

According to my tests, things are indeed loading sequentially in your file, but remember that since the files are local, they load EXTREMELY fast. So the second one might load a few milliseconds after the first - maybe that's why you're thinking that they load simultaneously. It just appears that way, but it's not really what's happening.

 

Or am I missing something?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...