Jump to content
Search Community

danika

Members
  • Posts

    6
  • Joined

  • Last visited

Posts posted by danika

  1. Hi folks!

     

    I am searching for the easiest way to remove a new TweenMax instance.

    For example if i make a new tween like:

     

    var sampleTween:TweenMax;
    sampleTween = new TweenMax(my_mc, 1, { x:20, ease:Linear.easeNone } );
    

     

    How can i remove sampleTween?

    sampleTween = null?

     

    Thanks in advance!

    Daniel

  2. True that! My bad! I tested out, and realized the [params] won't change!

    Actually what i meant is that during an enter_frame event, or OnUpdate,

    we are calling our function for example 30 times/ sec..so if we have something in this

    function, that's running down also 30 times..

    Im thinking something like a CuePoint, but in the TweenMax! :)

    anyway in the end i came up with this:

    public function lifeHandler()
     {
      trace(timeTween.currentTime + " current time")
    
      if (timeTween.currentTime > 5)
      {
    timeTween.currentTime -= 5;
      }else
      {
    timeTween.currentTime = 0;
      }
     }
    
     public function lifeStarter()
     {
      timeTween = new TweenMax(_tl.life_line, lifeSec, { x:Math.round(-300), ease:Linear.easeNone, onUpdate:ChangePatch});
     }
    
     private function ChangePatch()
     {
      _x = Math.floor(_tl.life_line.x);
    
      if (_x >= -87 && _x <=0)
      {
    if (boychar == false)
    {
     //change Hero Path for boychar
     //call the function once
    }
    
    boychar = true;
    menchar = false;
    oldchar = false;
    
      }
      if (_x <= -88 && _x >= -197)
      {
    if (menchar == false)
    {
    //change Hero Path for menchar
     //call the function once
    }
    
    menchar = true;
    boychar = false;
    oldchar = false;
      }
    
      if (_x <= -198 && _x >=-300)
      {
    if (oldchar == false)
    {
     //change Hero Path for oldchar
     //call the function once
    }
    
    menchar = false;
    boychar = false;
    oldchar = true;
      }
     }
    

  3. brilliant!

    I will play around with this..

    tnx Carl!

     

    just one more thing...If im using onUpdate, and onUpdateParams...

    and im listening let's say for an "x" property, is it possible to use the value only once?

    like:

     

    TweenMax.to(mc, 10, {x:-180, ease:Linear.easeNone, onUpdate:xCheck, onUpdateParams:[mc.x]});
    function xCheck(_x:Number){
    
     if(Math.floor(_x) == -140){
    	 //My Signal release only once
    	 //or maybe I could use the currentTime instead of _x
     }
    }
    

     

    I could do this with a bunch of Booleans...but im still searching for an easier and reliable way.

     

    best wishes

    daniel

×
×
  • Create New...