views:

1227

answers:

1

Hello, I'm trying to use my swf Menu to change the Content swf below it which is in an iframe so the menu doesnt have to load each time, but having trouble linking the buttons..

My flash code is:

homeButton.addEventListener(MouseEvent.CLICK, homeButtonFunction);
function homeButtonFunction(event: MouseEvent) {
var targetURL:URLRequest = new URLRequest("http://siteiwanttoload");
navigateToURL(targetURL, "_iframe");
}

the html code for the iframe is:

<iframe src=home.html name="iframe" width="630" height="300" frameborder="0" scrolling="no"></iframe>

Thanks for any help :)

A: 

First off, give your iframe a name that can identify it more easily, such as menuIframe or something other than just iframe.

<iframe src=home.html name="menuIframe" width="630" height="300" frameborder="0" scrolling="no"></iframe>

I can't really tell if this is the only problem, but your navigateToURL will need to have the URLRequest(which you have correctly), and the target. Your target in this case should be the name of the iframe, not just _iframe. Try:

navigateToURL(targetURL, "menuIframe");
Kekoa