Avg. Rating 3.0

Problem

Hide a MovieClip after 2 seconds

Solution

Using setTimeout function.

Detailed explanation

my_btn.useHandCursor=true;
function hideBall() {
    my_mc.visible=false;
}

my_btn.addEventListener(MouseEvent.CLICK, deleteBall); function deleteBall(event:MouseEvent):void { setTimeout(hideBall, 2000);
}

 

 

Need delay event. After clicking to button ball must hide after 2 sec delay.

Source in attached files.

Thank you for reading.


+
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License. Permissions beyond the scope of this license, pertaining to the examples of code included within this work are available at Adobe.

Report abuse

Related recipes