Skip to main content
Known Participant
March 9, 2009
Question

is there a script that reads what html page is open?

  • March 9, 2009
  • 4 replies
  • 443 views
hi there. i was wondering if there is a way to make a flash header "read" what html page is open, and load a background image accordingly? basically i don't want to have to make a different header for every section of the site, but would like a universal header be able to tell what page has been loaded and show an image specific to that section.

thanks.
This topic has been closed for replies.

4 replies

Ned Murphy
Legend
March 10, 2009
Here's a link that provides some information on using ExternalInterface...

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683
kglad
Community Expert
Community Expert
March 10, 2009
check the externalinterface class'es addCallBack() method to have your js function call a flash function and pass the url. you can then use the flash string methods to extract what you need from the url.
kglad
Community Expert
Community Expert
March 9, 2009
you can use javascript to read the html file name and flash can communicate with javascript using the externalinterface classs.
Known Participant
March 9, 2009
so use a javascript like?
<SCRIPT LANGUAGE="JavaScript">
<!--
{
document.write(location.href);
}
// -->
</SCRIPT>

which would result in the full url being given. but then i don't know how to get the flash movie to read it and then create some sort of variable string based on the results...
kglad
Community Expert
Community Expert
March 9, 2009
you have one swf that's embedded on multiple html pages?
Known Participant
March 9, 2009
yes, it is one swf header that i would like to use across all html pages.