Thanks for the suggestions guys, I've finally found the problem.
Since theres multiple SWF files in our project that needed Google
Maps, I made a simple XML config file which contained the GMap key
among others. All of our swf's loaded the same config file and wrote
it as "map.key = xmlSettings.key", but only those on unprotected pages
loaded the Map.
The problem was we used a variable from HTML to Flash, also called
"key" which had nothing to do with the map. However, GMap ignored the
key from the xml file, and replaces it with the html variable.
I've made a small test, to demonstrate the bug. First my Main.as
package package
{
import com.google.maps.Map;
import com.google.maps.MapEvent;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.geom.Point;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.events.Event;
/**
* ...
//* @author Jonas Boye
*/
public class Main extends Sprite
{
private var map:Map;
private var txt:TextField;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
// entry point
map = new Map();
map.sensor = "false";
map.key =
"ABQIAAAAbmXb0CFDyVkOVRQXzVm4DBQIrN8xeBNfxzMZeH54YTOVyTfcYhRwieYYflV3PavXXj2x8SIzkAvnSQ";
map.setSize(new Point(stage.stageWidth,
stage.stageHeight));
addChild(map);
map.addEventListener(MapEvent.MAP_PREINITIALIZE, debug);
map.addEventListener(MapEvent.MAP_READY, debug);
map.addEventListener(MapEvent.MAP_INITIALIZE_FAILED,
debug);
txt = new TextField();
txt.autoSize = TextFieldAutoSize.LEFT;
txt.text = map.key + "\n" + map.url + "\n" ;
addChild(txt)
}
private function debug(e:MapEvent):void
{
txt.appendText(e.toString() + "\n")
}
}
}
It shows up just fine on this page:
http://www.jonasboye.com/gmap/index.html
But doesn't show on
http://www.jonasboye.com/gmap/secretpage.html
The only difference being:
var flashvars = {key: "THISISNOTYOURKEYGOOGLE!!!"};
--
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-api-for-flash?hl=en.