|
-
[RESOLVED] Elastic on Stage Resize
I would like to know how to make the stuff being "resized" elastic while being "resized".
This is the code.
Code:
import fl.transitions.Tween; //this is for the tweens in resizer
import fl.transitions.TweenEvent; //this is for the tweens in resizer
import fl.transitions.easing.*; //this is for the tweens in resizer
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
function resizeHandler(e:Event):void
{
fermez.x = fermez.stage.stageWidth - fermez.width - 30;
fermez.y = fermez.stage.stageHeight - fermez.stage.stageHeight + 30;
MP3_Player_BG.x = stage.stageWidth - stage.stageWidth + 30;
MP3_Player_BG.y = MP3_Player_BG.stage.stageHeight - MP3_Player_BG.height;
MP3_Player.x = stage.stageWidth - stage.stageWidth + 30;
MP3_Player.y = MP3_Player.stage.stageHeight - 20;
}
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler);
stage.dispatchEvent(new Event(Event.RESIZE));
Now how do I make the mc's being resized have an elastic tween while being "resized"?
-
For starters, grab TweenLite instead of the Adobe tweening - it's much more reliable for this kind of work. With that included, you can use the same formulas you have now, just pass them into the tween:
PHP Code:
import com.greensock.*;
import com.greensock.easing.*;
// ...
TweenLite.to(fermez.x, 1, {x:fermez.stage.stageWidth - fermez.width - 30, ease:Elastic.easeOut});
Please use [php] or [code] tags, and mark your threads resolved 8)
-
 Originally Posted by neznein9
For starters, grab TweenLite instead of the Adobe tweening - it's much more reliable for this kind of work. With that included, you can use the same formulas you have now, just pass them into the tween:
PHP Code:
import com.greensock.*;
import com.greensock.easing.*;
// ...
TweenLite.to(fermez.x, 1, {x:fermez.stage.stageWidth - fermez.width - 30, ease:Elastic.easeOut});
does this also apply to the Elastic.easeOut tween. This is what I plan to use for the elastic tween.
-
Yup - you can put in any easing function you want.
Please use [php] or [code] tags, and mark your threads resolved 8)
-
 Originally Posted by neznein9
Yup - you can put in any easing function you want.
ok, could you give me a sample of how I would type the script in?
-
 Originally Posted by neznein9
Yup - you can put in any easing function you want.
the script did not work. Now the mc does not even "resize".
-
Post your code and any errors you're seeing.
Please use [php] or [code] tags, and mark your threads resolved 8)
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|