?
Solved

Can I detect from within Flash the page/URL it is running on.

Posted on 2007-07-25
10
Medium Priority
?
922 Views
Last Modified: 2008-01-09
I would like to know if one can detect the page/URL that the flash movie itself is running in. So can I use the actionscript only to find this or is the only way to use javascript to inform the movie of the url.
Example URL : http://www.mywebsite.com/content.asp#content=12

So I need flash to find this URL.
0
Comment
Question by:onlineinnovations
8 Comments
 
LVL 11

Expert Comment

by:JohnModig
ID: 19564661
Sure, use the TGetProperty() Flash method to get attributes of the Flash movie. One of the properties is URL. You may get this property, but you cannot set it. The URL property designates the location of the SWF file. You get a Flash property like this:
-----------------------------
  mySwf.TGetProperty(timeline, propertyNumber);
-----------------------------
The URL property is no. 15, so you get its value by going:
-----------------------------
  mySwf.TGetProperty(timeline, 15);
-----------------------------
Read more here: http://www.webreference.com/js/tips/010630.html

Regards,
John
0
 

Author Comment

by:onlineinnovations
ID: 19564767
Hi John

I cannot find the method TGetProperty only GetProperty and this has _URL which only returns
the location of the flashmovie ie:
http://www.mywebsite.com/myflashmovie.swf and not
http://www.mywebsite.com/content.asp#content=12
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 19565365
I would personally use some server-side code and pass it along into Flash using FlashVars...

PHP:  

$url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];



ASP:

<%
Thispage = Request.ServerVariables("script_name") & "?" & Request.Querystring
%>


here is how you would use Javascript also to get the parameters of the URL:

http://www.netlobo.com/url_query_string_javascript.html



and then where you embed the flash object, you pass the below parameter:


<param name="FlashVars" value=" < PLACE VARIABLE CODE HERE > ">


rp
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:onlineinnovations
ID: 19565439
Hi Guys

Thank you for the comments so far.
I've also implemented the client and server side solutions. I need to know if ,with using flash ONLY, I can get the relevant url. The issue is that I change the url in flash depending on the location in the flash movie. ie
http://www.mywebsite.com/content.asp#content=12
http://www.mywebsite.com/content.asp#content=13

So I need find this URL from Flash without client/serverside code.
0
 
LVL 22

Accepted Solution

by:
rascalpants earned 2000 total points
ID: 19565726
the short answer is no...

I looked into the FileReference class, but there is nothing I can see that would let you do this.


rp
0
 
LVL 22

Expert Comment

by:rascalpants
ID: 19565858
BTW...  why do you need to do this?  there might be another solution or approach to your problem


rp
0
 

Author Comment

by:onlineinnovations
ID: 19566304
I wanted to know if I could create bookmark URLs without passing vars to the Flash movie with client/server script. Thanks anyway I will go ahead with the Clientside implmentation.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 20191725
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Question has a verified solution.

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

Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.
Suggested Courses

579 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