1
votes

So, I'm trying to do a simple tween in my AIR for android app,

I am targeting Air 3.2 for android, all works perfectly fine until I try and Tween an object.

if i try and import flash.event.TweenEvent, if fails.

Can you do tweens when targeting AIR for Android??

EDIT

here is my class file

package {

import flash.display.*;
import flash.events.*;

public class AppName extends MovieClip {

    var a:MovieClip = new MovieClip();

    public function AppName() {
        addEventListener(Event.ADDED, added);
    }

    public function added(e:Event):void {
        removeEventListener(Event.ADDED, added);
        with(a.graphics){
            beginFill(0xff9900,1);
            drawRect(0,0,100,100);
            endFill();
        }
        addChild(a);
        var b:Tween = new Tween(a,"x",null,a.x,200,1,true);
        b.addEventListener(TweenEvent.MOTION_FINISHED, process);
    }

    public function process(e:TweenEvent):void {
        var c:MovieClip = new MovieClip();
        with(c.graphics){
            beginFill(0xff9900,1);
            drawRect(0,0,100,100);
            endFill();
        }
        addChild(c);
    }
}
}

It's only when I add the event listener and function to handle the event that flash spits its dummy out. it says that there is an error within the line containing "public function process(e:TweenEvent):void {"

1
Are you using flash builder or the flash cs6 IDE? - J. Holmes

1 Answers

3
votes

Sure you can. I suggest using a tweening library TweenMax. As it is a lot faster and easier than Flash's default tweening engine. What tool are you using to develop your application? That might give a clue about your problem source.