Location of HTML, not SWF

Posted on 2003-03-22
Medium Priority
Last Modified: 2010-04-03

Is there a Flash variable that contains the URL of the HTML document that is embedding the Flash movie? _root._url shows the path to the movie itself, not the document that contains the movie... For example, if the movie is located at flash.com/images/menu.swf, but the HTML document that holds menu.swf is located at flash.com/site/index.html, I want a variable that contains the latter. I've heard someone recommend trying to get the variable from JavaScript's loaction.href, but I wouldn't know how to go about doing that, or know how efficient that is. Thanks.
Question by:jtribby
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

henryww earned 280 total points
ID: 8188073
no ... but can write a javascript function do that ...

something like

function getMyURL(){
  myURL = window.location();
  //send it to flash
  myFlash = InternetExplorer ? window.movie_name: window.document.movie_name;

****** remember u must have the movie_name set to the id="movie_name" and name="movie_name" for the <object> and <embed> tag in order to work in IE & NS

Expert Comment

ID: 8188075
oh ... for the flash to call the function

//frame x

//frame x+1
can use htmlURL to do what u want there

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question