Any ideas what's happening? I feel like I'm doing something extremely dumb.
Thanks!
Code: Select all
// actionscript in frame 1 that creates an instance of my class
var button:Btn = new Btn(showUpgrade, 25, 5, "Show", true, 5);
addChild(button);
trace(button.x.toString()); // prints 0 Code: Select all
package {
// imports here
public class Btn extends MovieClip {
// global vars here
public function Btn(cback:Function=null, xx:Number=0, yy:Number=0, lbl:String="Button", manualButton:Boolean=false, wdth:Number=0, hght:Number=0) {
trace(this.x.toString()); // prints 0
this.x = 0;
trace(this.x.toString()); // prints 0
this.y = 0;
// other irrelevant code below
}
}
}