Got this code
function onOver (event:MouseEvent):void
{
var panel:MovieClip = new storePanel();
addChild(panel);
panel.x = event.target.parent.x + -25;
panel.y = event.target.parent.y + -128;
panel.alpha=0;
TweenLite.to(panel, .7, {alpha:1, ease:Sine.easeOut});
panel.storeText_txt.text = walesArray[buttonArray.indexOf(event.target)];
}
function onOut (event:MouseEvent):void
{
removeChildAt(this.numChildren-1);
}
Firstly removeChildAt(this.numChildren-1); is working but is this the best way of removing the child?
More importantly, in the onOut function I want to tween out the panel object but I don’t seem to be able to reference panel. For instance even if I said panel.alpha = 0; I get an error, why is this? and how can I talk to my newly created panel movie clip in the onOut function.
Thanks guys, I know I’ve asked loads recently but I’m really getting into my AS. I know I don’t know much but I’m really wanting to learn more!