Ultrashock Forums > Flash > ActionScript
AS2 - Changing content of an iframe using a Flash navigation bar

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS2 - Changing content of an iframe using a Flash navigation bar
Old 2008-08-08

Hey hows it goin-

I'm trying to get my flash navigation bar to change the contents of an iframe on my web page, and I'm having a heck of a time figuring it out. I've read tons of articles like this one on multiple forums with people having the same issues, but I can't really figure out how to implement their answers into the codes and scripts. Plus, I haven't found anyone post their working codes back into their threads once they do finally find the answer. So I'm stuck, having limited web development experience & knowledge. But what I do know is that the codes are something along these lines:

javascript:
Code:
script type="text/javascript">
function changeURL(url)
{
document.getElementById('content').src=url;
}    
</script>
ActionScript:
Code:
 mybutton.onPress = function(){getURL("url", "Frame");}
ActionScript:
Code:
 mybutton.onPress = function(){getURL("javascript:changeURL('url');");}
I've also seen that the required ActionScript is an ExternalInterface class, but I'm not really sure how to implement that. Could someone please help me out?
Much appreciated!
postbit arrow 1 comment | 864 views postbit arrow Reply: with Quote   
Registered User
seniramsu is offline
seperator
Posts: 4
2008-08-07
seniramsu lives in United States
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2008-08-08 #2 Old  
Try this out:

Code:
import flash.external.ExternalInterface;

myButton.onRelease = function():Void
{
	ExternalInterface.call( "changeURL", "http://www.google.com" );
}
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: