Skip navigation
Currently Being Moderated

MovieClip & Event.FRAME_CONSTRUCTED

Jun 20, 2012 5:53 AM

Hi,

I got a little trouble when I was using Event.FRAME_CONSTRUCTED with MovieClips, I want to know if I was rgiht about: If a movie clip contains only one frame, when MovieClip.goto() function is called, Event.FRAME_CONSTRUCTED is dispatched depends on flash player version.

I realize it when I was debugging something else, so is that correct, and is there any way that I can know if a movieclip is already "FRAME_CONSTRUCTED" so I don't need to add event listener(such as, mc.isConstructed?).

Thank you for any information.

 
Replies
  • kglad
    62,165 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 20, 2012 6:09 AM   in reply to AndrewYuCWA1987

    what are you trying to do?

     
    |
    Mark as:
  • kglad
    62,165 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 20, 2012 11:38 AM   in reply to AndrewYuCWA1987

    if you want to apply the draw method to a movieclip frame, you should use the render event to ensure all objects in the frame have been rendered:

     

    mc.addEventListener(Event.RENDER,renderedF);

    drawF(1);

     

    function drawF(frameNum:int):void{

    if(mc.currentFrame!=frameNum){

    stage.invalidate();

    mc.gotoAndStop(frameNum);

    } else {

    renderedF(null);

    }

     

    function renderedF(e:Event):void{

    // draw mc to a bitmap

    frameNum++;

    if(frameNum<=mc.totalFrames){

    drawF(frameNum);

    }

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points