freddiefujiwara
freddiefujiwara

Reputation: 59029

How to get swf's url on swc library

I'am a beginner of ActionScript3

I wanna get swf's url.

but I develop swc lib. swf(Main) develop other developer.

I have to get from Main loaderinfo, I / F is already fixed.

Do you have a good idea?

public function doSomething( arg1:String,arg2:String ):String
{
    /* some thing */

    return result;
}

Upvotes: 0

Views: 419

Answers (1)

divillysausages
divillysausages

Reputation: 8033

Get the other developer to pass in the Main class or the Stage (in fact any DisplayObject) and return the loaderInfo.loaderURL from that. Something like:

public function getSWFURL( dObj:Sprite ):String
{
    return dObj.root.loaderInfo.loaderURL;
}

the .root will return the root DisplayObject, so any DisplayObject that's attached to the stage will return this.

Upvotes: 1

Related Questions