Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import flash.display.BitmapData;
- import flash.display.Bitmap;
- import flash.utils.getDefinitionByName;
- import flash.events.KeyboardEvent;
- import flash.ui.Keyboard;
- import flash.filters.*;
- import flash.geom.*;
- import flash.events.MouseEvent;
- import flash.events.Event;
- import flash.display.StageAlign;
- import flash.display.StageScaleMode;
- import flash.events.SampleDataEvent;
- import flash.media.Sound;
- stage.addEventListener(Event.RESIZE, onResizeListener);
- stage.align = StageAlign.TOP_LEFT;
- stage.scaleMode = StageScaleMode.NO_SCALE;
- var stageScale = 1;
- function onResizeListener(e : Event) {
- trace(getTimer(),stage.stageWidth + "x" + stage.stageHeight);
- stageScale = stage.stageHeight / 720
- blackThing.width = stage.stageWidth
- blackThing.height = stage.stageHeight
- positionImage()
- }
- function positionImage() {
- if (currentImage != null) {
- var img = imageArray[imageIndex];
- imageContainer.width = currentImage.width * stageScale
- imageContainer.height = currentImage.height * stageScale
- var newX : Number;
- if (img.a == 0) { // Center
- newX = (stage.stageWidth - imageContainer.width) / 2
- } else if (img.a == 1) { // Right
- newX = 0
- } else if (img.a == 2) { // Left
- newX = stage.stageWidth - imageContainer.width
- }
- imageContainer.x = newX;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment