First of all, you don't need to keep re-activating the AutoAlphaPlugin - you
can just do that once in your SWF. It doesn't hurt anything to re-activate
it multiple times, but it definitely doesn't help.

Regarding the infinite loop, please make sure you're using the latest
version of the GreenSock code - there was a bug a couple weeks ago that
could cause an infinite loop in a specific scenario, but it has since been
fixed (sorry about any inconvenience that caused). http://www.TweenLite.com

There are certainly other things that could cause infinite loops that have
nothing to do with the tweening code, but it's tough to know without seeing
how/where you're calling the functions, what the rest of your code looks
like, etc. 

Jack

-----Original Message-----
From: beno - [mailto:[email protected]] 
Sent: Wednesday, November 18, 2009 9:25 AM
To: Flash Coders List
Subject: [Flashcoders] Infinite Loops

Hi;
I have the following code. All the functions go in infinite loops *except*
the first one, which is strange to me, since both it (hatAndFace, and both
eyeball1 and eyeball2) all use the same greensock codes, yet the latter two
repeat ad infinitum the alpha tween. Why is this? How do I control it such
that it only plays once? I thought putting a "stop();" at the end would do
the trick, but no :(
TIA.
beno

package
{
 import flash.display.MovieClip;
 import com.greensock.*;
 import com.greensock.plugins.*;
 import com.greensock.easing.*;
 public class Main extends MovieClip
  {
  public function Main():void
    {
  }
  public function hatAndFace():void
    {
    var mcHatAndFaceInstance:mcHatAndFace = new mcHatAndFace();
    TweenPlugin.activate([AutoAlphaPlugin]);
    addChild(mcHatAndFaceInstance);
    mcHatAndFaceInstance.x = 350;
    mcHatAndFaceInstance.y = 100;
    mcHatAndFaceInstance.alpha = 0;
    TweenLite.to(mcHatAndFaceInstance, 2, {autoAlpha:1});
  }
  public function eyeball1():void
    {
    var mcEyeballInstance1:mcEyeball = new mcEyeball();
    TweenPlugin.activate([AutoAlphaPlugin]);
    addChild(mcEyeballInstance1);
    mcEyeballInstance1.x = 380;
    mcEyeballInstance1.y = 115;
    mcEyeballInstance1.alpha = 0;
    TweenLite.to(mcEyeballInstance1, 2, {autoAlpha:1});
  }
  public function eyeball2():void
    {
    var mcEyeballInstance2:mcEyeball = new mcEyeball();
    TweenPlugin.activate([AutoAlphaPlugin]);
    addChild(mcEyeballInstance2);
    mcEyeballInstance2.x = 315;
    mcEyeballInstance2.y = 115;
    mcEyeballInstance2.alpha = 0;
    TweenLite.to(mcEyeballInstance2, 2, {autoAlpha:1});
  }
  public function rightHand():void
    {
    var mcHandInstance1:mcHand = new mcHand();
    addChild(mcHandInstance1);
    mcHandInstance1.x = 400;
    mcHandInstance1.y = 200;
  }
  public function leftHand():void
    {
    var mcHandInstance2:mcHand = new mcHand();
    addChild(mcHandInstance2);
    mcHandInstance2.x = 800;
    mcHandInstance2.y = 200;
  }
 }
}



_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to