Ahh... I got why. I must set mx:Application's width and height like "width = 1024". If I set mx:Application's width like "width = '100%'", "stage.stageWidth" doesn't work. Ah.. This has been ultra basic knowledge.
--- In [email protected], "sn197412" <[EMAIL PROTECTED]> wrote: > > Hi. > > I got runtime error of runtime error of stage.stageWidth. > Please tell me why? > > Runtime error is below. > > TypeError: Error #1009: null has no properties. > at CustomPopup/CustomPopup$275$private::initApp() > at CustomPopup/___Application0_creationComplete() > at flash.events::EventDispatcher/dispatchEvent() > at > mx.core::UIComponent/mx.core:UIComponent$protected::dispatchCreationCompleteEvent() > at > mx.core::UIComponent$/http://www.macromedia.com/2005/flex/mx/internal::dispatchCreationCompleteEvents() > at > mx.managers::LayoutManager/LayoutManager$1689$private::doPhasedInstantiation() > at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher2() > at mx.core::UIComponent/UIComponent$480$private::callLaterDispatcher() > > Here is a sample source. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*" > creationComplete="this.initApp()"> > > <mx:Script> > <![CDATA[ > > import mx.controls.Button; > import flash.display.Stage; > > private function initApp():Void > { > var btnObj:Button = new Button(); > btnObj.label = "Test"; > btnObj.width = stage.stageWidth; > this.addChild(btnObj); > } > > ]]> > </mx:Script> > > </mx:Application> > ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/2jUsvC/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

