how to use fl.transitions in haxe

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

how to use fl.transitions in haxe

CraX SUN
Hi all,

I have got a problem when using fl.transitions, it seams haxe havn't
packaged fl.* in the recent version?

How can i solve it except using TweenHX or FEffects.

thx
crax

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: how to use fl.transitions in haxe

Viktor Hesselbom
Probably because the fl.* package is part of Flash and not Flex. That would be my guess.

If you want to use tweens you should use any haXe built tween engine or port your favorite one from ActionScript.

2008/11/13 CraX SUN <[hidden email]>
Hi all,

I have got a problem when using fl.transitions, it seams haxe havn't
packaged fl.* in the recent version?

How can i solve it except using TweenHX or FEffects.

thx
crax

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: how to use fl.transitions in haxe

Baluta Cristian
haxe has no components, so the only way is to use one of those classes mentioned by you, or, probably, you can compile fl package into a swf that you use as a resource. not shure how to use it after.

On Thu, Nov 13, 2008 at 3:06 PM, Viktor Hesselbom <[hidden email]> wrote:
Probably because the fl.* package is part of Flash and not Flex. That would be my guess.

If you want to use tweens you should use any haXe built tween engine or port your favorite one from ActionScript.

2008/11/13 CraX SUN <[hidden email]>
Hi all,

I have got a problem when using fl.transitions, it seams haxe havn't
packaged fl.* in the recent version?

How can i solve it except using TweenHX or FEffects.

thx
crax

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org



--
Cristi
www.ralcr.com

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: how to use fl.transitions in haxe

filt3r
Hi,
You can find fl package in a swc with flex compiler.
You just have to include it and you'll be able to use its classes.
But why don't you use FEffects for example ? give me reasons so I could imrpove
ti maybe ?
Regards,
Michel

Selon Baluta Cristian <[hidden email]>:

> haxe has no components, so the only way is to use one of those classes
> mentioned by you, or, probably, you can compile fl package into a swf that
> you use as a resource. not shure how to use it after.
>
> On Thu, Nov 13, 2008 at 3:06 PM, Viktor Hesselbom <
> [hidden email]> wrote:
>
> > Probably because the fl.* package is part of Flash and not Flex. That would
> > be my guess.
> > If you want to use tweens you should use any haXe built tween engine or
> > port your favorite one from ActionScript.
> >
> > 2008/11/13 CraX SUN <[hidden email]>
> >
> >> Hi all,
> >> I have got a problem when using fl.transitions, it seams haxe havn't
> >> packaged fl.* in the recent version?
> >>
> >> How can i solve it except using TweenHX or FEffects.
> >>
> >> thx
> >> crax
> >>
> >> --
> >> haXe - an open source web programming language
> >> http://haxe.org
> >>
> >
> >
> > --
> > haXe - an open source web programming language
> > http://haxe.org
> >
>
>
>
> --
> Cristi
> www.ralcr.com
>



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: how to use fl.transitions in haxe

jlm@justinfront.net
In reply to this post by CraX SUN
Crax

Your probably a guru at haxe/flash or something so maybe my post is  
totally not useful but just incase your a newbie at haxe like me I  
gather you just want to tween stuff in flash so here's what I would  
suggest.

Tweener or similar is often used by flashers rather than the adobe  
stuff, and the haxe Tweener one works well, it might be heavy but  
there is a lite compile option, its fairly simple to use but I tend  
to like being obvious so here is a recent example of me testing haxe  
out (nothing remotely exciting! just proof of functioning), first you  
need to get Tweener

// in terminal or similar type ( I think )
haxelib install TweenerHX

and then use it, here is a simple test I was using the other day.

// compile code (Base happens to be in my namespace)
[code]
-cp net/justinfront/
-swf9 base.swf
-lib TweenerHX
-main Base.hx
-swf-header 320:240:30:3B3885
[/code]

[code]
//
//  Created by JLM at justinfront dot net
//  Base - basic test class
//  9 November 2008
//


import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.Lib;
import flash.display.Stage;
import flash.text.TextField;
import caurina.transitions.Tweener;

class Base extends Sprite
{


     private var _stage:     Stage;
     private var _txt:       TextField;
     private var _mc:        Sprite;


     public function new ():Void
     {

         super();
         _stage = Lib.current.stage;
         init();

     }

     private function init():Void
     {

         _txt        = new TextField();
         _txt.text   = "Test";
         _mc         = new Sprite();
         _mc.x       = 70;
         _mc.y       = 70;
         drawRect( _mc, 50, 50, 0xFF0000 );
         _stage.addChild( _mc );
         _stage.addChild( _txt );
         addEventListener( Event.ENTER_FRAME, rotate );
         Tweener.addTween ( _mc, { x: 200, y:100, time:2,  
transition:"easeoutquad" } );
         _mc.addEventListener( MouseEvent.MOUSE_DOWN, dnPress );
         _mc.buttonMode             = true;
         _mc.mouseChildren          = false;

     }


