Jump to content
Search Community

jeremyhoss

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by jeremyhoss

  1. I have a MovieClip that I want to have the arrow keys call the below functions. When press the right arrow key, I want it to call tweenIntoView() and when press the Left arrow key, I want it to call TweenOutOfView() and I currently have it working fine. The problem is that when I run that tweenOutOfView() function, the MovieClip go's outside of view of the screen and repeatedly calling the method doesn't return it back to where it started. How do I do it properly? The tweenIntoView() function works as I expect because it starts off the screen and zooms into the middle of the screen.

     

    //holds the tween to tween in
    var tweenInFromLeftSide:TweenMax;
    
    //holds the tween to tween out
    var tweenOutFromLeftSide:TweenMax;
    
    public function tweenIntoView() {
    tweenInFromLeftSide = TweenMax.from(this, 1, {x:-760, alpha:0, ease:Strong.easeOut});
    }
    public function tweenOutOfView() {
    tweenOutFromLeftSide = TweenMax.to(this, 1, { x:780, alpha:0, ease:Strong.easeOut } );
    }
    

  2. Regarding what you said about whether or not any of these Square Sprites have cacheAsBitmap set to true or false, I did some checking.

     

    //traces false. targets the Sprite's cacheAsBitmap property

    trace(tileArray[0][0].cacheAsBitmap);

     

    //traces false also. targets the Sprite's first child (the shape)

    trace(tileArray[0][0].getChildAt(0).cacheAsBitmap);

  3. Ok, I've fooled around trying to get it to be a fast and smooth tween. Do you want to see if you can get it any smoother than what I've got so far? I used flashdevelop, just open up the TweenTest.as3proj file and edit TweenTest.as, you'll see where I put the tween code there.

     

    If you press the left/right arrow keys, I have it moving about the speed that I want which is good, but the smoothness is quite choppy, especially on the ends. Maybe were reaching flash's limitations or maybe we are reaching Greensock limitations?

     

  4. Hi

     

    I noticed the TweenMax can tween thousands of objects very nicely however I'm looking to get just 20 flash bitmaps on the screen to scroll smoothly. I have the main document class for my flash cs4 project set to Main.as so it has a class file with it. I placed the 20 bitmaps onto the screen and Instead of tweening all 20 bitmaps, I decided to tween just the Main.as object by tweening the this.x and this.y property. Here is my result, although it's quite smooth, I thought it would be amazingly smooth lol

     

    Am I doing anything wrong or can I do anything to make it even faster/smoother?

     

    I uploaded the swf file to this free swf host I found on google, http://megaswf.com/view/87311edf2ec5998 ... c8665.html

     

    press the left/right arrow keys to make use of the tween. Here is my source code,

     

    http://actionscript.pastebin.com/m4baad918

×
×
  • Create New...