Greetings mortals!
For a project i am needed to move a vast range of movieclips over time on the stage.
I thought to write a class to tackle it. my little class experience tells me you can’t acces the stage in the constructor. well great, just add an eventlistener for the ADDED_TO_STAGE…
great, but still … I wonder how to pass the stage.stageWidth to a custom class as an optional parameter. lol now that i am writting it… does it even make sense…
here we go…
I’d love to have the stageWidth as an optional argument
var test = myClass(“0xff0033”,“my text”, stage.stageWidth);
yet it reports the argument can’t be null…
I have my construction as such:
public function myClass(_color:String,_txt:String,_newWidth:Number=null){
//bake pancakes
}
I learned a number can’t be null as like an Int
setting it as _newWidth:Number = 0 doesn’t help much either.
Many thanks for a good pointer.
I did some searches but a) my google skills are bad b) i am looking over it.
Thanks , best regards