[Tweener] AS2 onComplete
Graeme Blackwood
grayhammy at hotmail.com
Fri Jul 11 02:46:26 PDT 2008
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20080711/9539e496/attachment.htm>
More information about the Tweener
mailing list