Jump to content
Search Community

bandy

Members
  • Posts

    3
  • Joined

  • Last visited

bandy's Achievements

0

Reputation

  1. Carl, thanks again for your reply (and sorry about being unclear.) The problem seemed to be that because the registration point of the sprite was in the top left corner, when the sprite is scaled, it also moves, especially when there is easing applied. The effect I was trying to get was an elipse growing from nothing to full size without actually moving. To get that effect, I had to move the registration point to the middle of the sprite, using code borrowed. With that done, the scaling looks like I wanted it to. Thanks to all for all the great work done here.
  2. Carl, thanks for your reply. Actually I put the x and y values in there as a way to keep them there, as they are set at 200,200 when I add them to the stage earlier. Even if I don't set x and y the sprite still moves on the stage when using just scaleX and scaleY. It does scale, but it also shoots off to the bottom if scale is less than 1, or just blinks and disappears for scale > 1. This is just so basic yet I can't work it out, sorry for the simple problem!
  3. I am embarrassed to post this but have looked high and low and can't find an answer. I simple want a sprite to grow from a small size to a large size while staying in the same place. Even in the simplest code, the sprite changes position through the tween. The different position seems to depend on whether scale is under 1, (e.g.: 0.4) or over 1. The sprite then moves to the final position. But the trace statements say the position is the same. Also, the sprite won't scale up if the number is over 1; it will only scale down for number less than one. I must be doing something very basically wrong. Please help. Flex Builder 4 code: package { import com.greensock.*; import com.greensock.data.*; import com.greensock.easing.*; import flash.display.MovieClip; import flash.display.Sprite; import flash.events.Event; public class testtween extends Sprite { private var mySprite:Sprite; public function testtween() { mySprite = new MovieClip(); mySprite.graphics.beginFill(0x0000ff); mySprite.graphics.drawRect(200,200,30,30); mySprite.graphics.endFill(); mySprite.addEventListener(Event.ADDED_TO_STAGE, doTween); addChild(mySprite); trace(mySprite.x + "beforeX"); trace(mySprite.width + "beforewidth"); } public function doTween(e:Event):void { TweenLite.to(mySprite,1,{x:200,y:200,scaleX:.9, scaleY:.9}); //TweenLite.to(mySprite,5,new TweenLiteVars().prop("height",70,true).prop("x",0).onComplete(finish).ease(Linear.easeout)); } public function finish():void { trace(mySprite.x + "afterX"); trace(mySprite.width + "afterwidth"); } } }
×
×
  • Create New...