calling a function of a parent

By flashysite | Aug 5, 2009

actionscript3

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.

actionscript3

Please reply at our Forum

Leave a Comment

If you would like to make a comment, please fill out the form below.

Name (required)

Email (required)

Website

Comments

© 2007 ActionScript 3.0