all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

elastic movements on resize for full browser flash


elastic movements on resize for full browser flash uc17
8/24/2006 7:09:49 PM
flash actionscript: Im having problems creating easing movemrnts on resize with a full browser
flash web page. A great example of this is http://www.dopeawards.com/ but for
some reason them only have the easing for the _y value. This is the code I am
using. "cover" is the movie clip on stage that i want to have easing properties.



cover._x = Stage.width / 2;
cover._y = Stage.height / 2;

var stageL:Object = new Object();
stageL.onResize = function() {
fillBG();

cover._x = new mx.transitions.TransitionManager(cover);
myTransitionManager.startTransition({type:mx.transitions.Strong,
direction:Transition.IN, duration:1,
easing:mx.transitions.easing.Strong.easeOut});

cover._y= new mx.transitions.TransitionManager(cover);
myTransitionManager.startTransition({type:mx.transitions.Strong,
direction:Transition.IN, duration:1,
easing:mx.transitions.easing.Strong.easeOut});

transitionManagerInstance.startTransition(cover)
}

Stage.addListener(stageL);




Please help!!

Re: elastic movements on resize for full browser flash abeall
8/24/2006 8:03:58 PM
Couple of things:

1) You are using var coverx as the starting point for your _y Tween, don't you
mean covery?

2) You should define coverx and covery inside the onResize, or else the
transition will always start at the original position. Actually, you should
probably be using Tween.continueTo() instead of continually creating new Tweens

3) You need set Stage.align = "TL" if you want Stage.width/2 and
Stage.height/2 to be the center of the stage. Otherwise, it will always be
centered anyway, since defauly align is centered.

4) This is not required, but rather than naming your MovieClip "cover", I
would suggest using proper naming conventions and call it "cover_mc".

So, the above might end up looking like this:
Stage.align = "TL";
cover_mc._x = Stage.width / 2;
cover_mc._y = Stage.height / 2;
var stageL:Object = new Object();
stageL.onResize = function() {
var coverx = cover_mc._x;
var covery = cover_mc._y;
new mx.transitions.Tween(cover_mc, "_x",
mx.transitions.easing.Regular.easeOut, coverx, (Stage.width / 2), 1, true);
new mx.transitions.Tween(cover_mc, "_y",
mx.transitions.easing.Regular.easeOut, covery, (Stage.height / 2), 1, true);
};
Stage.addListener(stageL);

Re: elastic movements on resize for full browser flash uc17
8/24/2006 10:06:01 PM
AddThis Social Bookmark Button