Jump to content
Search Community

TweenEvents and setElementIndex problems

moxol test
Moderator Tag

Recommended Posts

I have noticed that setElementIndex for tween object can affect tween events in a way such that they are not dispatched.

 

I must say that I can't provide an example because I am not sure when those problems exactly arise, but I have noticed that TweenEvent.UPDATE is not always dispatched if setElementIndex is running at the same time for tween object. I have seen for example that UPDATE is dispatched only once at beginning and never again. setElementIndex() method is using remove and add element to rearrange indexes so probably that's the cause for tween events problems. Also I have noticed that if tween objects have TweenEvent.UPDATE and TweenEvent.COMPLETE events and I do TweenMax.killAll(true) in Event.RESIZE listener, results of completion of code in those tween events listeners are not always equal if they include some movements of tween objects.

 

I don't know if anyone had such problems, but I have done testing and I can't reproduce them in a simple app, but in complex app that I am developing when there is FXG graphics and lots of code behind, those problems are occuring.

Link to comment
Share on other sites

I'm pretty confident that this isn't related to anything in the tweening platform and I suspect you just have some sort of error in your code that's halting Flash Player's execution of code, that's all. There is absolutely nothing in TweenLite/Max that is dependent on the target's child index or anything remotely like that. Unless maybe you're using a special plugin that has to add/remove something from the display list (MotionBlurPlugin?), but that's doubtful. Even if that was the case, it wouldn't just cause events to stop being dispatched - it would probably just throw an error (which would likely cause the Flash Player to cease executing code). See what I mean?

 

The only other thing I can think of is if you've written code that causes a tween to get overwritten (or killed) - in that case it wouldn't continue to dispatch UPDATE events. Pretty tough to diagnose blind, though. Hopefully something here is helpful. I'm glad to hear you tried to reproduce the problem in a separate, simplified file - that's always what I recommend. Unfortunately it sounds like you couldn't reproduce the problem that way. I suppose that's good news and bad news at the same time :) I'd recommend taking your simple example and keep building it up to mimic your real project until it breaks. At that point, you'll know exactly what's causing the error.

Link to comment
Share on other sites

I'm pretty confident that this isn't related to anything in the tweening platform and I suspect you just have some sort of error in your code that's halting Flash Player's execution of code, that's all. There is absolutely nothing in TweenLite/Max that is dependent on the target's child index or anything remotely like that. Unless maybe you're using a special plugin that has to add/remove something from the display list (MotionBlurPlugin?), but that's doubtful. Even if that was the case, it wouldn't just cause events to stop being dispatched - it would probably just throw an error (which would likely cause the Flash Player to cease executing code). See what I mean?

 

The only other thing I can think of is if you've written code that causes a tween to get overwritten (or killed) - in that case it wouldn't continue to dispatch UPDATE events. Pretty tough to diagnose blind, though. Hopefully something here is helpful. I'm glad to hear you tried to reproduce the problem in a separate, simplified file - that's always what I recommend. Unfortunately it sounds like you couldn't reproduce the problem that way. I suppose that's good news and bad news at the same time :) I'd recommend taking your simple example and keep building it up to mimic your real project until it breaks. At that point, you'll know exactly what's causing the error.

 

I'll continue to track this problem, and hopefully get exact description.

 

But problem exists, and as I mentioned, if I don't use setElementIndex() method then tweening is ok, but if I use it, then tweening events can be unsent, and I can I give one more clue to it and that is happening if rendering is going slower, if there's a slow frame rendering, slow animation...

 

I suspect Flash runtime has something to do with it, and if I find exact cause, then it should be taken in consideration.

Link to comment
Share on other sites

I'm sure the problem exists - I'm just saying I don't think it has anything specifically to do with the tweening platform. I can assure you that the tweening platform is rock solid regardless of the frame rate; there's nothing in the code that would break if the frame rate bogs down. It is built with that in mind, actually. Updates only occur on ENTER_FRAME.

 

Is Flex/Flash throwing any runtime errors?

Link to comment
Share on other sites

I'm sure the problem exists - I'm just saying I don't think it has anything specifically to do with the tweening platform. I can assure you that the tweening platform is rock solid regardless of the frame rate; there's nothing in the code that would break if the frame rate bogs down. It is built with that in mind, actually. Updates only occur on ENTER_FRAME.

 

Is Flex/Flash throwing any runtime errors?

 

No, just on screen is visible (in my case) wrong x,y, width and/or height of FXG's.

I will keep track of it, and update as the news are coming... :arrow:

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