0
votes

I'm developing an ActionScript mobile project for Android.

When I add the following import, compiler says that is not found.

import fl.transitions.Tween;

How can I use Tween with mobile projects?

package{
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.events.MouseEvent;
    import fl.transitions.Tween;
    import fl.transitions.easing.Strong;

    public class spriteButton extends Sprite
    {
        private var alphaOver:Tween;
        private var alphaLabelOver:Tween;
        private var alphaLabel:Tween;

        public function spriteButton(newLabel:String)
        {
            myLabel.text = newLabel;
            myLabelOver.text = newLabel;
            myLabelOver.alpha = 0;
            buttonMode = true;
            mouseChildren = false;
            addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
            addEventListener(MouseEvent.MOUSE_OUT, handleMouseOut);
            addEventListener(MouseEvent.MOUSE_UP, handleMouseUp);
        }

By the way, I'm very new on ActionScript 3.0 development.

I get this errors:

The import fl could not be found.
The import Tween could not be found.

Description Resource    Path    Location    Type
1172: Definition fl.transitions:Tween could not be found.   spriteButton.as /Test01/src line 4  Flex Problem
1
Did use the import statement? "import fl.transitions.Tween;" If not post the full error message. - The_asMan
very odd import fl could not be found. I see it is in a custom class spriteButton. I am going out on a leap here but I bet you have something wrong in the first 10 lines of that class. Please post the first 10 lines of spriteButton.as - The_asMan
Question updated. I'm sure the problem is that fl.transitions.Tweens is not available on mobile projects. - VansFannel
From the error It can't locate the whole fl package - The_asMan
try this import fl.transitions.*; and import fl.transitions.easing.* - The_asMan

1 Answers

0
votes

if you are new to AS3, then use this library: http://www.greensock.com/tweenmax/ for tweenning objects.