PDA

View Full Version : Centering a movieclip with an animation on window resize



flavasociety
04-13-2007, 04:45 PM
Hey Guys in a newbie on this site.. but not to flash however i just want to know how the hell this is done..
I know how to keep a movie clip centered to a full browser window flash site but how do they do those cool animations when you resize the window..

like this
http://www.triworks.net/triworks2008/index.php


please help !! its bugging me :)

BLiZZaRD
04-13-2007, 04:53 PM
Resize which page? I didn't see anything spectacular as far as special animations. Basic tweens, and rollOver stuff, and very nice artwork :)

flavasociety
04-13-2007, 05:21 PM
Resize which page? I didn't see anything spectacular as far as special animations. Basic tweens, and rollOver stuff, and very nice artwork :)

oh sorry man... like on the index splash page there... before you hit enter.. if you resize that page.. it will kinda just tween to the center of the stage.. know what i mean..

http://www.triworks.net/triworks2008/index.php

BLiZZaRD
04-13-2007, 06:25 PM
Ahh.. I gotcha.

You want to check into ScaleMode.

you can see this thread (http://www.dynamicdrive.com/forums/showthread.php?t=18402) where I have given a useable example. :)

jamiller
04-21-2007, 12:22 AM
Yeah this isn't too difficult to do if you know about full browser flash. Just instead of having this:

function setMenu() {
mymc._y = Stage.height-20;
mymc._x = Stage.width/2;
}
stageListener.onResize = function () {
setMenu();
}

you would have this:

mymc._y = Stage.height-20;
mymc._x = Stage.width/2;

function reset() {
import mx.transitions.Tween;
import mx.transitions.easing.*;
var nX:Tween = new Tween(mymc, "_x", Strong.easeOut, mymc._x, Stage.width/2, .3, true);
var nY:Tween = new Tween(mymc, "_y", Strong.easeOut, mymc._y, Stage.height-20, .3, true);
}

stageListener.onResize = function () {
reset();
}

I have used standard Flash actionscript animation. You can read more about that if you google the transitions and easing class.

Hu4ley
06-19-2007, 10:01 AM
Hi Blizzard!

Great Thread.

killerchutney
06-26-2007, 07:18 PM
wow, what a sneaky attempt to boost google rankings. I could never have guessed if it wasn't for my 70 years of detective work.