Hey all,
So I'm finally taking the AS3 plunge. Put it off as long as I can. So I'm rebuilding my portfolio site in AS3, and already need to hit the books (unfortunately don't have any yet).
So I want to create an external class for resizing the stage. If I have any sites where I want them to act as full screen flash sites, I just want to import this class. Although, I want a generic function to be called onResize so I can adapt it to any future project, and not have specific functions within the resize.
Here's my StageFullScale class:
Now I want to create a class for my site which will import this Stage class. Here's that one:Code:package { import flash.display.Stage; import flash.display.StageAlign; import flash.display.StageScaleMode; import flash.events.Event; public class StageFullScale { private var myStage:Stage; public function StageFullScale():void { myStage.scaleMode = StageScaleMode.NO_SCALE; myStage.align = StageAlign.TOP_LEFT; myStage.addEventListener(Event.RESIZE, resizeStage); } private function resizeStage(event:Event):void { trace("RESIZE"); } } }
So the class above I'm going to build out the be the main Class for my site, and I want to import my stage class. Any suggestions (I'm sure this is pretty basic AS3).Code:package { import flash.display.MovieClip; import StageFullScale; public class TetDesign extends MovieClip { var myStage:StageFullScale = new StageFullScale(); } }
Thanks in Advance.




Reply With Quote