Hi, I tried your solution, but its not working. I want something like that , when user click small button, the stage size should be 320*240,when user click Medium button, the stage size should be 480*360 and for large 640*480.
Here is my code <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" backgroundColor="#FEFEFE" disabledColor="#A43A3A"> <mx:Script> <![CDATA[ import mx.controls.Alert; [Bindable] public var sWidth : int = 640; [Bindable] public var sHeight : int = 480; var s:String=""; public function init():void{ //this.Stage.scaleMode = StageScaleMode.NO_SCALE; //s=this.stage; } public function small():void{ //this.width=320; //this.height=240; this.stage.stageHeight=sHeight; this.stage.stageWidth=sWidth; this.setStyle("backgroundColor","red"); this.validateNow(); Alert.show(this.stage.stageWidth+" "+this.stage.stageHeight); } public function big():void{ s="640 480"; ExternalInterface.call("recieveTextFromFlash('"+s+"')"); //this.width=640; //this.height=480; this.stage.stageHeight=sHeight; this.stage.stageWidth=sWidth; this.setStyle("backgroundColor","yellow"); this.validateNow(); Alert.show(this.stage.stageWidth+" "+this.stage.stageHeight); } public function medium():void{ //this.width=480; //this.height=360; this.stage.stageHeight=this.sWidth; this.stage.stageWidth=this.sHeight; this.setStyle("backgroundColor","orange"); this.validateNow(); Alert.show(this.stage.stageWidth+" "+this.stage.stageHeight); } ]]> </mx:Script> <mx:Button x="63" y="63" label="Small" id="btnSmall" labelPlacement="bottom" width="73" height="20" click="small()"/> <mx:Button x="173" y="64" label="Medium" id="btnMedium" height="20" width="73" click="medium()"/> <mx:Button x="122" y="110" label="Big" id="btnBig" width="73" height="20" click="big()"/> </mx:Application> Thanks On Mon, Mar 23, 2009 at 11:54 AM, [email protected] <[email protected]>wrote: > > Hi Kunal, > create the bindable variables for width and height in > action script . then access those variable from the tag ( <mx:VBox > Height ={variablename} /> ) > > On Mar 20, 1:49 pm, kunal <[email protected]> wrote: > > hi > > I want to set Width and Height of Stage dynamically. > > > > -- "A journey of a thousand miles Begins with a single step." Thanks Kunal Pagariya --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Flex India Community" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/flex_india?hl=en -~----------~----~----~----~------~----~------~--~---

