The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 4 of 4

Thread: Google Maps problem ! Initialization failed: please check the API key, swf location,.

  1. #1
    46
    posts
    Registered User

    Google Maps problem ! Initialization failed: please check the API key, swf location,.

    Hi all

    I am using CS4 AS3. Google maps works fine when I ran it locally, but when I port my swf file to the domain (www.armenaki.com) I get the following error

    Initialization failed: please check the API key,swf location, version and network availability.

    I know that Google has depreciated Google Maps API for Flash and does not generate new APIs. But then again, how come it works locally???
    Is it a proxy problem at www.godaddy.com ?
    I even added map.url but no help.


    Below is the code for reference. Any help would be appreciated.

    var map:Map = new Map();
    map.url = "http://www.armenaki.com";
    map.key = "";
    map.sensor = "false";
    map.setSize(new Point(stage.stageWidth, stage.stageHeight));
    map.addEventListener(MapEvent.MAP_READY, onMapReady);
    map.width = 400;
    map.height = 300;
    map.y = 75;
    this.addChild(map);

    function onMapReady(event:Event):void
    {
    map.setCenter(new LatLng(35.15447,33.37282), 14, MapType.NORMAL_MAP_TYPE);
    map.addControl(new ZoomControl());
    }

  2. #2
    One thing that could be causing this is the use-network compiler argument. Since the error message says someting about network availability you should probably look into that.

    I had a problem like this when I was making a website that read .txt files from the server. Everything worked like a charm when I tried it locally but on the server it couldn't find the files. This is because of the security sand box.

    I have never used any Google API's so I don't know precisely. Also, I don't know how to check compiler arguments in CS4, (I only work in FlashDevelop), but the lack of network availability seems to be the problem

  3. #3
    Unregistered_12
    n/a
    posts
    Guest
    I know it's a semi-dead thread, but hopefully this'll help someone out.

    I believe the API key is linked to the SWF location- building locally and then porting to the server changes the SWF location and therefore invalidates the API key. Looking for a solution to this currently, though with not a lot of success.

  4. #4
    Just wondering have you solved this problem yet? I'm having the same issue with the site I'm working on http://jv.wickdmedia.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012