Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Location of HTML, not SWF

Posted on 2003-03-22
2
Medium Priority
?
143 Views
Last Modified: 2010-04-03
Hi,

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.
0
Comment
Question by:jtribby
  • 2
2 Comments
 
LVL 6

Accepted Solution

by:
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;
myFlash.SetVariable("htmlURL",myURL);
}

****** 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
0
 
LVL 6

Expert Comment

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

//frame x
getURL("javascript:getMyURL();");

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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

581 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