Skip to content
This repository was archived by the owner on Jan 20, 2020. It is now read-only.
This repository was archived by the owner on Jan 20, 2020. It is now read-only.

changing a property from two different locations causes erratic behavior.. #84

@GoogleCodeExporter

Description

@GoogleCodeExporter
0. using the latest version of tweener..

1. create an MC with registration point in the center.
2. add to stage with _x=Stage.width/2 and _y=-_height so that it doesnt appear.
3. add a tween on _y:Stage.height/2 so it animates down to the center of stage.

this works just fine.. but..

4. add an onResize() handler to stage..
5. set _x=Stage.width/2 and _y=Stage.height/2 to keep the MC in the center of 
stage..
6. resize browser window while the previous tween is running..
7. MC goes haywire.. in some cases disappears from stage altogether..

i know the problem arises when the a property is changed while tweener is 
messing with it.. but there has to be a workaround for it.. something like..

1. this is assuming that tweener calculates property values after each update 
instead of calculating the entire sequence of values before tweening..
2. save the final value of the property in a known location and use the current 
value vs final value to calculate the new value.. also flag the MC as tweening..
3. in stage.onResize(), we could check if the MC is tweening.. if not, we 
directly change the _x and _y.. if yes, then we change the final value of the 
property where tweener has saved it..
4. tweener uses the changed final value to calculate the new property value..

i hope i was clear in explaining that.. if there already exists a workaround.. 
do tell..

awesim..

Original issue reported on code.google.com by awe...@gmail.com on 17 Dec 2011 at 5:32

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions