alert This appears to be a flash file, you cannot see a preview because flash player is no longer supoorted in browsers, but you can still download the file to study it's source code.
You can open/play the swf file with Flash Player exe
user bulutemektar
bulutemektar (2)

Resizing and MC Aligning Example

When I started to learn flash, aligning was a real challange for me. I made this little example for a friend and I thought, I should give it away for other people too. This is my karma :)

Look at the intanceses and MC reference points to understand how this thing really works.
P.S. For preview open it in full size than resize the pop-up window.

Sorry for my bad English :)

1004 downloads, 22498 views

align resize


Download (9.82 KB)

Comments

You need to login to post a comment.

user kkarkhanis
kkarkhanis 13 years ago

i want to same bottom middle align in Ac 2.0. It's possible please send me

user anayak.16
anayak.16 13 years ago

thank you Bulumektar

user bulutemektar
the listing author bulutemektar 13 years ago

@anayak.16:
Ok. Open this fla and change AS3 to AS2. Then go to the frame with actions, delete all the actions and paste this one:

Stage.align = "TL";
Stage.scaleMode = "noScale";

Stage.addListener(this);

function onResize() {
// Background
background._height = Stage.height;
background._width = Stage.width;
background._x = 0;
background._y = 0;
// Clips
TL._x = 0;
TL._y = 0;
L._x = 0;
L._y = (Stage.height / 2);
BL._x = 0;
BL._y = Stage.height;
T._x = (Stage.width / 2);
T._y = 0;
C._x = (Stage.width / 2);
C._y = (Stage.height / 2);
B._x = (Stage.width / 2);
B._y = Stage.height;
TR._x = Stage.width;
TR._y = 0;
R._x = Stage.width;
R._y = (Stage.height / 2);
BR._x = Stage.width;
BR._y = Stage.height;
}
onResize ();

Test your movie, have fun!
Now it is in AS2 :)

user anayak.16
anayak.16 13 years ago

Will this work in as2 plz

user bulutemektar
the listing author bulutemektar 13 years ago

you're welcome ;)

user wiyono
wiyono 13 years ago

@bulutemektar, Tahnk you so much.. you are the best best

Thank you so much.. Thank you so much.. Thank you so much....
Hehehee...

user bulutemektar
the listing author bulutemektar 13 years ago

@wiyono:
function fullBackground ():void
{
myBackground.x = 0;
myBackground.y = 0;
myBackground.width = stage.stageWidth;
myBackground.height = stage.stageHeight;
}
fullBackground();
stage.addEventListener(Event.RESIZE, resizeHandler);
function resizeHandler (event:Event):void
{
fullBackground();
}

your myBackground is the instance name for the MovieClip on this example. Your MoviClip and the main stage must be aligned to top left.

Hope this helps :)

user wiyono
wiyono 14 years ago

Hey.. thank for your file.. can you help me? i would like the background direct full browser, not after the browser resize...
Can you hel me please?
Only background.
Thank you.

user heera_in
heera_in 14 years ago

Lovely. so simple and cool. thanks made my job much simpler.

user kadvit
kadvit 14 years ago

Super Thanks

user juhpavan
juhpavan 14 years ago

WTF???? (2)

user designbeast
designbeast 14 years ago

nice and simple, straight to the point, love it! Great job!

user ninetta1972
ninetta1972 14 years ago

very useful. thanks

user juhpavan
juhpavan 14 years ago

o.O""""""""

user ddsdc
ddsdc 14 years ago

WTF???

user tomekkie
tomekkie 14 years ago

That is a very good example, but the aligment function which is triggered by Event.RESIZE, should also execute in first frame Event = null.

user lowcpm
lowcpm 14 years ago

Needs a bit more explanation to understand it, but very nice work. I can use this. Thanks!

user nanoffiles
nanoffiles 14 years ago

very usseful work, man. I like it...