I am loading an external image via the loader class, when I try to change the height of one of the images it disapears. (I want to stretch it) I was trying to use scaleY but I can’t get it to consistently line up. As far as I can tell it should work :h:
here is my code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.*;
import flash.net.URLRequest;
import flash.text.*;
public class MakeWindow extends Sprite
{
public function MakeWindow(winName:String, winWidth:Number, winHeight:Number){
var topLeft:Loader = new Loader();
var topRight:Loader = new Loader();
var topTile:Loader = new Loader();
var bottomLeft:Loader = new Loader();
var bottomRight:Loader = new Loader();
var bottomTile:Loader = new Loader();
var leftSide:Loader = new Loader();
var rightSide:Loader = new Loader();
topLeft.load (new URLRequest("vista_topleft.png"));
topRight.load (new URLRequest("vista_topright.png"));
topTile.load (new URLRequest("vista_toptile.jpg"));
bottomTile.load (new URLRequest("vista_bottomtile.jpg"));
bottomLeft.load (new URLRequest("vista_bottomleft.png"));
bottomRight.load(new URLRequest("vista_bottomright.png"));
leftSide.load (new URLRequest("vista_side.jpg"));
rightSide.load (new URLRequest("vista_side.jpg"));
var winTitle:TextField = new TextField();
this.addChild(leftSide)
this.addChild(rightSide)
this.addChild(topLeft)
this.addChild(topTile)
this.addChild(topRight)
this.addChild(winTitle)
this.addChild(bottomTile)
this.addChild(bottomLeft)
this.addChild(bottomRight)
this.y = 100;
this.x = 100;
//winTitle.type = TextFieldType.INPUT;
//winTitle.font =
winTitle.text = winName;
winTitle.width = winWidth - 90;
winTitle.height = 30;
winTitle.x = 10;
winTitle.y = 5;
winTitle.textColor = 0x000000;
//winTitle.filters
topRight.x = winWidth - 90;
topTile.x = 89;
topTile.scaleX = topRight.x;
bottomRight.x = winWidth - 90;
bottomTile.x = 89;
bottomTile.scaleX = topRight.x;
bottomLeft.y = winHeight - 10;
bottomRight.y = winHeight - 10;
bottomTile.y = winHeight - 10;
leftSide.y = 30;
leftSide.height = winHeight - 40;
rightSide.y = 30;
rightSide.x = winWidth + 9;
rightSide.scaleY = 364 / (winHeight - 40);
//this.addEventListener(MouseEvent.MOUSE_DOWN, winDrag);
//this.addEventListener(MouseEvent.MOUSE_UP, winStopDrag);
//function winDrag(event:MouseEvent){
// this.startDrag()
//}
//function winStopDrag(event:MouseEvent){
// this.stopDrag()
//}
}
}
}
Thank you for any help that could be provided