That makes sense. Good find. I'm no longer with Yahoo! anymore, but
I'm sure someone else on the Flash Platform team there can patch it up
for you.
Josh Tynjala
On Tue, May 20, 2008 at 2:25 AM, oskarjoelson <oskarjoelson@...> wrote:
>> Until then, you should be able to add
>> this line before the return statement to fix it:
>>
>> animations.push(animation);
>
> That seems to do it!
>
> This leeds to another problem though. Since removeAnimation() modifies
> the animations array by splicing it, looping over the same array in
> the beginning of create() whilst removing items from it will in some
> cases trigger an error. I recommend making a copy of the animations
> array and looping over that instead, like this:
>
> var animationCount:int = animations.length;
> var animationsCopy:Array = animations.concat( new Array() );
> for(var i:int = 0; i < animationCount; i++) {
> var oldAnimation:Animation = Animation(animationsCopy[i]);
> //stop it at the current position
> oldAnimation.pause();
> removeAnimation(oldAnimation);
> }
>
> A little clarification, the following:
>
> var animationsCopy:Array = new Array( animations );
>
> led to a Type Coercion error, so I used concat() instead.
>
> /Oskar
>
>