Hi all,

            Is there any way in flex1.5 to refer to the component by id from inside .as file.

            

 

            <?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"

borderThickness="1" cornerRadius="5" dropShadow="true" fontFamily="Verdana" fontSize="18" fontStyle="normal" fontWeight="bold" creationComplete="createUI( 'formatToolbar' )" xmlns:accords="*">

 

 <mx:Model id="statesModel" source="states.xml"/>

 

    <mx:Script>

        <![CDATA[

            import mx.core.UIObject;

                                    import de.richinternet.utils.Dumper;

            public var pageItem : Object;

           

            function createUI( pageUI:String ):Void {

                if( pageUI == "formatToolbar" )

                                                {

                    pageItem = dashBoard.createChild( formatToolbar, undefined );

                                                           

                                                }

                if( pageUI == "pointsCalci" )

                                                {

                    pageItem = dashBoard.createChild( pointsCalculator, undefined );

                                                           

                                                }

                                                if( pageUI == "viewReport" )

                                                {

                    pageItem = dashBoard.createChild( pointCalciReport, undefined );

                                                           

                                                }

            }

 

            public function destroyUI():Void {

                                        Dumper.dump("destroyed "+pageItem.toString());

                                                dashBoard.destroyChild( UIObject( pageItem ) );

                                                return;

            } 

                                                                              

        ]]>

    </mx:Script>

 

  <mx:HBox id="dashBoard" width="766" height="493" hScrollPolicy="off" vScrollPolicy="off">

 

 

 

 

 

 

 

.as file

 

import mx.core.UIObject;

       public var pageItem : Object;

                

            var obj:leftAccordian=new leftAccordian();

            function createUI( pageUI:String ):Void {

               

                    pageItem = obj.dashBoard.createChild( pageUI, undefined );

                                                                     

            }

 

            public function destroyUI():Void {

                                       

                                                obj.dashBoard.destroyChild( UIObject( pageItem ) );

            }        

 

 

 

 

The way it is shown above is not working. Can I refer the dashboard component from .as file?

 

 

Regards,

Akash Chander,

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___
Disclaimer

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom it is addressed. If you have received this communication in error, please immediately notify the [EMAIL PROTECTED] and destroy the original message. The recipient should check this email and any attachments for the presence of viruses. Ness has taken every reasonable precaution to minimize this risk, and accepts no liability for any damage caused by any virus transmitted in this email. Ness reserves the rights to monitor and review the content of all messages sent to or from this E-mail address, and store them on the Ness E-mail system.

Reply via email to