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 --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/KIlPFB/vlQLAA/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/
 



Reply via email to