Get your own customer support community
 

Strange CS4 Compiling error in onMapResize()

Getting s strange error here when compiling with CS4. Forgive my ignorance if this is a dumb question or has been asked before. Couldn't find a solution to it as of yet. I looked up the other CS4 compile issue and made those adjustments, but the fact that this didn't come up in that compile leads me to wonder if it is something in my code.

ReferenceError: Error #1069: Property ::map not found on Object and there is no default value.
at MethodInfo-733()
at com.modestmaps.extras::MapControls/onMapResize()
at com.modestmaps.extras::MapControls/onAddedToStage()
at flash.display::DisplayObjectContainer/addChild()
 
silly I’m unsure
Inappropriate?
1 person has this problem

  • Donovan Adams
    Inappropriate?
    Fixed it. Was a scope issue within the position functions not getting a proper reference to the map.

    replace the positionFunctions in MapControls.as with this code:
    **********
    private var positionFunctions:Object = {

    left: function(child:DisplayObject, s:String, a:String, map:Map):void {
    if (s.lastIndexOf("%") >= 0) {
    child.x = map.getWidth() * parseFloat(s.substring(-1)) / 100.0;
    }
    else {
    child.x = parseFloat(s.substring(-2));
    }
    child.x -= a ? hAlignFunctions[a.split('-')[1]](child) : 0;
    },
    right: function(child:DisplayObject, s:String, a:String, map:Map):void {
    if (s.lastIndexOf("%") >= 0) {
    child.x = map.getWidth() - (map.getWidth() * parseFloat(s.substring(-1)) / 100.0) - child.width;
    }
    else {
    child.x = map.getWidth() - parseFloat(s.substring(-2)) - child.width;
    }
    child.x += a ? hAlignFunctions[a.split('-')[1]](child) : 0;
    },
    top: function(child:DisplayObject, s:String, a:String, map:Map):void {
    if (s.lastIndexOf("%") >= 0) {
    child.y = map.getHeight() * parseFloat(s.substring(-1)) / 100.0;
    }
    else {
    child.y = parseFloat(s.substring(-2));
    }
    child.y -= a ? vAlignFunctions[a.split('-')[0]](child) : 0;
    },
    bottom: function(child:DisplayObject, s:String, a:String, map:Map):void {
    if (s.lastIndexOf("%") >= 0) {
    child.y = map.getHeight() - (map.getHeight() * parseFloat(s.substring(-1)) / 100.0) - child.height;
    }
    else {
    child.y = map.getHeight() - parseFloat(s.substring(-2)) - child.height;
    }
    child.y += a ? vAlignFunctions[a.split('-')[0]](child) : 0;
    }
    };
    ************

    and on line 265:
    replace with:
    positionFunctions[reference](this[child], position[reference], position['align'], map);
     
    happy I’m happy
User_default_medium