PDA

View Full Version : Anchoring Movieclip to corner of stage



aesthetics7
August 25th, 2008, 02:41 PM
Hey,

I'm running into a problem here.

Alright, first off I am using a scaling background to resize to any size monitor.

I am also attaching movieclips to the stage and I want it to be able to anchor at the bottom left of the page and stay there and not move.

The files are located here

www.reampentertainment.com/upload/flash

Anyone have any idea how to make the image stay at the corner of the window?

aesthetics7
August 25th, 2008, 03:11 PM
this is the code I have currently:

function setBgSize() {
// positon text box to the center of the stage
info._x = 0;
info._y = 0;

//

// equations used for proportional resize
var imageRatio:Number = info._width/info._height;
var stageRatio:Number = Stage.width/Stage.height;
if (stageRatio>=imageRatio) {
// match image width and adjust height to fit
info._width = Stage.width;
info._height = Stage.width/imageRatio;
} else {
// match image height and adjust width to fit
info._height = Stage.height;
info._width = Stage.height*imageRatio;
}

snickelfritz
August 25th, 2008, 03:15 PM
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);

function resizeHandler(event:Event=null):void {
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;

//"cornerMovieClip" registration point is in the upper left corner.
cornerMovieClip.x = 0;
cornerMovieClip.y = sh - cornerMovieClip.height;

}
resizeHandler(null);

Anil_kumar
August 26th, 2008, 03:42 AM
have a look @ my flash blog to C an example and get a free source file or contact me @ anilkumarnd@gmail.com

FlashCS3 - Full Screen Flash Website - I
http://flash-workshop.blogspot.com/2008/07/flashcs3-full-screen-flash-website.html

FlashCS3 - Full Screen Flash Website - II (True Full Screen)
http://flash-workshop.blogspot.com/2008/07/flashcs3-full-screen-flash-website-ii.html

Anil
anilkumarnd@gmail.com