0

Greeting, I have two flash files myVideo1.swf and myVideo2.swf Each one contents FLVPLAYBack component . myVideo1.swf FLVPLAYBack component instance name is “video1” myVideo2.swf FLVPLAYBack component instance name is “video2” I want to be able to access myVideo2.swf from myVideo1.swf using as3. I want when I click play button on myVideo2.swf the myVideo1.swf would stopped. Bother flash files are in the same folder. Please advice how to do this in action script 3 Regards,

1 Answer 1

1

First when you load your swf you need to set the loader context domain to your current domain

    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
    var request:URLRequest = new URLRequest('swf/assets.swf');
    var context:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain);
    loader.load(request, context);

Then you can access library items set to export using:

    var MyClass:Class = Class(ApplicationDomain.currentDomain.getDefinition("export_id"));
    var myInstance:Sprite = new MyClass() as Sprite;
Sign up to request clarification or add additional context in comments.

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.