-
-
Prid - Outing
EASY WAY: Use this on your first Frame Actions:
Actionscript Code:
Stage.scaleMode = "exactFit";
This will however scale everything, so that everything is in place, but it will look rather weird
HARD WAY: You can use a resize listener (self-created codes that are executed when something occurs, in this case, when the window resizes), and then make each movieclip move and/or scale proportionally, here's a sample code to use in first Frame (with a movieclip with an instance name of, mc):
Actionscript Code:
Stage.align = "TL"; Stage.scaleMode = "noScale";
resizeScreen();
resizeListener = new Object(); resizeListener.onResize = function(){ resizeScreen(); } Stage.addListener(resizeListener);
function resizeScreen(){ mc._x = Stage.width/2; mc._y = Stage.height/2; }
Explanation:
Actionscript Code:
// set the base alignment to TOP-LEFT. Try and see what happens if you omit this Stage.align = "TL"; // make the Stage NOT scale upon resizing, as it normally does, to make our own resizing codes Stage.scaleMode = "noScale";
// call the function where everything is resized, because at the start of the Flash movie, // the Stage isn't resized, so the Resize Listener won't execute until the window has resized, // hence we call the function with all the codes to resize, once, at the start of movie, // try omiting this and see what happens resizeScreen();
// create a new object (a new listener) resizeListener = new Object(); // assign onResize handler to the listener resizeListener.onResize = function(){ // codes in here will be executed once the screen resizes // in this case, we call the resizing function when the // screen is resizing resizeScreen(); } // initiate the resize listener Stage.addListener(resizeListener);
// this is the function with all the codes for resizing function resizeScreen(){ // in this example, I have a Movieclip on stage with an instance name of, mc, // and on resize, I'm making its X equals to the Width of the Stage divided // by 2, which is the same as the Middle of the screen. I do the same with // the Y coordinate for the movieclip. This will make it stick to the center // of the screen whenever you resize it mc._x = Stage.width/2; mc._y = Stage.height/2; }
Hope this helps
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
-
I tried that however the site flashes uncontrollably. Also it appears that somewhere along the line I switched to ActionScript 3.0 and can't switch back. Sorry, I'm new.
-
Prid - Outing
File->Publish Settings... (or press CTRL+SHIFT+F12)
Flash Tab
Change from Actionscript 3.0 to Actionscript 2.0
Also, could you post your FLA file?
I am back, guys ... and finally 18 :P
BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS
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
|