Within my AS3 class I am calling this.width
, and the value it returns is always 1, even though this is impossible given the contents of the object.
Is this a standard behavior for AS3?
Simple version of class is posted below. It is attached to a MovieClip symbol that just contains a simple hexagon.
package {
import flash.display.*;
import flash.utils.*;
import flash.events.*;
public class Hexagon extends MovieClip
{
var startWidth:Number;
var startHeight:Number;
public function Hexagon()
{
var myTimer:Timer = new Timer(2000);
myTimer.addEventListener(TimerEvent.TIMER, timerFunction);
myTimer.start();
startWidth = this.width;
startHeight = this.height;
trace("startWidth:" + " " + startWidth);
trace("startHeight:" + " " + startHeight);
}
function timerFunction (evt:TimerEvent):void
{
}
}
}