7 Replies Latest reply on Jan 22, 2009 9:35 AM by Wrensthav

    exercise 4 of day four display error

    Wrensthav
      going through the day four exercises has been fine up to this point where the four errors that appear as follows ,note "ReservationSystem4" is the name of the project folder:


      Severity and Description Resource Location
      Syntax error: A string literal must be terminated before the line break. ReservationSystem4 line 7
      Syntax error: expecting identifier before comma. ReservationSystem4 line 8
      Syntax error: expecting rightbracket before rightbrace. ReservationSystem4 line 11
      Syntax error: expecting rightparen before rightbrace. ReservationSystem4 line 11

      these errors appear whenever I enter the design mode in the ReservationSystem.mxml or in any other component of the ReservationSystem4 flex project.
      Also, in this step of the exercise the submit button that is to lead into the "loggedin" state is not functioning.

      Any ideas why this is so?
        • 1. Re: exercise 4 of day four display error
          Level 7

          "Wrensthav" <webforumsuser@macromedia.com> wrote in message
          news:gl55dc$20e$1@forums.macromedia.com...
          > going through the day four exercises has been fine up to this point where
          > the
          > four errors that appear as follows ,note "ReservationSystem4" is the name
          > of
          > the project folder:
          >
          >
          > Severity and Description
          > Resource Location
          > Syntax error: A string literal must be terminated before the line
          > break. ReservationSystem4 line 7
          > Syntax error: expecting identifier before comma.
          > ReservationSystem4 line 8
          > Syntax error: expecting rightbracket before rightbrace.
          > ReservationSystem4 line 11
          > Syntax error: expecting rightparen before rightbrace.
          > ReservationSystem4 line 11
          >
          > these errors appear whenever I enter the design mode in the
          > ReservationSystem.mxml or in any other component of the ReservationSystem4
          > flex
          > project.
          > Also, in this step of the exercise the submit button that is to lead into
          > the
          > "loggedin" state is not functioning.
          >
          > Any ideas why this is so?

          Paste in the code from lines 7 through 11.


          • 2. Re: exercise 4 of day four display error
            Wrensthav Level 1
            from which .mxml file?

            • 3. Re: exercise 4 of day four display error
              Wrensthav Level 1
              here's what i have from those lines in the ReservationSystem.mxml file.

              7 horizontalScrollPolicy = "off">
              8
              9 <mx:Script>
              10 <![CDATA[
              11 private function init():void{

              the place the errors occur, are in the encompassing flex project folder which is Named "ReservationSystem4" hence my confusion.
              • 4. Re: exercise 4 of day four display error
                Level 7

                "Wrensthav" <webforumsuser@macromedia.com> wrote in message
                news:gl5e6d$ca2$1@forums.macromedia.com...
                > here's what i have from those lines in the ReservationSystem.mxml file.
                >
                > 7 horizontalScrollPolicy = "off">
                > 8
                > 9 <mx:Script>
                > 10 <![CDATA[
                > 11 private function init():void{
                >
                > the place the errors occur, are in the encompassing flex project folder
                > which
                > is Named "ReservationSystem4" hence my confusion.

                Can you post the entire file? I'm not seeing anything in those lines that
                could be causing the error, but sometimes earlier or later errors will cause
                the compiler to think that there are errors on the lines containing the
                opening or closing part of the code containing the error.


                • 5. Re: exercise 4 of day four display error
                  Wrensthav Level 1
                  here is the complete ReservationSystem.mxml file:


                  <?xml version="1.0" encoding="utf-8"?>
                  <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
                  layout="absolute"
                  xmlns:comp="components.*"
                  themeColor="silver"
                  backgroundColor="#62627F"
                  horizontalScrollPolicy = "off">

                  <mx:Script>
                  <![CDATA[
                  private function init():void{
                  login.addEventListener("login", loginHandler);
                  }
                  private function loginHandler(event:Event):void{
                  this.currentState = "loggedin";
                  }
                  ]]>
                  </mx:Script>
                  <mx:states>
                  <mx:State name="loggedin">
                  <mx:RemoveChild target="{login}"/>
                  <mx:AddChild>
                  <comp:Reservation horizontalCenter="0"
                  y="20"/>
                  </mx:AddChild>
                  </mx:State>
                  </mx:states>

                  <mx:Style>
                  @font-face {
                  src: url("C:/WINDOWS/Fonts/Justus-Roman.ttf");
                  fontFamily: "fontJustusRoman";
                  unicodeRange: U+0061-U+007A, U+0043;
                  }

                  @font-face {
                  src: url("C:/WINDOWS/Fonts/Justus-Bold.ttf");
                  fontFamily: "fontJustusBold";
                  font-weight: bold;
                  unicodeRange: U+0058-U+005A;
                  }
                  </mx:Style>
                  <comp:Login id="login"
                  width="864" height="604"
                  horizontalCenter="0" verticalCenter="0"
                  y="20"/>

                  </mx:Application>
                  • 6. Re: exercise 4 of day four display error
                    Level 7

                    "Wrensthav" <webforumsuser@macromedia.com> wrote in message
                    news:gl5ht4$gj4$1@forums.macromedia.com...
                    > here is the complete ReservationSystem.mxml file:
                    <code snipped>

                    Unfortunately, I wasn't able to just copy and paste your file into a new
                    mxml application and have it work, due to the fact that you have components
                    in there that I don't have and reference fonts I don't have. I switched the
                    fonts to ones that I _do_ have, and I don't believe the problem is with your
                    CSS declarations. When I removed everything that referenced your custom
                    components, there were no errors. That tells me that if there are genuine
                    errors in there, it is in one of the lines that declares one of your
                    components _or_ it is in one of the lines that refers to login in script.

                    However, there is also a possibility that these are not "real" errors. They
                    could just be artifacts of former errors--I have seen that happen. You
                    might want to try Project>Clean to see if that makes them go away.

                    I believe that the reason the state doesn't change is because your init()
                    function isn't being called and therefore the event listener isn't
                    registered.

                    HTH;

                    Amy


                    • 7. Re: exercise 4 of day four display error
                      Wrensthav Level 1
                      found the answer, after cross referencing with the solution archive. In the ReservationSystem.mxml the application was missing the creationComplete="init()" command in the application tag. Don't know why the tutorial mentions to place this in both the Reservation and ReservationSystem files though.

                      Well thanks for your help. guess that was what you meant when you asked if the init() function was called.