Select to view content in your preferred language

migrate navigation tools from flex 3 to flash builder 4

606
1
01-13-2011 12:51 PM
francescodi_vito
Deactivated User
Hello guys
i have a problem! i wrote in flex builder 3 this script for a new navigation tools

<mx:Script>
<![CDATA[
  import com.esri.ags.geometry.Extent;
  import com.esri.ags.SpatialReference;
 
  private function zoominFunction():void
  { navToolbar.activate(Navigation.ZOOM_IN); }
  private function zoomoutFunction():void
  { Roma.level = Roma.level - 1; } // zoomuot by substracting one level at a time
  private  function panFunction():void
  { navToolbar.activate(Navigation.PAN); }
  private function kaneExtent():void
  {
    var spatialRef:SpatialReference = new SpatialReference(4326);
    var extent:Extent = new Extent(-150,-50,150,50,spatialRef);
    Roma.extent = extent;
  }
]]>
</mx:Script>

<mx:Glow id="glow_red" duration="100" color="#FF0000" alphaFrom="0.5" alphaTo="0" blurXTo="20" blurYTo="20"/>
<mx:Glow id="unglow_red" duration="100" color="#FF0000" alphaFrom="0.5" alphaTo="0" blurXTo="5" blurYTo="5"/>
<!-- Navigation Tool Bar -->
<esri:Navigation id="navToolbar" map="{Roma}"/>

<mx:HBox borderStyle="outset" width="344" height="38" top="10" horizontalCenter="163">
  <mx:Image height="25" id="ZoomIn" buttonMode="true" source="assets/images/icons/i_zoomin.png" toolTip="Zoom In"
    click="zoominFunction()" rollOverEffect="{glow_red}" rollOutEffect="{unglow_red}"/>
  <mx:Image height="25" id="ZoomOut" buttonMode="true" source="assets/images/icons/i_zoomout.png" toolTip="Zoom Out"
    click="zoomoutFunction()" rollOverEffect="{glow_red}" rollOutEffect="{unglow_red}"/>
  <mx:Image height="25" id="Pan" buttonMode="true" source="assets/images/icons/i_pan.png" toolTip="Pan"
    click="panFunction()" rollOverEffect="{glow_red}" rollOutEffect="{unglow_red}"/>
  <mx:Image height="25" buttonMode="true"  source="assets/images/icons/i_zoomfull.png" toolTip="Zoom Full Extent" click="kaneExtent()"
    rollOverEffect="{glow_red}" rollOutEffect="{unglow_red}"/>
  <mx:Image height="25" toolTip="Previous Extent"  source="assets/images/icons/i_zoomprevious.png" click="navToolbar.zoomToPrevExtent()" enabled="{!navToolbar.isFirstExtent}" rollOverEffect="{glow_red}" rollOutEffect="{unglow_red}"/>
  <mx:Image height="25" toolTip="Next Extent"  source="assets/images/icons/i_zoomnext.png" click="navToolbar.zoomToNextExtent()" enabled="{!navToolbar.isLastExtent}"/>
  <mx:Image height="25" toolTip="Identify" source="assets/images/icons/i_info.png" buttonMode="true" />
 
</mx:HBox>
this code and the script are ok for web application in flex builder 3
now when i write the same script in flash builder 4 i have many errors in the script relating to functions
how and what should be changed script?
i wait any response.
Thanks guys
Tags (2)
0 Kudos
1 Reply
francescodi_vito
Deactivated User
hi guys
i apologise for any inconvenience , but i solved the problem with

import navigationtool class

thaks
0 Kudos