Skip to main content
Participating Frequently
April 18, 2013
Answered

I need to remove a library item from the stage

  • April 18, 2013
  • 1 reply
  • 376 views

Right now I have a button that brings a library symbol to the stage. Ideally, I want to be able to click on the symbol itself to make itself from the stage. Can anyone help me with this?

This topic has been closed for replies.
Correct answer kglad

for example:

var sym:WhateverClass=new WhateverClass();

sym.addEventListener(MouseEvent.CLICK,clickF);

function clickF(e:MouseEvent):void{

e.currentTarget.parent.removeChild(e.currentTarget);

}

1 reply

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
April 18, 2013

for example:

var sym:WhateverClass=new WhateverClass();

sym.addEventListener(MouseEvent.CLICK,clickF);

function clickF(e:MouseEvent):void{

e.currentTarget.parent.removeChild(e.currentTarget);

}