Hi,

I am trying to develop a website using adobe flash. So far so good. I am currently trying to embed google maps in my flash website and its a success. But, after i go the frame(page) to view the map..the embeded map is still there. It is on every frame(page) in my flash website. What do i do? please help.

Thank you in advance.

Dani AI

Generated

Short diagnosis and important context: if the map was added inside the SWF (the Google Maps Flash API) it will stay visible until the Flash display object is explicitly destroyed; if the map is an HTML embed/iframe it can appear to “stick” because Flash by default sits above page HTML. Also note the Maps Flash API was deprecated and turned off by Google (shutdown notice Sept 2, 2014), and Flash itself reached end-of-life on Dec 31, 2020 — migrating to the Maps JavaScript API or an iframe/embed is strongly recommended. (mapsplatform.googleblog.com)

Practical checklist (quick triage and fixes):

  • Confirm whether the map is created inside the SWF (ActionScript) or is an HTML iframe/JS embed. Fix strategy depends on that.

  • If the map is an ActionScript object: remove any listeners, remove it from the display list and null the reference when leaving the contact frame (don’t leave it attached to root or a persistent container). Example pattern:

    // when leaving the contact frame
    map.removeEventListener(/* eventType */, /* handler */);
    if (map.parent) map.parent.removeChild(map);
    map = null;

    This prevents the map instance from remaining visible and helps GC. (Follow AS3 removeEventListener/removeChild patterns.)

  • If the map is in HTML (iframe/JS) and the SWF covers it, add wmode="opaque" or wmode="transparent" (and the matching embed attribute) so HTML can layer above the SWF. Also add allowScriptAccess="always" if Flash and page must call each other. ()

Extra notes and immediate gotchas:

  • A common bug is passing an HTML anchor string into URLRequest instead of a plain URL; navigateToURL(new URLRequest("https://example.com"), "_blank"); is the correct form — see Adobe docs for navigateToURL. (airsdk.dev)
  • If choosing a long-term fix, migrate the map to the Google Maps JavaScript API or the Embed API (simpler iframe) so the map is controlled by the page, not the legacy Flash plugin. (mapsplatform.googleblog.com)

Relation to the thread: ’s suggestion to destroy the map from JavaScript is valid — use Flash’s ExternalInterface to call a page function (or call a JS cleanup from AS) so an HTML-based map can be destroyed when leaving the contact view. If the map was built with the Flash Maps API, migration to the JS API avoids both lifecycle headaches and the API shutdown risk. (airsdk.dev)

Recommended Answers

All 7 Replies

Are you removing the embed map when you exit the page? All of yours pages are in frames?

Anyway... why are u developing an website in flash?

Here's the situation :

i click on contact us page and it will load the contact page and the google map apear, then i click on home page and it will load the home page and the google map is still there, where as it is not suppose to be there..same goes to every page..

my boss ask me to develop a website in flash..lucky me because i never try it before..

Second problem found :

When i test the the website in html and load in browser, the google map embeded did not apear at all..please help..

appreciate your kind advise. thank you.

Wich Google Maps API are you using? ActionScript or JavaScript?

If you are using JS, try destroying before the page is closed with onbeforeunload event.

Another way is to call JS functions from within AS to destroy properly the map.

I'm assuming that only the map is still visible, because if the whole map page is visible, then you're missing something in your transitions.

i am using Google Maps Embed API, i think its actionScript..

Another way is to call JS functions from within AS to destroy properly the map.

what do you mean by that??

It's not clear for me yet... Is your map inside an HTML Page using JavaScript functions?

i only insert, this code to my html page :

<div id="swf-holder">
<object type="application/x-shockwave-flash" data="lg.swf">
 <param name="movie" value="lg.swf">
 <param name="flashVars" value="key={hgjhghjgjhghjghjghjghjg}&sensor=true">
</object>
</div>

in my flash actionscript code :

stop();

maplink_btn.addEventListener(MouseEvent.CLICK, maplink_btn_ClickToGoToWebPage_8);

function maplink_btn_ClickToGoToWebPage_8(event:MouseEvent):void
{
    navigateToURL(new URLRequest("https://goo.gl/maps/yGyN5"), "_blank");
}

that's is just it..

I just realize something ;

-all my external link in flash can run/works..but in html cannot..it means thatwhen i click a button to go to www.google.com, cannot work..

what could cause this??did i publish wrong??can someone help em please??

Thank you.

Do you have this published somewhere for me to check it out? I'm having a hard time trying to figure it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.