[Tweener] AS2 onComplete

Jason Van Pelt VanPeltJ at peteramayer.com
Fri Jul 11 07:09:46 PDT 2008


It's because you're not passing in the function, you're calling it...

Tweener.addTween(_root.introText_mc, {_alpha:0, time:2,
transition:"easeIn", onComplete:testFunction()});

should be

Tweener.addTween(_root.introText_mc, {_alpha:0, time:2,
transition:"easeIn", onComplete:testFunction});

without the parentheses...

Jason Van Pelt
Senior Interactive Developer
504.210.1232 (p) / 504.581.2731 (f)
Peter A. Mayer Advertising, Inc.
www.peteramayer.com



                                                                           
             "Graeme                                                       
             Blackwood"                                                    
             <grayhammy at hotmai                                          To 
             l.com>                    <tweener at lists.caurinauebi.com>     
             Sent by:                                                   cc 
             tweener-bounces at l                                             
             ists.caurinauebi.                                     Subject 
             com                       Re: [Tweener] AS2 onComplete        
                                                                           
                                                                           
             07/11/2008 04:46                                              
             AM                                                            
                                                                           
                                                                           
             Please respond to                                             
             tweener at lists.cau                                             
               rinauebi.com                                                
                                                                           
                                                                           




Ah, my sincerest apologies! I just worked it out.  I think it was because I
was calling a second tween after the first (which called the function).

I am not sure why that should affect anything, but it clearly did.  I
simply commented out the second tween, and it worked.

It works now.

Before code:


function testFunction() {
 //trace("Called");
 _root.introText_mc.description.htmlText = "New text to set."
 Tweener.addTween(_root.introText_mc, {_alpha:100, time:2,
transition:"easeIn"});
}

technicalLiterature_btn.onRelease = function() {
 Tweener.addTween(_root.introText_mc, {_alpha:0, time:2,
transition:"easeIn", onComplete:testFunction()});
 Tweener.addTween(_root.contentContainer_mc, {_alpha:0, time:4,
_width:_root.contentContainerFullWidth / 1.1,
_height:_root.contentContainerFullHeight / 1.1, transition:"easeIn"});
}


After code:


function testFunction() {
 //trace("Called");
 _root.introText_mc.description.htmlText = "New text to set."
 Tweener.addTween(_root.introText_mc, {_alpha:100, time:2,
transition:"easeIn"});
}

technicalLiterature_btn.onRelease = function() {
 Tweener.addTween(_root.introText_mc, {_alpha:0, time:2,
transition:"easeIn", onComplete:testFunction});
 //Tweener.addTween(_root.contentContainer_mc, {_alpha:0, time:4,
_width:_root.contentContainerFullWidth / 1.1,
_height:_root.contentContainerFullHeight / 1.1, transition:"easeIn"});
}
Many thanks!

I am sure I will be in touch again. I am pretty far behind with
Actionscript.



From: Ernesto Quezada
Sent: Friday, July 11, 2008 10:22 AM
To: tweener at lists.caurinauebi.com
Subject: Re: [Tweener] AS2 onComplete

Can you show us the code? I only use AS2 and Tweener always behave :)

salut!


2008/7/11 Graeme Blackwood <grayhammy at hotmail.com>:
  Hi,

  Does the onComplete parameter work properly in AS2?  I am successfully
  calling a function using onComplete:functionname in the caurina tweener
  handler, but it executes the function immediately, not when the animation
  has finished running.

  I simply want to fade out a movieClip, which contains some dynamic text,
  change the dynamic text when it has faded out, and then fade it back in
  again, but it changes the text immediately, and then fades out the new
  text and back in again.

  Any ideas?

  Many thanks

  G

  _______________________________________________
  Tweener mailing list
  Tweener at lists.caurinauebi.com
  http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com




--
http://www.overloadstudios.co.uk





_______________________________________________
Tweener mailing list
Tweener at lists.caurinauebi.com
http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
_______________________________________________
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/20080711/b8d5cb4c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic11942.gif
Type: image/gif
Size: 1255 bytes
Desc: not available
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20080711/b8d5cb4c/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecblank.gif
Type: image/gif
Size: 45 bytes
Desc: not available
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20080711/b8d5cb4c/attachment-0001.gif>


More information about the Tweener mailing list