Search code examples
actionscript-3flashflash-cs6

Changing iframe content with flash buttons


I am trying to change iframe src from a flash button which is located outside from iframe

here is my code

this.contact.onRelease = function() {
    navigateToURL(new URLRequest("page2.html", target="myframe") );
};

but this is not working


Solution

  • It is possible to change the iframe content without the ExternalInterface but you are also restricted to your own domain I think. You were almost right with your code. I'm not sure if the this.contact.onRelease is going to work but the navigateToURL should be like this:

    navigateToURL(new URLRequest("page2.html"), "myframe");
    

    You were assigning the target to the URLRequest and also the target is just a string, so without target=...

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/package.html#navigateToURL()