Ultrashock Forums > Flash > ActionScript
Little help with mc alignment

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
Little help with mc alignment
Old 2010-02-09

Hello everyone !

I try to make a scalable site where I want to put in the bottom 3 mc

left_mc
center_mc
right_mc


For left_mc and right_mc i made the codes and and works perfectly but the hard part is this
Center_mc I want to appear between left_mc and right_mc on the entire length

Dimension for left_mc is W-201 H-35
Dimension for right_mc is W-162 H-35
Dimension for center_mc is W- ? H-35

below have the code that I use

// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
stop ();

// initiate postitions and scaling values for objects
bg._height = Stage.height;
bg._width = Stage.width;
left_mc._x = 0;
left_mc._y = Stage.height-left_mc._height;
right_mc._x = Stage.width-right_mc._width;
right_mc._y = Stage.height-right_mc._height;

CENTER_MC ??????????????????????????????????????????????????????????????????

//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
bg._height = Stage.height;
bg._width = Stage.width;
left_mc._x = 0;
left_mc._y = Stage.height-left_mc._height;
right_mc._x = Stage.width-right_mc._width;
right_mc._y = Stage.height-right_mc._height;

CENTER_MC ??????????????????????????????????????????????????????????????????

};
Stage.addListener(sizeListener);
Thanks in advance FOR ANY HELP
And I apologize for my bad english
postbit arrow 2 comments | 85 views postbit arrow Reply: with Quote   
Registered User
laur1 is offline
seperator
Posts: 7
2010-02-07
laur1 lives in Romania
seperator

Ultrashock Member Comments:
Nutrox's Avatar Nutrox Nutrox is offline Super Moderator Nutrox lives in United Kingdom 17 Creative Assets 2010-02-09 #2 Old  
If you want to place center_mc in the center of the stage, you can do this:
Code:
center_mc._x = ( Stage.width - center_mc._width ) / 2;
If you want to stretch center_mc between left_mc and right_mc, you can do this:
Code:
center_mc._x = left_mc._width;
center_mc._width = Stage.width - ( left_mc._width + right_mc._width );
Hope that helps.
Reply With Quote  
laur1 laur1 is offline laur1 lives in Romania 2010-02-09 #3 Old  
Thank you very much Nutrox
Case is solved but besides
center_mc._x = left_mc._width;
center_mc._width = Stage.width - ( left_mc._width + right_mc._width );
I added
center_mc._y = Stage.height-center_mc._height;
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: