Google Product Forums

Re: DoubleClick AS3 V2 - child swf functions

castillom Mar 30, 2012 10:45 AM
Posted in group: DoubleClick Rich Media

Categories: Studio Flash Components :

Hi Flashdev,


You can call functions inside the child once it's loaded in the parent, using AS3 V2 components, by using the following code:


import flash.display.MovieClip;

function registerChild(ev:StudioEvent):void {

(mc_loader.getChildAt(0) as MovieClip).myFunction();

//mc_loader is the movieclip which loads the child on the parent file

//myFunction() is the function in the child file that you want to call from the parent file

};

// Using ExpandingComponent

Expanding.addEventListener(StudioEvent.LOAD, registerChild);

// Using Loader Component

polite.addEventListener(StudioEvent.LOAD, registerChild);


Hope it helps.

Regards.