[Tweener] onStart and onStartParams Noob Question

Zeh Fernando zeh at zehfernando.com
Fri Oct 24 13:05:22 PDT 2008


Something like, inside some method:

var myfunc:Function = function() {
      this.graphics.lineStyle(2, 0xFF0000, 1, true, "normal", "square",
"miter");
      this.graphics.drawRect(0, 0, 55, 55);
};

or on the class declaration:

public function myfunc(): void {
      this.graphics.lineStyle(2, 0xFF0000, 1, true, "normal", "square",
"miter");
      this.graphics.drawRect(0, 0, 55, 55);
}

then:

Tweener.addTween(mcThumb1, { y: 284, time: .7, delay: 5, transition:
"easeOut", onStart:myfunc} );

Since it's onStart, though, you could have the thing already drawn on the
object, and only set its .visible before playing. It'd usually make it
easier if you have to activate or deactivate it a lot of times.

Zeh

On Fri, Oct 24, 2008 at 4:16 PM, Matt Tedeschi <matt at qwlproductions.com>wrote:

> Sorry, but having a little trouble understanding the docs.  New to AS3,
> Tweener, and OOP.
>
> I tried to create a function with the following parameters and call it
> from an addTween function using 'onStart:myFunction'
>
> function myFunction():void {
> this.graphics.lineStyle(2, 0xFF0000, 1, true, "normal", "square",
> "miter"); this.graphics.drawRect(0, 0, 55, 55);
> }
>
> But no combo I tried works.  The only thing I could get to work is the
> following, but I have to repeat this code 40 times at least.  How can I
> call the params from a function?
>
> Tweener.addTween(mcThumb1, { y: 284, time: .7, delay: 5, transition:
> "easeOut",
>            onStart:function() { this.graphics.lineStyle(2, 0xFF0000, 1,
> true, "normal", "square", "miter"); this.graphics.drawRect(0,
> 0, 55, 55); }} );
>
> Thanks in advance.
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20081024/2a007997/attachment.htm>


More information about the Tweener mailing list