Skip to main content
Community Expert
May 5, 2008
Question

getting current address

  • May 5, 2008
  • 4 replies
  • 830 views
I've designed this animated navigation bar which is common to each page on the site. I'm trying to figure out some action script that would get the current web address so that the nav button, which is a movie, would go to a specific frame and hold.

For example something like this written in english not code:
if url = http//www.mysite/about html go to and stop on frame 10 of movie clip named about

I'd include an if statement for each of the 10 main pages of the site so that the nav buttons would go to their on position at frame 10 and stay there until a new page was called up.

Hope you follow that and that the script would be fairly simple.
This topic has been closed for replies.

4 replies

Community Expert
May 5, 2008
still haven't figured this out.

If I could simply get the filename of the page the swf lives on then I could write a simple if statement that would play the appropriate movie clips to the ending frame.

Here's a link to the site I'm working on. The nav elements roll out into the page as you mouse over them. The amber power lights turn a bright green when the elements reach their ending position. All I want to do is to have the current page hold the appropriate tray in it's ending position.

http://byzintek.com/LaconicSite/
kglad
Community Expert
Community Expert
May 5, 2008
if you want the complete url, remove the 2nd locationVar line.

kglad
Community Expert
Community Expert
May 5, 2008
use google to search for: javascript retrieve url

and the flash help files have sample code for the addCallback() method of the externalinterface class.
Community Expert
May 5, 2008
Thanks for the reply. So any examples of this out there? I'm still completely lost.
kglad
Community Expert
Community Expert
May 5, 2008
if you're reloading your navigation bar with each html file you need to use javascript to return the html page to flash (or you can use flashvars). you can use the externalinterface class to receive javascript calls into flash.