0

Problem is, B.swf is main app, since it is big I am using separate A.swf for loading B.swf and then just adding to stage. But in that case B.swf don't works properly (something works but some functions don't work) it is defenitly about what is main stage in that case. When i load directly B.swf it works perfectly, so any ideas how to load B.swf with A.swf and than to "change" main timeline/stage to point to B.swf so B can be full functional?

2 Answers 2

1

have you tried to load the B.swf into currentDomain like so:

var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
yourLoader.load(new URLRequest("B.swf"), context);  

of course remembering to add all events:) like complete and ioerror,

Sign up to request clarification or add additional context in comments.

1 Comment

no problem, the same thing you can use to load libraries like with code or resources (e.g. images) that you wish easily to be used by other application elements.
0

I don't know if this can help you, but it's a Live Update System what I've done with the preloader of FlashDevelop :

public function Preloader() 
{
        var mLoader:Loader = new Loader();  
        var mRequest:URLRequest = new URLRequest("ABSOLUTE URL");
        mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
        mLoader.load(mRequest);

        function onCompleteHandler(loadEvent:Event):void 
        {
            addChild(loadEvent.currentTarget.content);
        }

        if (stage) {
            stage.scaleMode = StageScaleMode.NO_SCALE;
        }

        addEventListener(Event.ENTER_FRAME, checkFrame);
        loaderInfo.addEventListener(ProgressEvent.PROGRESS, progress);
        loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioError);

        // TODO show loader
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.