Hey everyone, I’m having some troubles figuring out the code for this. I have 12 button objects that are being created evenly across the stage, and I would like to have them resize on a stage resize event.
Here is my code so far:
//--------------------------------------
// CONSTRUCTOR
//--------------------------------------
public function BasicFullScreen(){
initVideo();
createButtons();
stage.addEventListener(Event.RESIZE, resizeHandler);
}
//Create Buttons
private function createButtons():void{
for(i==0;i<12;i++){
//trace(i);
button = new MovieClip();
button.graphics.beginFill(000000);
button.graphics.drawRect(0,0,(stage.stageWidth/30),(stage.stageHeight));
button.graphics.endFill();
button.x = (stage.stageWidth/12)*i+(stage.stageWidth/40);
button.y = 0;
button.alpha = .5;
addChild(button);
}
}
private function resizeHandler(event:Event):void {
//What to put in here?
}
I’m not sure what to put in the resizeHandler function to resize all the button objects.
Thanks for any help,
Matt