hello everyone, I’m trying to make a class that will scale a clip when the stage resizes. I have the Stage resize set to NO_SCALE so the majority of clips on the stage will not scale, however i want to make an exception. So i wrote the package below. However, when i try to run the movie, it throws this error:
1119: Access of possibly undefined property stageWidth through a reference with static type Class.
Obviously i’m missing something and need some help. Thanks in advance.
package bmilesp.display.LayoutTools {
import flash.display.Stage;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.display.MovieClip;
public class LayoutTools {
private var _stageOriginalWidth:Number = Stage.stageWidth;
private var _stageOriginalHeight:Number = Stage.stageHeight;
public function scaleWithStage(my_clip:MovieClip):void{
var scaleChangeWidth:Number = Stage.stageWidth/_stageOriginalWidth;
var scaleChangeHeight:Number = Stage.stageHeight/_stageOriginalHeight;
my_clip.width = my_clip.width * scaleChangeWidth;
my_clip.height = my_clip.height * scaleChangeHeight;
}
}
}