1 Reply Latest reply: Jun 17, 2013 9:13 PM by Flex harUI RSS

    1120 Error

    Jynglez888 Community Member

      Very new to Flash builder. im trying to do a project for school making an interactive map.
      I found the Openscales project which im trying to use to give my map interactivity.
      Ive been following the tutorial given on the project website

      ( http://openscales.org/documentation/tutorials/current/tutorial-api-2.html )

       

      Before I try to import my own map image im trying to make this map from the tutorial work then im assuming it will be fairly easy to plug in my graphics. but...

       

      Ive run into an Error which I cant seem to fix. Ive googled and read of similar problems with this error but their problems werent exactly the same so i still couldnt really figure out whats causing it for me.

       

      I get the Error "1120:Access of undefined property fxmap."

       

      This is the code which i followed from the tutorial:

       

       

       

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

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

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

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

                                       minWidth="955"

                                       minHeight="600"

                                       xmlns:os="http://openscales.org"

                                       creationComplete="initMap();">

       

        <fx:Declarations>

        </fx:Declarations>

       

                <os:Map id="fxMap"

                                    width="500"

                                    height="600"

                                    zoom="11"

                                    center="4.78783,45.68800"

                                    x="60"

                                    y="50">

        <os:Mapnik name="Mapnik"/>

        <os:MousePosition

                                    x="10"

                                    y="{fxmap.height-20}"

                                    displayProjection="EPSG:4326"/>

        <os:DragHandler/>

        <os:ClickHandler/>

        <os:WheelHandler/>

        </os:Map>

        <os:PanZoom

                                    map="{map}"

                                    x="{fxmap.x+10}"

                                    y="{fxmap.y+10}"/>

        <fx:Script>

                          <![CDATA[

                                    import org.openscales.core.Map;

                                    import org.openscales.core.feature.CustomMarker;

                                    import org.openscales.core.feature.PointFeature;

                                    import org.openscales.core.layer.FeatureLayer;

                                    import org.openscales.core.style.Style;

                                    import org.openscales.geometry.Point;

                                    import org.openscales.proj4as.ProjProjection;

       

                                    [Bindable] private var map:Map = null;

                                    private function initMap():void{

                                              map = fxmap.map;

                                    }

                          ]]>

        </fx:Script>

       

        </os:Map>

      </s:Application>

       

       

       

      The Error is on the Line 45: 

       

        map = fxmap.map;

       

       

      Any help is greatly appreciated. Im on a pretty short deadline to figure all of this out.