7 Replies Latest reply on Oct 4, 2009 6:48 PM by pakkiderm

    error in project but no error in files

    michael nieuwenhuizen Level 1

      I've been learning Flex, and been working with some example from a book (Learning Flex 3: Getting Up To Speed With Rich Internet Applications), but in one chapter (12: States) all the examples give the same mysterious error: the Project shows an error (with the white cross on a red background), but neither the mxml file I just created nor any of the other files have an error message.  Still, there's part of the code that supposedly has the error, cos when I take it out the error message for the Project disappears.  If I try to run the project it tells me there is an error, and if I still proceed the application crashes saying something about a State not existing.

       

      The error happens in this bit of code:

       

          <mx:states>
              <mx:State name="registration">

                  <mx:SetProperty target="{loginPanel}" name="title" value="New User Registration"/>

                  <mx:SetProperty target="{submitButton}" name="label" value="Register"/>

                  <mx:SetProperty target="{registerLink}" name="label" value="Already have an account with us?"/>

                  <mx:SetEventHandler target="{registerLink}" name="click" handler="currentState=''"/>

                  <mx:AddChild relativeTo="{loginForm}" position="firstChild">
                      <mx:FormItem id="fullNameFormItem" label="Full Name:">
                          <mx:TextInput/>
                      </mx:FormItem>
                  </mx:AddChild>

                  <mx:AddChild relativeTo="{loginForm}" position="lastChild">
                      <mx:FormItem id="confirmPasswordFormItem">
                          <mx:TextInput displayAsPassword="true"/>
                      </mx:FormItem>
                  </mx:AddChild>
              </mx:State>
          </mx:states>

       

      All the target like {loginPanel} etc exist.  What am I doing wrong?

        • 1. Re: error in project but no error in files
          Michael Borbor Level 4

          Have you checked the book website errata?

           

          Sincerely,

           

          Michael

           

          Sent from my iPhone

           

          El 28/06/2009, a las 13:01, michael nieuwenhuizen <forums@adobe.com

          escribió:

           

          >

          I've been learning Flex, and been working with some example from a 

          book (Learning Flex 3: Getting Up To Speed With Rich Internet 

          Applications), but in one chapter (12: States) all the examples give 

          the same mysterious error: the Project shows an error (with the 

          white cross on a red background), but neither the mxml file I just 

          created nor any of the other files have an error message.  Still, 

          there's part of the code that supposedly has the error, cos when I 

          take it out the error message for the Project disappears.  If I try 

          to run the project it tells me there is an error, and if I still 

          proceed the application crashes saying something about a State not 

          existing.

          >

          The error happens in this bit of code:

          >

              <mx:states>

                  <mx:State name="registration">

                      <mx:SetProperty target="" name="title"  > value="New User Registration"/> >             <mx:SetProperty target="" name="label"  > value="Register"/> >             <mx:SetProperty target="" name="label"  > value="Already have an account with us?"/> >             <mx:SetEventHandler target="" name="click"  > handler="currentState=''"/> >             <mx:AddChild relativeTo=""  > position="firstChild"> >                 <mx:FormItem id="fullNameFormItem" label="Full Name:"> >                     <mx:TextInput/> >                 </mx:FormItem> >             </mx:AddChild> >             <mx:AddChild relativeTo=""  > position="lastChild"> >                 <mx:FormItem id="confirmPasswordFormItem"> >                     <mx:TextInput displayAsPassword="true"/> >                 </mx:FormItem> >             </mx:AddChild> >         </mx:State> >     </mx:states> > > All the target like etc exist.  What am I doing wrong?

          >

          • 2. Re: error in project but no error in files
            michael nieuwenhuizen Level 1

            Yes, I checked the website, and there is no errata.  In fact the code online and with much more detail, and still I get the same error message.  Have a look at http://greenlike.com/flex/learning/12/ContactManager/srcview/ for example.  If I just copy&paste the code given, and try to run it I get an error message without there being an error message for any specific line of the code.  The application doesn't seem to work properly.

            • 3. Re: error in project but no error in files
              michael nieuwenhuizen Level 1

              By the way, if I try to export a release build, I get an error message:

               

                   One or more errors were found trying to build the release version. Unable to export.

                   Reason:

               

              and no reason give.  Looking at the details I get:

               

                  
                Encountered errors or warnings while building project states.mxml.
                  states.mxml: Type was not found or was not a compile-time constant: states. [Generated code (use -keep to save): Path: /Users/Mike/Programming/Eclipse/workspace/LearningFlex/src/generated/states-generated.as, Line: 424, Column: 14]

              • 4. Re: error in project but no error in files
                Michael Borbor Level 4

                I'll take a look at the link later. Who wrote that book?

                • 5. Re: error in project but no error in files
                  DM277

                  Hi,

                   

                  Could you please explain how you created the project.I tried the same code in your link.But its working fine for me.

                  • 6. Re: error in project but no error in files
                    michael nieuwenhuizen Level 1

                    Michael -> the guy who wrote the book is called Alaric Cole.  The book gets 4.5 stars on Amazon, and rightly so, it's a very good book.

                     

                    DM -> I just created the project the normal way, with all the default values.  The rest of the project works fine, but if I add this example with states it doesn't work anymore.  The project is shown below in the image attached.  As you can see there is an error flag for the project, but no error flag for any of the files.  Still, if I clear the mxml application with the code above the error message disappears, so it;s definitely in this file.

                     

                    By the way, the error message is:

                     

                         Type was not found or was not a compile-time constant: states. [Generated code (use

                         -keep to save): Path: /Users/Mike/Programming/Eclipse/workspace/LearningFlex/src/

                         generated/states-gen erated.as, Line: 424, Column: 14]

                     

                    and if I go to that line the code is:

                     

                            var target:states = this;

                    • 7. Re: error in project but no error in files
                      pakkiderm

                      The issue maybe that you can't name your file states or anyother key words. so simply change it to something like myStates.mxml