PDA

View Full Version : calling a function of a parent


flashysite
08-05-2009, 09:10 AM
I have two movies... main.swf and content.swf, and I'm trying to call a function in my main.swf from my content.swf. Here is the code..

//function in main.swf
function appear (event:MouseEvent):void{
TweenLite.to(title1, 1, {autoAlpha:1, overwrite:false});
}

//try to call from loaded content.swf
close_btn.addEventListener(MouseEvent.CLICK, btnClick);
function btnClick(event:MouseEvent):void {
MovieClip(parent.parent).appear();
}


I got an error message as soon as i click on close_btn. It says appear() is not a property or method.

Would someone help me out on this please?


Thank you very much.