AS3 click event added to stage but fires when clicking on a movieclick
i am a as3 newbie! I added a click event to the stage but this event also fires when i'm clicking a movieclip on the stage.
How can i make this event fire only if i click directly on the s开发者_运维技巧tage?
Thanks for any advice!
because of event bubbeling every click will also fire an stage click event. You can check in your function what the clicked target was by checking the currentTarget of the event.
if(e.currentTarget == stage){
//do your stuff
}
create layer at the bottom, add graphic that covers whole screen, convert it to symbol, add name to it and assign click event
精彩评论