Remove attached clip and go to a frame on a main movie


i attaching movie clip on main movie wthi sthis:

 

exit_btn.addeventlistener(mouseevent.click, fexit, false, 0, true);

function fexit(e:mouseevent):void{

    var mc:alert_mc=new alert_mc();

    mc.x=320;

    mc.y=210;

    addchild(mc);

}

 

i need make main movie go frame 6 , remove attached clip when click on yep_btn button. code on attached clip is:

 

nope_btn.addeventlistener(mouseevent.click, cancelunloadexitb);

yep_btn.addeventlistener(mouseevent.click, unloadexitb);

 

 

function cancelunloadexitb(e:mouseevent):void {

    var snd:sound1 = new sound1();

    snd.play();

    this.parent.removechild(this);

}

 

function unloadexitb(e:mouseevent):void {

     var snd:sound1 = new sound1();

    snd.play();

    i need code here

}

 

function errorf(e:ioerrorevent):void{

 

trace(e);

 

}

 

any ideas?

if code inside alert_mc object, can try...

 

function unloadexitb(e:mouseevent):void {

     var snd:sound1 = new sound1();

    snd.play();

    movieclip(parent).gotoandstop(6);

    movieclip(parent).removechild(this);

}

 

another way have alert_mc dispatch event assign listener in main, , have main event handler function listener deal removing child , moving on own timeline.



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support