Skip navigation
Currently Being Moderated

Preload to Memory ( is that even possible )  ?

Apr 3, 2012 10:09 PM

   So I noticed with the app I am working on.  There are some stutters the first time a section animates on the stage.  Once its been seen on the stage is performs great for the duration of the session.

 

     is there a way to preload all these movieclips to memory or something so that they will always perform great from the first time they are displayed to the stage ?

 
Replies
  • Currently Being Moderated
    Apr 3, 2012 11:11 PM   in reply to Applauz78

    I've found I sometimes experience less stutter if I have everything on the display list and control through visible rather than add/remove children.

    Also you can try hiding through off screen x or y properties.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 6:18 AM   in reply to Applauz78

    It sounds like you're using GPU. When you do, the bitmap doesn't get transferred to the GPU until the first time it is within the stage area. If you smoothly animate it from outside of the stage, it will stutter as  it goes into the stage area. You can solve that by placing it in the stage area for at least one frame's worth of time before you move it. It can be invisible at the time, it will still be cached. Then on the frame where you start to animate it, set it to be visible.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 9:49 AM   in reply to Applauz78

    The simple solution is to have a loading screen and simply place all your concent on the stage hiddent behind the loading screen image, then proceed to the level or animation you are loading, this way you get that first time on stage part out of the way in the background.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 9:53 AM   in reply to Applauz78

    Put that second level movie clip to load on the stage as well.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 9:55 AM   in reply to Applauz78

    Of course that will be the case. You would need the sub movieclip to be in the stage area of the movieclip. You're only just getting a hint of why I like Direct more than GPU, if Direct ends up being good enough!

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 10:14 AM   in reply to Applauz78

    Love me some TweenMax, TweenLite. Anyhow you can then pretween your content before you show it to the user, do an accelerated tween so in like .1 seconds.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 10:31 AM   in reply to Applauz78

    I wasn't expecting that having the sub movieclip on the stage would help. If it's on the stage area of the movieclip it is in, then I would expect it to work.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 10:47 AM   in reply to Applauz78

    Oh I sounded over complicated on my post, I am still in that whole hide your content you want to load in the background mode, then tween it it while its hidden once, just an accelerated version of it, then when you tween it for the user it will be pre tweened.

     

    This is kind of a hacky way of doing it, but if it works and solves your issue then who cares, right?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 11:33 AM   in reply to Applauz78

    So it still stutters when you tween it the second time? Seems strange since you said after you tween it once the second time around it runs smooth, so the hidden tween would be the tweening it once and the visible tween would be the smooth tween.Did you tween it the first time while its set to visible = false? If so do it with it being visible, although hidden, you know what I mean.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 11:36 AM   in reply to Mark.Raykhenberg

    The visibility won't affect whether it's cached. Whether it's inside the stage area does. Having the same symbol cached at a different position in the hierarchy doesn't mean that other cases where the symbol is used is also cached.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 11:42 AM   in reply to Applauz78

    What is the movie clip in question, is it just a still graphic or is it a timeline animation, or are you tweening children inside the parent mc from the stage?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 11:49 AM   in reply to Applauz78

    And then you are tweening those 15 movie clips from the main stage?

     

    And from previous post it sounds like you have tried putting those 15 mcs in the preloading hidden screen? correct?

     

    From my experience flash seems to have a bit of a delay playing sounds or movie clips or anything the first time it encounters it however playing it once before seems to solve this problem, not sure why any of my pro tips are not helping

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 12:00 PM   in reply to Applauz78

    Try preloading those 15 mcs separately on the preload hidden screen, just for my own amusement.

     

    Also try it without addChild but just plop those movie clips down on the timeline.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 12:00 PM   in reply to Applauz78

    How long after you addChild the MainMovie_MC do you tween it?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 4, 2012 12:30 PM   in reply to Applauz78

    Now I am totally confused. You tried taking out the 15mcs from the parent and putting them on the timeline? I was suggesting just duplicating them on the timeline as their own entities and still keeping them in the parent mc, I am guessing you put them all in one mc for a reason. Also how does your loading screen work? Are you pausing on it for a second or two or do you just let the movie play through that frame? You might need to stop there for a few seconds to allow flash to load up all the assets.

     
    |
    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