4 Replies Latest reply on May 16, 2006 2:22 PM by Darius_K

    Flex Builder 2.0 Beta 3 Help!

    Darius_K
      I have been trying some of the beta demos and tutorial, In all of them I get the same error when I try to act on a target="{myButton2}".

      "Type was not found or was not a compile-time constant"

      I can compile it the workspace if I define the target as target="myButton2" but this fires a error when I invoke it. Even the samples, when recompiled do the same thing.
      Is anyone else having this problem?
        • 1. Re: Flex Builder 2.0 Beta 3 Help!
          Level 7
          The error basically means that you've referenced something (variable or
          class) that isn't defined anywhere... presumably myButton2. Making a
          wild guess (based on the name), I'd expect for there to be a

          <mx:Button id="myButton2"/>

          in the MXML file somewhere, which would effectively create an instance
          of mx.controls.Button called myButton2.

          Rebecca - Adobe

          Darius K wrote:
          > I have been trying some of the beta demos and tutorial, In all of them I get
          > the same error when I try to act on a target="{myButton2}".
          >
          > "Type was not found or was not a compile-time constant"
          >
          > I can compile it the workspace if I define the target as target="myButton2"
          > but this fires a error when I invoke it. Even the samples, when recompiled do
          > the same thing.
          > Is anyone else having this problem?
          >
          • 2. Flex Builder 2.0 Beta 3 Help!
            Darius_K Level 1
            Rebecca Thanks for the reply, the complete code is below. I have been playing with this for awhile now and in each case I have the referenced item declared.


            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml">

            <mx:Zoom id="myZoom2"
            zoomHeightFrom=".10"
            zoomWidthFrom=".10"
            zoomHeightTo="1.00"
            zoomWidthTo="1.00"
            target="{myButton2}"/>
            <mx:Button id="myButton2" label="Zoom target" click="myZoom2.play();"/>

            </mx:Application>
            • 3. Re: Flex Builder 2.0 Beta 3 Help!
              Level 7
              Did something go wrong when you pasted this in? There appears to be
              some extra stuff (an HTML anchor tag?) in and around the
              <mx:Application> tag.

              I take the full Flex application to be

              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
              <mx:Zoom id="myZoom2"
              zoomHeightFrom=".10"
              zoomWidthFrom=".10"
              zoomHeightTo="1.00"
              zoomWidthTo="1.00"
              target="{myButton2}"/>
              <mx:Button id="myButton2" label="Zoom target"
              click="myZoom2.play();"/>
              </mx:Application>

              which does both compile and run for me if you put it in a new Flex
              project in FB.

              Darius K wrote:
              > The complete code is below, taken directly from the tutorials.
              >
              > <mx:Application xmlns:mx="<a target=_blank class=ftalternatingbarlinklarge
              > href=" http://www.adobe.com/2006/mxml">
              >
              > "> http://www.adobe.com/2006/mxml">
              >
              > </a> <mx:Zoom id="myZoom2"
              > zoomHeightFrom=".10"
              > zoomWidthFrom=".10"
              > zoomHeightTo="1.00"
              > zoomWidthTo="1.00"
              > target="{myButton2}"/>
              > <mx:Button id="myButton2" label="Zoom target" click="myZoom2.play();"/>
              >
              > </mx:Application>
              >
              • 4. Re: Flex Builder 2.0 Beta 3 Help!
                Darius_K Level 1
                Thanks for all the help! When I created a new project everything was fine. I think it is down to a ghost in my machine, in most case when I copy & paste I will paste it into notepad first to clear any hidden HTML. In this case making a new MXML file or even cleaning the existing project would not work, but once as you suggested I made a new project it was fine.

                I really like Flex and can see allot of potential uses.

                Thanks again.