Skip to main content
Participant
August 9, 2009
Question

removing picture in gallery

  • August 9, 2009
  • 1 reply
  • 334 views

Hello,

I wanted to remove the pictures that I loaded before moving to another frame.

I have a movieclip that when click call function moveW()

The function work if I didn't add the command to change frame, but when I add command to change frame the function move to different frame before removing the pics. Does anyone know how I can fix this?

Thanks,

this is the function:

    function moveW(event:MouseEvent)
{
    var i:int = 0;
        for (i=0; i<=count; i++)
        {
            scene.removeChild(arr);
            }
            arr=[];
            count=0;
      gotoAndStop(2);
    }

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 9, 2009

Chances are yoiur removal code isn't working.  The for loop will process before anything moves to a new frame.  You can confirm this by putting a trace in the loop--assuming "count" is a value > 0.  Try tracing each variable in that loop to make sure you don't have something there that would cause it to skip the loop.