Skip navigation
Currently Being Moderated

movie clips: 'visible' vs 'stop' as far as Fla performance

Jan 12, 2014 1:21 PM

Hi All,

I would like to know if I should stop a FLV from playing as well as make it invisible (MC.visible = false) as a 'best practice.' Does an invisible movie clip -that was not stopped- cost more as far as cpu performance than a movie clip that was both stopped and made invisible?

Thanks

 
Replies
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 12, 2014 2:19 PM   in reply to paul_james123

    an flv is a video file that would typically be played in an flvplayback component or using the netstream class.  you might be calling the flvplayback component a movieclip.

     

    in any case it's most efficient to remove unneeded objects from the display list (using removeChild, for example), remove their listeners (if there are any) and null all references.

     

    actually stopping an flvplayback component's play or a movieclip's timeline doesn't usually do much to help swf performance.  making an object not visible can (usually modestly) help video performance.

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 13, 2014 9:12 AM   in reply to paul_james123

    use removeChild to remove the movieclip and use removeEventListener applied to the movieclip and flvplayback component if you used addEventListener to either object IF the objects will not be needed again.

     

    if you want to allow the user to replay the flv, you probably should just use removeChild when they don't need to see the flv and then use addChild so they can see it.

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Jan 13, 2014 4:32 PM   in reply to paul_james123

    if the movieclip's timeline is playing there might be some (very small) benefit to stopping the movieclip.  setting visible to false in addition to removing a movieclip from the display won't afford any additional benefit.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 14, 2014 8:37 AM   in reply to paul_james123

    You need to make sure you release all references to it. Otherwise, whether it's on the display list or not (or visible or not) makes very little difference to how many resources it's using.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 14, 2014 11:21 AM   in reply to paul_james123

    If you've called addEventListener from anything inside your MC (i.e., the function that was added lives somewhere in the instance and the object you called it on lives outside the instance), you need to remove that as well.

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 14, 2014 12:43 PM   in reply to paul_james123

    If the addEventListener looks like

     

    parent.addEventListener(...)

     

    or

     

    root.addEventListener(...)

     

    you need to make sure it's removed.

     
    |
    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