Title: Mensagem

Hmm, I don’t have time to dig but generally that should work I’d think.  What if you put a button in Composition.mxml that calls initialize() and see if it’s not null then.  Clearly this is just an ordering problem but I can’t tell why off the top of my head.

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Michel Bertrand
Sent: Tuesday, October 04, 2005 11:21 AM
To: flexcoders@yahoogroups.com
Subject: RES: [flexcoders] Getting a null object reference

 

Thank you for your suggestion ... I changed to creationComplete, but still not working ...

-----Mensagem original-----
De: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] Em nome de Matt Chotin
Enviada em: terça-feira, 4 de outubro de 2005 01:32
Para: flexcoders@yahoogroups.com
Assunto: RE: [flexcoders] Getting a null object reference

Try using creationComplete in your Composition.mxml instead of initialize and see if that works.

 

Matt

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Michel Bertrand
Sent: Monday, October 03, 2005 11:45 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Getting a null object reference

 

Hi !

I'm trying to do the following:

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"
                                xmlns:framework="com.datasul.framework.ui.template.view.*"
                                width="100%" height="100%"
                                initialize="initialize()">
       
        <mx:Script>
        <![CDATA[
                import com.datasul.framework.ui.template.model.CompositionModel;
               
                var model:CompositionModel;
       
                function initialize() : Void {
                        model = new CompositionModel();
                }
        ]]>
        </mx:Script>

        <framework:Composition width="100%" height="100%">
                <framework:model>{this.model}</framework:model>
        </framework:Composition>

</mx:Application>

I would like to bind the value of "model" with the "model" property of the Composition component. Like:

"Composition.mxml"
<mx:Canvas xmlns:mx="http://www.macromedia.com/2003/mxml" initialize="initialize()" width="100%" height="100%">
        <mx:Panel id="mainPanel">
                <mx:Script>
                <![CDATA[
                        import com.datasul.framework.ui.template.model.CompositionModel;

                        var model:CompositionModel;

                        function initialize(): Void {
                                if ( model == undefined ) {
                                        mx.controls.Alert.show("MODEL = NULL");
                                }
                        }
                ]]>
                </mx:Script>

         ..................

        </mx:Panel>
</mx:Canvas>

Everytime I run the code I get a message saying "MODEL = NULL". Why I don't have an
object instance since model has been already instantiated ?

Any help or suggestion will be very appreciated.

Thanks in advance !
Michel.

 




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




Reply via email to