5 Replies Latest reply on Oct 14, 2009 2:36 AM by PatrickDean

    Day1 Exercise3 number 22    [d1E3-22]

    Foxchx

      1120: Access of undefined property Alert.

       

       

      error on line 24-->

       

                      Alert.show("There was a problem","Error");

       

       

      Script block --->

      <mx:Script>
              <![CDATA[
                  import mx.events.ListEvent;
                  import mx.collections.ArrayCollection;
                  import mx.rpc.events.FaultEvent;
                  import mx.control.alert;
                 
                 
          [Bidable] private var roomlist:ArrayCollection;
                 
                  private function changeHandler(event:ListEvent):void{

       

                  }

       

                  private function init():void{
                  rooms.send();
                  }

       

                  private function httpFaultHandler(event:FaultEvent):void{
                      Alert.show("There was a problem","Error");
                  }

       

              ]]>
          </mx:Script>

       

      the tutorial states that i should see an error popup but even though i change the "assets/roomList.xml2" to a xml2 inexistent file the page loads showing everything normally instead of the "error"

       

       

      thanksUntitled-1 copy.jpg

        • 1. Re: Day1 Exercise3 number 22    [d1E3-22]
          FlexDouche Level 1

          I looked over it quickly so i am not sure but:

          if you copy/pasted the exact code that you are using in FLEX... you have at least one typo that i see.

           

          you have "[Bidable]" instead of "[Bindable]"

           

          if u have one typo u could have others, double check your coding and maybe that will fix it.

           

           

          P.S. if u want to copy/paste the entire code chunk maybe we can spot something else?

          • 2. Re: Day1 Exercise3 number 22    [d1E3-22]
            Gregory Lafrance Level 6

            You need to import mx.controls.Alert

            • 3. Re: Day1 Exercise3 number 22    [d1E3-22]
              Steve Howard, ACP Level 3

              You need to import mx.controls.Alert

               

              This is a big failing in the Flex In A Week series as it stands - it does not explain at any point how developers can easily use automatic features to import classes. Simple errors like this are very easy to avoid if you use the auto-complete feature e.g. begin typing what you need, then press control+space if the code-hinting does not appear

               

              Steve

              • 4. Re: Day1 Exercise3 number 22    [d1E3-22]
                Foxchx Level 1

                Greg Lafrance wrote:

                 

                You need to import mx.controls.Alert

                but i did! didn't I?

                 

                or is that i should have use the ctr+spacebar to do it?

                 

                if i remember in the video there is sth about these import being generated automatically when using the ctl+spacebar?

                 

                i don't remember what i originaly did but is that what you mean?

                • 5. Re: Day1 Exercise3 number 22    [d1E3-22]
                  PatrickDean

                  Hi all, new to this.. obviously! Anyway, I had the same problem - it looks like the residual files from the previous exercise weren't cleared out correctly. The clue is that the list looks exactly the same even though we're not defining the list options in the mxml file. I found that ex2s mxml file was at the redarrow location, ex3s file at the blackarrow. (see sshot).

                  sshot.JPG

                   

                  It might even be worth deleting the whole folder from your C: and starting again with the example zip files.

                   

                  I've now got an error with the httpservice object but this I think will be the subject of another forum

                  Hope this helps someone at least! I'm having a great time learning anyway...