I have a simple symbol
var button:graphic = new graphic();
button.x=250;
button.y=200;
addChild(button);
I want this to come in middle :
var posX:number = stage.width/2
var posY:number = stage.height/2
button.x=posX
button.y=posY
This came into my mind ^ but when i run it it shows the following errors:
1046: Type was not found or was not a compile-time constant: number. //for pos X
1046: Type was not found or was not a compile-time constant: number. //for pos Y
I find this as the only solution but sadly this is not working I may be writing those lines wrong as i am new to whole programming thing .
Please correct my solution or if it is wrong Please tell the right one