Jump to content
GreenSock

kamcknig

Members
  • Posts

    18
  • Joined

  • Last visited

Posts posted by kamcknig

  1. I just donated to get the shockingly green and downloaded a fresh version of the AS3 version of Greensock. When I run my code I'm getting an error in Animation.as

     

    Line 210 1061: Call to a possibly undefined method add through a reference with static type com.greensock.core:SimpleTimeline.
     
    It says that there is no function "add" in SimpleTimeline, but I made sure and the SimpleTimeline does have the add function so I'm not sure why I'm getting this.
     
  2. Is there anyway to automatically increase or decrease the duration of any of the instances of these classes? I'm making a game where there are a lot of automated animations and events going on, and it'd be nice to give the player an opportunity to increase the speed of these animations if they don't want to sit through them all the time. So is there a way to do this automatically?

     

    Thanks!

    Kyle

  3. Hi everyone, I'm trying to scale an item in the y direction, and then scale it in the x direction using the transformAroundCenter plug-in with TweenLite. Here is my code for when an external SWF file has been loaded into my movie.

     

    private function onResumeLoaded(e:Event):void
    {
    e.target.removeEventListener(Event.COMPLETE, onResumeLoaded);
    var loader:Loader = e.target.loader as Loader;
    loader.scaleX = .01;
    loader.scaleY = .01;
    loader.x = stage.stageWidth / 2 - loader.width / 2;
    loader.y = stage.stageHeight / 2 - loader.height / 2;
    addChild(loader);
    
    var yTween:Object = new Object();
    yTween.transformAroundCenter = new Object();
    yTween.transformAroundCenter.scaleY = 1;
    yTween.onCompleteParams = [loader];
    
    yTween.onComplete = function(loader:Loader):void
    {
    	var xTween:Object = new Object();
    	xTween.transformAroundCenter = new Object();
    	xTween.transformAroundCenter.scaleX = 1;
    	TweenLite.to(loader, .5, xTween);
    }
    
    TweenLite.to(loader, .5, yTween);
    }
    

     

    But when this executes... the y scale tween works fine and it scales it and keeps it centered on the stage like it should, but when the y tween is complete and the x tween goes, then as it scales, it moves off to the left rather than staying centered! Anyone know why?

     

    Thanks!

    Kyle

  4. I have a sound and sound channel that i'm trying to fade, but it's not seeming to work.

     

    var sc:SoundChannel;
    var song:Sound = blah;
    //blah is a sound, trust me, it plays fine and everything i just don't want to put the code in here for the loading and such;
    sc = song.play();
    

     

    then when my app ends,

     

    var fadeOb:Object = new Object();
    fadeOb.volume = 0;
    TweenLite.to(sc.soundTransform, 2, fadeOb);
    

     

    But this doesnt work. If i use the onUpdate listener and check the volume of the soundtransfomr, it always stays at one

  5. Hi all,

     

    I've used the TintPlugin before and gotten it to work, so I can't understand why I can't get it to work now :/

     

    I have a Main class and in there I activate the plugin:

    import com.greensock.plugins.TintPlugin;
    import com.greensock.plugins.TweenPlugin;
    import com.greensock.TweenLite;
    
    public class Main extends MovieClip {
     public function Main() {
       TweenPlugin.activate([TintPlugin]);
     }
    }
    

     

    Then I have a class called Country that I'm trying to change the tint of a MovieClip inside of Country:

    import com.greensock.easing.*;
    import com.greensock.TweenLite;
    
    public class Country extends MovieClip {
     public var outline:MovieClip;
     public var fog:MovieClip;
    
     public function Country() {
     }
    
     public function set color(val:Number):Void {
       var tintTween:Object = new Object();
       tintTween.tint = val;
       tintTween.ease = Linear.easeNone;
       TweenLite.to(this.outline, 1, tintTween);
     }
    }
    

     

     

    This, however, does not work. The color of the outline MovieClip just stays it's default color!

     

    Does anyone see anything wrong or have suggestions?

     

    Thanks!

    Kyle

  6. Is there a way to pause all tweens that TweenLite is currently keeping track of? If not... where do I request new features? It'd be nice to have a static function that can pause and unpause all tweens, this would be good for games that need pause functionality

  7. Hi all,

     

    I've created a tween:

    var ob:Object = new Object();
    ob._y = 675;
    ob._xscale = ob._yscale = 200;
    ob.ease = Linear.easeNone;
    var speed:Number = Math.floor(Math.random() * 3) + 4;
    TweenLite.to(alien, speed, ob);
    

     

    The problem is that because it's scaling up at the same time as it's moving down the screen, it seems to "slow" down near the end even with the Linear.easeNone easing. Is there a way to have two concurrent tweens going on an object at different speeds? Meaning can I have the scaling go faster than the moving in y direction tween? Or does anyone have ideas how to compensate for that visual effect?

     

    Thanks!

    Kyle

×