Jump to content


accessing parent(maintimeline) from child SWF

Recommended Posts

Hello I'm using SWFloader and LoaderMax to load 2 swf. One of these SWF needs access to a function from the maintimeline when user clicks. So, within the eventlistener handler function of child swf, I previously used:


(root.loaderInfo.loader.root as MovieClip).function();


This worked with AS3 loader class, but now it's null. Can I get this to work with SWFLoader and LoaderMax? If not, is there a way you recommend?


Thank you,


Link to comment
Share on other sites

inside your child swf try:


var parentMovie:MovieClip = this.parent.root as MovieClip;


inside your parent movie use


function someFunction():void{
trace("it worked!");

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.