I think you were looking for Stage.width, which has always a value, even if 
width=100%
 
"First rule of programming, break the previous rule"

________________________________

De: [email protected] de la part de sn197412
Date: jeu. 12/22/2005 8:48
À: [email protected]
Objet : [flexcoders] Re: runtime error of stage.stageWidth. Why???


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>
>






--
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 


        
*        Visit your group "flexcoders 
<http://groups.yahoo.com/group/flexcoders> " on the web.
          
*        To unsubscribe from this group, send an email to:
         [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> 
          
*        Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service 
<http://docs.yahoo.com/info/terms/> . 


________________________________



------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY** 

This e-mail and any attached files are confidential and intended solely for the 
use of the individual to whom it is addressed. If you have received this email 
in error please send it back to the person that sent it to you. Any views or 
opinions presented are solely those of author and do not necessarily represent 
those the Emakina Company. Unauthorized publication, use, dissemination, 
forwarding, printing or copying of this email and its associated attachments is 
strictly prohibited.

We also inform you that we have checked that this message does not contain any 
virus but we decline any responsability in case of any damage caused by an a 
non detected virus.
------------------------------------------------------------------



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income homes are not online. Make a difference this holiday season!
http://us.click.yahoo.com/5UeCyC/BWHMAA/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/
 

<<winmail.dat>>

Reply via email to