Jump to content
Search Community

Tween large or complex or complicated Movieclips

Chris7777 test
Moderator Tag

Recommended Posts

Hey, how's it going?

 

As always great engine! Its still the only actionscript engine/library I have ever purchased (not sure if its linked to my forum account but i am a greensock member, and am proud of it).

 

Anyway, I am building a gallery that loads an external SWF, and on clicking "next", I tweenlite a bitmapped clip (see below) onto the stage (x,y values). I want to load in infinite items, so as each leaves, they are destroyed.

 

The SWFs loaded in can be very complicated so I use bitmapdata to "draw" the movieclip, then create a bitmap based on that, then add that bitmap to a movieclip and tween that in. On tween complete I remove the bitmapped version of the movieclip, and swap in the real movieclip.

 

I find that after several "next"s the framerate drops massively during the tween (then bounces back up to the correct frame rate on completion), now this is most likely due to a leak in my code somewhere, BUT, I was wandering what is the best way of dealing with large or complicated movieclips when tweening? Should i be drawing them out as above, or something else?

 

I do stress, the slow down is my fault somewhere, nothing to do with the greensock engine.

Link to comment
Share on other sites

Yeah, if you've got large, complicated SWFs, draw() them to a BitmapData which you dump into a Bitmap and tween that. Don't forget to set visible to false on your original MovieClip too. And there are known memory leaks with subloaded swfs in Flash that can be a bit tricky to eliminate (see Grant Skinner's article on that - Google it). And if you're tweening objects off the stage, make sure you're removing them from the stage altogether or setting visible to false there as well so that the graphics rendering engine in Flash doesn't have to composite it. I'd be willing to bet that 95%+ of your CPU load has to do with graphics rendering, not ActionScript code execution.

 

Oh, and I'm glad to hear you're diggin' the Club GreenSock membership. Thanks so much for being a supporter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...