     private function dnPress( e: MouseEvent ):Void
     {

         _txt.text = 'square pressed';


     }


     private function drawRect(
                                 mc: Sprite,
                                 w: Int,
                                 h: Int,
                                 c: Int
                                             ):Void
     {

         mc.graphics.lineStyle( 0, c, 1 );
         mc.graphics.beginFill( c, 1 );
         mc.graphics.drawRect( 0, 0, w, h );
         mc.graphics.endFill();

     }


     private function rotate( e: Event ):Void
     {

         _mc.rotation += 3;

     }


     static function main()
     {

         new Base();

     }


}
[/code]


Hope that helps otherwise you can use the classes by creating stub  
haxe definitions and then using a lib to include the classes from a  
flash compiled swf but tweener seems to be a simpler approach?

Cheers

;j

On 13 Nov 2008, at 12:38, CraX SUN wrote:

> Hi all,
>
> I have got a problem when using fl.transitions, it seams haxe havn't
> packaged fl.* in the recent version?
>
> How can i solve it except using TweenHX or FEffects.
>
> thx
> crax
> --
> haXe - an open source web programming language
> http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: how to use fl.transitions in haxe

CraX SUN
Justin,

You are right, i am a newbie on haxe/flash, actually i am a c/c++ and ruby programmer, recently
we want to use flash/c++ to make a web game, so i try to use haxe to write flash client.

I am using TweenerHX now, and it works fine for me.

Really thanks for your and Michel's <a href="help:)">help:)

Best,
- crax

在 2008-11-14,下午6:23, Justin Lawerance Mills 写道:

Crax

Your probably a guru at haxe/flash or something so maybe my post is totally not useful but just incase your a newbie at haxe like me I gather you just want to tween stuff in flash so here's what I would suggest.

Tweener or similar is often used by flashers rather than the adobe stuff, and the haxe Tweener one works well, it might be heavy but there is a lite compile option, its fairly simple to use but I tend to like being obvious so here is a recent example of me testing haxe out (nothing remotely exciting! just proof of functioning), first you need to get Tweener

// in terminal or similar type ( I think )
haxelib install TweenerHX

and then use it, here is a simple test I was using the other day.

// compile code (Base happens to be in my namespace)
[code]
-cp net/justinfront/
-swf9 base.swf
-lib TweenerHX
-main Base.hx
-swf-header 320:240:30:3B3885
[/code]

[code]
//
//  Created by JLM at justinfront dot net
//  Base - basic test class
//  9 November 2008
//


import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.Lib;
import flash.display.Stage;
import flash.text.TextField;
import caurina.transitions.Tweener;

class Base extends Sprite
{


   private var _stage:     Stage;
   private var _txt:       TextField;
   private var _mc:        Sprite;


   public function new ():Void
   {

       super();
       _stage = Lib.current.stage;
       init();

   }

   private function init():Void
   {

       _txt        = new TextField();
       _txt.text   = "Test";
       _mc         = new Sprite();
       _mc.x       = 70;
       _mc.y       = 70;
       drawRect( _mc, 50, 50, 0xFF0000 );
       _stage.addChild( _mc );
       _stage.addChild( _txt );
       addEventListener( Event.ENTER_FRAME, rotate );
       Tweener.addTween ( _mc, { x: 200, y:100, time:2, transition:"easeoutquad" } );
       _mc.addEventListener( MouseEvent.MOUSE_DOWN, dnPress );
       _mc.buttonMode             = true;
       _mc.mouseChildren          = false;

   }


   private function dnPress( e: MouseEvent ):Void
   {

       _txt.text = 'square pressed';


   }


   private function drawRect(
                               mc: Sprite,
                               w: Int,
                               h: Int,
                               c: Int
                                           ):Void
   {

       mc.graphics.lineStyle( 0, c, 1 );
       mc.graphics.beginFill( c, 1 );
       mc.graphics.drawRect( 0, 0, w, h );
       mc.graphics.endFill();

   }


   private function rotate( e: Event ):Void
   {

       _mc.rotation += 3;

   }


   static function main()
   {

       new Base();

   }


}
[/code]


Hope that helps otherwise you can use the classes by creating stub haxe definitions and then using a lib to include the classes from a flash compiled swf but tweener seems to be a simpler approach?

Cheers

;j

On 13 Nov 2008, at 12:38, CraX SUN wrote:

Hi all,

I have got a problem when using fl.transitions, it seams haxe havn't
packaged fl.* in the recent version?

How can i solve it except using TweenHX or FEffects.

thx
crax
--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org