Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Look at the removeChildAt() method of a MovieClip. If you have only one child in your bar and a roll out listener, it could be sth like that:</p> <pre><code>public function mouse_over_bar(ev:MouseEvent):void{ var currentBar : MovieClip = ev.target as MovieClip; currentBar.removeChildAt(0); } </code></pre> <p><strong>EDIT:</strong></p> <p>Uh I'm sorry, I thought you where adding the hover to the bar as a child. If you add the hover to the same parent movieclip as the bar is added, you have to store a reference to the hover outside the function. And if you have many hovers, you could store it in an array.</p> <pre><code>private var _hoverArray : Array = new Array() public function mouse_over_bar(ev:MouseEvent):void{ var hover:MovieClip=new Hvr(); _hoverArray.push(hover); var tween:Tween; addChild(hover); hover.x=mouseX; hover.y=mouseY; TransitionManager.start(hover,{type:Fly,direction:Transition.IN,duration:1,easing:Strong.easeInOut}); hover.Hd1.text= xmlFile.children()[2]. @ name; hover.descrpt.text= xmlFile.children()[2]. @ des; } </code></pre> <p>Then you have to find a way, to indicate the hover object you want to remove. I would suggest you to define a new class called "hover", extends MovieClip, give it an ID, and also give your bars an ID. So if you roll out, you can search the _hoverArray for the ID and remove it.</p> <pre><code>public function mouse_over_bar(ev:MouseEvent):void{ var currentBar : BarClass = ev.target as BarClass; var barID : int = currentBar.id; var currentHover : Hover; for each(var h : Hover in _hoverArry) { if(h.id == barID) { currentHover = h; break; } } if(currentHover) removeChild(currentHover); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload