8 Replies Latest reply on Dec 9, 2010 9:47 AM by Ansury

    converting legacy Flex code to Flash Builder 4

    miquael Level 1

      I have some code that was created in an early version of Flex that I'm trying to bring into Flash Builder 4.  The project will not build.  There seems to be a problem with some the MXML.

       

      I'm well experienced in ActionScript 3.0, though am just beginning to work with the Flex framework and Flash Builder, so MXML is still unclear to me.

       

      Flash Builder shows an error on this line:

       

      <local:GeocentricView id="geocentricView" orb="{GCOrbSlider.value}"/>

       

      ... the error declaring : "The prefix "local" for element "local:GeocentricView" is not bound."

       

      The entire code file is here (I'm pretty certain the problem is not with the ActionScript, so have not included it):

       

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"

                                  xmlns:s="library://ns.adobe.com/flex/spark"

                                  xmlns:mx="library://ns.adobe.com/flex/mx"

                                  xmlns:components="components.*" xmlns:custom="custom.*">

           

       

                <fx:Script>

                     <![CDATA[

                     

                              // a bunch of ActionScript 3.0 code ...


                     ]]>

                </fx:Script>

                

           <fx:Declarations>

                <!--<mx:Style source="AION.css"/>-->

                

                <mx:ApplicationControlBar width="100%">

                     <mx:Label text="AION" color="0xFFFFFF" fontWeight="bold" fontSize="20"/>

                </mx:ApplicationControlBar>

                

                <mx:Spacer height="5"/>

                

                <mx:VDividedBox width="100%" height="100%" liveDragging="true" dividerPress="paused=true" dividerRelease="paused=false">

                     <mx:HDividedBox id="hd" width="100%" height="100%" liveDragging="true" dividerPress="paused=true" dividerRelease="paused=false">

                          <custom:AIONPanel id="geocentricPanel" title="Geocentric View" width="100%" height="100%" reset="resetPanelSizes()" maximise="timelinePanel.height=0;heliocentricPanel.width=0">

                               <local:GeocentricView id="geocentricView" orb="{GCOrbSlider.value}"/>

                               <mx:HSlider id="GCOrbSlider" value="2" minimum="0" maximum="10" bottom="10" left="10" liveDragging="true" showDataTip="false" visible="false"/>

                          </custom:AIONPanel>

                          <mx:VBox minWidth="175" maxWidth="175" height="100%" horizontalAlign="center" horizontalCenter="true">

                               <mx:Tile id="checkBoxesTile" height="100%" width="100%">

                               </mx:Tile>

                               

                               <!--<mx:Label id="dateLabel" width="100%" color="0xFFFFFF" fontSize="13" horizontalCenter="true" textAlign="center"/>

                               <mx:DateField id="dateField" change="date=dateField.selectedDate" width="0" visible="false" includeInLayout="false"/>-->

                               <mx:HSlider id="speedSlider" change="speed=speedSlider.value" liveDragging="true"/>

                               <mx:Spacer height="7"/>

                          </mx:VBox>

                          <custom:AIONPanel id="heliocentricPanel" title="Heliocentric View" width="100%" height="100%" reset="resetPanelSizes()" maximise="timelinePanel.height=0;geocentricPanel.width=0">

                               <local:HeliocentricView id="heliocentricView" zoom="{HCZoomSlider.value}"/>

                               <mx:HSlider id="HCZoomSlider" value="1" minimum="0.6" maximum="25" bottom="10" right="10" liveDragging="true" showDataTip="false"/>

                          </custom:AIONPanel>

                     </mx:HDividedBox>

                     <custom:AIONPanel id="timelinePanel" title="Timeline" maximise="hd.height=0" width="100%" height="100%" reset="resetPanelSizes()"/>

                </mx:VDividedBox>

                <mx:Image source="{fpsTimer}"/>

           </fx:Declarations>

      </s:WindowedApplication>

       

       

      The contents of the GeocentricView.mxml file is here:

       

      <?xml version="1.0" encoding="utf-8"?>

      <mx:UIComponent xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()" width="100%" height="100%" resize="onResize()">

           <mx:Script>

                <![CDATA[

                     

                          // a bunch of ActionScript 3.0 code ...


                ]]>

           </mx:Script>

      </mx:UIComponent>

       

       

      Any insights into what the problem and solution is?