i am working with a flash menu and would like it load content into an iframe using the button from the menu.

i have had a look around and found this code

on (release){
getURL("commissioning/index1.htm" , "ifrm");

}

this is meant to load the new content into the iframe but it just opens it in a new window has anybody done this before? does anyone no why this code is not working i have tried it without the quote marks around the frame id and it still has the same effect.

Dani AI

Generated

Common causes when a Flash button opens a new browser window instead of loading into an iframe are the iframe not being addressable by name and testing the SWF outside the hosting page. As discovered, the behavior often disappears after uploading because the SWF runs inside the HTML page (so the target frame exists).

Checklist to fix and verify:

  • Make sure the iframe has a name attribute that exactly matches the target used by the SWF. Browsers/Flash look for a frame name, not just an element id. Example:
<iframe id="ifrm" name="ifrm" src="about:blank" width="800" height="600"></iframe>
  • Test via HTTP (upload to your server) rather than opening the SWF directly with file:// or the standalone player. If the hosting page is absent, Flash cannot find the frame and the browser opens a new window.

  • Match ActionScript to the player version. In AS3, use navigateToURL instead of the older AS2 call. Example AS3:

import flash.net.URLRequest;
navigateToURL(new URLRequest("page.html"), "ifrm");

If more control is needed, call a parent JavaScript function from Flash using ExternalInterface and update the iframe src from JS. When using ExternalInterface, ensure the embed/object parameters allow script access and that same-origin rules are satisfied.

this code does work it just needs uploading first? why who knows i dont

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.