hi, i create three circles. if a circle is dragged to right side of the stage, it becomes invisible and vice versa. when MOUSE_UP is invoked, it must stay in its last position.
so in the appear() function how can i assign the selected circle to current_mc?
function createCircles(evt:Event):void
{
for(i=0; i<3; i++)
{
var figure:Sprite=new Sprite();
figure.circle.x=10;
figure.circle.y=i*figure.circle.height*1.02;
figure.circle.buttonMode=true;
figure.circle.addEventListener(MouseEvent.MOUSE_DOWN,downFNC);
addChild(figure.circle);
}
}
function downFNK(evt:MouseEvent):void{
current_mc=MovieClip(evt.target);
current_mc.x=mouseX;
current_mc.y=mouseY;
stage.addEventListener(Event.ENTER_FRAME,appear);
}
function appear (evt:Event):void
{
current_mc=???
current_mc.x=mouseX;
current_mc.y=mouseY;
if(mouseX > stage.width/2)
current_mc.visible=false;
else
current_mc.visible=true;
stage.addEventListener(MouseEvent.MOUSE_UP, upFNC);
}
function upFNC(evt:MouseEvent):void
{
stage.removeEventListener(Event.ENTER_FRAME, appear);
}