Jump to content
Search Community

Sluggish Tweens with LoaderMax

mjperry51 test
Moderator Tag

Recommended Posts

I have two versions of a main class -- one uses LoaderMax and the other uses Flash loader variables. I have employed autoDispose to eliminate the LoaderMax instances when the all external swfs are loaded.

 

The tweens in the LoaderMax version are sluggish, and take from 1.5 to 2 times as long to execute. The non-LoaderMax version tweens are snappy, and take less time.

 

Any thoughts?? The items can be seen on a web site if needed -- obviously the non-LoaderMax version takes forever to load.

 

Thanks,

 

Mike

Link to comment
Share on other sites

I would absolutely LOVE to see the source files that clearly demonstrate the LoaderMax version adversely impacting the tweens. I cannot imagine how or why that could happen. They're completely separate and distinct processes/engines. The only thing I can think of is maybe you've got the LoaderMax version loading stuff in the background (which, of course, does impact performance because Flash needs to be doing stuff to load the files) whereas the non-LoaderMax version loads everything first and then does the tweens. Is that true?

Link to comment
Share on other sites

I would absolutely LOVE to see the source files that clearly demonstrate the LoaderMax version adversely impacting the tweens. I cannot imagine how or why that could happen. They're completely separate and distinct processes/engines. The only thing I can think of is maybe you've got the LoaderMax version loading stuff in the background (which, of course, does impact performance because Flash needs to be doing stuff to load the files) whereas the non-LoaderMax version loads everything first and then does the tweens. Is that true?

Look -- I'm not here to call anyone's baby ugly. I did not (mean to ) imply causality; that LoaderMax was the cuplrit. I am describing a relationship. The problem occurs in a SWF that utilizes LoaderMax, while it does not in a non-LoaderMax SWF.

 

I'll be the first to stipulate the the problem lies somewhere in my class code. I'm not a highly experienced AS3 coder as are many here. I don't have the background that allows me to intuitively sense a problem. My class code is certainly not elegant -- it utilizes OOP and encapsulation in bits and pieces, as I get more comfortable with the concepts and effective implementation. The problem is most likely of my own creation, since a search in the forum for 'Sluggish SWFs' and other related topics returned nothing. I did my best to find a solution before posting.

 

To answer some of your questions:

 

LoaderMax is not "active" when this occurs. The preloader Progress.COMPLETE eventListener has fired; and if I am using the files on our Web server I can see that the router is not active. Additionally the problem occurs on my machine (all files local) where there are no network bandwidth limitations.

 

The main class is over 800 lines -- I'm not going to clog the forum with that code. If you can make any suggestions as to tools I might utilize to see exactly whats happening when the two different SWFs play I'm more than willing to solve my own problems. As a novice I could use a little guidance, if you're so inclined.

Link to comment
Share on other sites

Ha ha - "ugly baby". I guess my post must have sounded defensive. Didn't mean it that way.

 

The best way I've found to troubleshoot these kinds of issues is to create a separate FLA and start with the simplest possible thing that you're doing in your problematic project and start building up from there and see when it breaks. For example, try JUST loading a super-simple swf with LoaderMax. Check. Okay, if that works, now introduce a tween as soon as the loading completes. See if it is sluggish as you described. If not, keep making this test FLA more and more like your problematic one. Maybe load one of your real swfs and see if you notice the issue only when a particular one of your swfs gets subloaded. You take baby steps closer and closer to what you're doing in your real project and at some point, you're gonna see it break (or get sluggish). Bingo - you've got your answer.

 

I wish there was a simple tool you could use that would magically identify problematic code or processes that are eating up a lot of CPU resources. I don't know of any, though.

 

Be careful about repetitive/looping processes like ENTER_FRAME handlers or Timers or MOUSE_MOVE handlers, etc. Sometimes those can get out of control if you don't code it properly, and they eat up more resources than you intended.

 

The thing that has me the most baffled is you said that the only difference between the sluggish and non-sluggish versions was LoaderMax. That's why I'm so anxious to see an example. I wonder if maybe there is something else that's different too which might be to blame for the sluggishness. I'm certainly not saying that there couldn't be a bug in LoaderMax. I'm just not aware of any. And hey, if my baby is ugly, I'm the kinda guy who'd wanna know :)

Link to comment
Share on other sites

Ha ha - "ugly baby". I guess my post must have sounded defensive. Didn't mean it that way.

 

The best way I've found to troubleshoot these kinds of issues is to create a separate FLA and start with the simplest possible thing that you're doing in your problematic project and start building up from there and see when it breaks. For example, try JUST loading a super-simple swf with LoaderMax. Check. Okay, if that works, now introduce a tween as soon as the loading completes. See if it is sluggish as you described. If not, keep making this test FLA more and more like your problematic one. Maybe load one of your real swfs and see if you notice the issue only when a particular one of your swfs gets subloaded. You take baby steps closer and closer to what you're doing in your real project and at some point, you're gonna see it break (or get sluggish). Bingo - you've got your answer.

 

I wish there was a simple tool you could use that would magically identify problematic code or processes that are eating up a lot of CPU resources. I don't know of any, though.

 

Be careful about repetitive/looping processes like ENTER_FRAME handlers or Timers or MOUSE_MOVE handlers, etc. Sometimes those can get out of control if you don't code it properly, and they eat up more resources than you intended.

 

The thing that has me the most baffled is you said that the only difference between the sluggish and non-sluggish versions was LoaderMax. That's why I'm so anxious to see an example. I wonder if maybe there is something else that's different too which might be to blame for the sluggishness. I'm certainly not saying that there couldn't be a bug in LoaderMax. I'm just not aware of any. And hey, if my baby is ugly, I'm the kinda guy who'd wanna know :)

Guess that's what happens when I respond before my 2nd cup of coffee :oops:

 

I can send you two links to the versions on our server if you want to see it in "full glory". As I said -- the non-LM version currently takes about two minutes to load over a 10MBs cable connection -- I'll make a change to see if I can reduce what''s being loaded to reduce the time.

 

I didn't know if there were any tools that could monitor/report Flash Player processes -- doesn't sound like there are. I'll build up a stub that emulates my main swf and play with that.

 

I did notice that the non-LM version requires more memory -- that's probably because the loaders stay loaded.

 

I have been very careful to remove event listeners and restrict needed timers to one and done - found out about runaway timers early on!!

 

If I find something I'll let you know -- sorry for my grumpiness. . .

 

Mike

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...