Loading swf's with linked movieclips

65 views
Skip to first unread message

WeLike...@gmail.com

unread,
Jan 15, 2008, 8:48:46 AM1/15/08
to BulkLoader users
Hi all,

I'm trying to use the bulkloaded to load seperate parts of my
application (so designers can work on it without interferring with
eachother)

The problem is that the swf's i'm loading contain movieclips with
linkages. When i load the swf's, the constructors of the linked
classes are called before the swf's are actually added to the stage.

This is a problem because this way all references to eg. singleton
instances are not shared between them but instanciated for each
individual movieclip...

Is there a way to fix this?
If i need to post some sample code are traces or something just ask.

One more thing: In flash everything works, but in the browser things
get messed-up

Arthur Debert

unread,
Jan 15, 2008, 10:25:02 PM1/15/08
to BulkLoader users
If I understand you correctly, you've got a common problem and it
isn't something really related to bulkloader.

Mostly, any code that depends on stage being accessible should go
inside a ADDED_TO_STAGE handler, because at that point you will surely
have a handle on the stage.

In fact, this is pretty much an AS3 best pratice. In theory, being
able to instantiate objects from the Display list is great, but in
practice it's usefull to do any visual setup on the ADDED_TO_STAGE
event (and add the listener for it on the constructor it self).

Cheers
Arthur

WeLike...@gmail.com

unread,
Jan 16, 2008, 2:52:01 AM1/16/08
to BulkLoader users
Ok,

Thank you!
I will try that. It doesn't seem to be a bulkloader problem then, but
i'm still glad you could help!

Greeting,
Raf

WeLike...@gmail.com

unread,
Jan 16, 2008, 8:36:24 AM1/16/08
to BulkLoader users
Well, that didn't work either. But i found a solution, thought it
might be usefull to share it!

The problem was that the site was added in the flashplayer security
settings (to allow remoting calls when we are testing locally)
Apparently, it was enough to delete the site from this list.

Only problem remains now that we cannot use the services...
or atleast not locally. On a remote server everything works fine.

There will probably be a solution to this problem, but i haven't found
it yet.
I think it has something to do with the applicationdomain of the
loaded swf's

@Arthur: Are there any custom settings in the bulkloader for
applicationdomains, or a way to add them when loading swf's?

Greetings and thanks for the quick reply,
Raf

Arthur Debert

unread,
Jan 17, 2008, 10:29:40 AM1/17/08
to BulkLoader users
Hi Raf.
> @Arthur: Are there any custom settings in the bulkloader for
> applicationdomains, or a way to add them when loading swf's?

Yup, there is. The properties object passed to add can take a context
(either a LoaderContext or a SoundLoaderContext) that will specify the
correct applicationDomain. Sample usage:

var myContext : LoaderContext = new LoaderContext();
myContext.applicationDomain = ApplicationDomain.currentDomain;
loader.add("some.swf", "context": myContext);


[]s
Arthur Debert
Reply all
Reply to author
Forward
0 new messages