|
-
background stretches
Hello! PLEASE HELP ME
My name is thiago, and i newbie in flash ans as3.
first.. how i do to make i site with background strech and fading photos.
like this: http://www.minus.dk/
...I want to create a background like that, where it stretches to fit the window size.
Anyone know how to scale a photo like this? please explain me with details.. like what is istance, where i need to put the code.. i found this.. but i dont understand:
Class myStage:
package {
import flash.display.Stage;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
public class myStage extends Sprite {
private var _mc:Sprite;
private var mcStage:Stage;
public function myStage(_mc:Sprite){
this._mc = _mc;
mcStage = _mc.stage;
addStageListener();
}
public function addStageListener() {
mcStage.scaleMode = StageScaleMode.NO_SCALE;
mcStage.align = StageAlign.TOP_LEFT;
mcStage.addEventListener(Event.RESIZE, resizeHandler);
}
private function resizeHandler(event:Event):void {
trace(”stageWidth: “+mcStage.stageWidth);
trace(”stageHeight: “+mcStage.stageHeight);
_mc.x = mcStage.stageWidth/2;
_mc.y = mcStage.stageHeight/2;
}
}
}
Now, create object of myStage and pass movieclip reference (which you want to align at center of stage) as parameter:
var mystage:myStage = new myStage(_mc);
Publish the flash file. Be sure to put 100% as value for Height and Width parameters in Object and param tag in HTML.
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
|