PDA

View Full Version : Flash 9 - Tween class


jad
07-10-2006, 08:28 AM
hello,
with F9 Tween class seems not working? Someone can help or explain me? There is an error:

**Error** Scene 1, Layer 'Scripts', Frame 1 : Line 12, Column 7 : [Compiler] Error #1046: Type was not found or was not a compile-time constant: Tween.
var t:Tween = new Tween(this,10,200,1500,12);
ReferenceError: Error #1065: La variabile Timeline0_8eb6c9b2ba18d443808882ca858681e non è definita.

This is the fla code:

import mx.effects.Tween;
import mx.effects.easing.Bounce;

function onTweenUpdate(position:Number) {
clip_mc.x = position;
}

function onTweenEnd(endPosition:Number) {
trace("onTweenEnd");
}

var t:Tween = new Tween(this,10,200,1500,12);
t.easingFunction = Bounce.easeOut;

Fall_X
07-10-2006, 03:22 PM
Apparantly, there is no Tween class. Or at least not in the documentation : http://livedocs.macromedia.com/labs/as3preview/langref/ - there might be another way to do it though.

No mx package either, by the way.

Tink
07-10-2006, 05:41 PM
http://livedocs.macromedia.com/flex/2/langref/mx/effects/Tween.html

but its mx so ya can't use it in Flash.

senocular
07-10-2006, 07:25 PM
Teh AS3 preview for Flash did not come with the mx framework so those mx classes are not available.

Now, Flex comes with the mx frameworks, and you can even get the flex sdk for free, meaning you can get the mx classes for free. However, they don't work so seemlessly in Flash (they're catered pretty much to work with Flex). However, I think someone in the AS3 tip of the day thread (http://www.kirupa.com/forum/showthread.php?t=223798) fixed Tween to work with Flash 9 (might have to dig in that a little to find where its posted)

jad
07-11-2006, 08:32 AM
yes I tried to use the mx framework from Flex but it's a real big dig in (too much to change) so I left.
I belive it's better to forget Flash 9 for now, thanks to all.

Incrue
07-11-2006, 11:45 AM
Just because of this?Why dont you make your own tween class or convert some other to AS3?

devonair
07-11-2006, 01:27 PM
there's not that much to change in the flex classes (I'm the "someone" to whom senocular referred :) )

being the nice guy I am, I'll attach the classes.. just add the mx directory to your flash 9 classpath...