954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Getting URL address from the address bar to Flash App embedded using SWFObject

Hello,
I have been looking for a solution for a long time. I have embedded a SWF app in html page using SWFObject. Now I need to give the Flash app the address where it is currently embedded, since the same SWF file is embedded in more than one locations! So the Flash app is supposed to pull the right content according to its current position.
I am open to everything!
any ideas are welcomed!
I will be fine if I have to send the current URL through JS in my embedding html!
please help! !!!

marian99us
Newbie Poster
9 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

I don't really understand what you are trying to accomplish!

mohummad.ali
Newbie Poster
5 posts since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

You can accomplish your task by using JAVA SCRIPT and FLASH

Logic:

i) Using javascript you can find the url of the page
ii) Pass the result to flash using the flash communication with javascript
iii) External Interface is used to execute the javascript functions from flash
iv) So based on the result you can have a logic there to implement your need.

Hope you understand.

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

thank you so much for you prompt reply!
According to your guideline, I am stuck somewhere in the middle of second and third point.
I have obtained the URL in javascript. Now I need to send this URL to flash.
The problem is this javascript also does the embedding!
so somehow, this script is supposed to do two things in the right order
first: it needs to embed the flash app properly (which it does)
second: Once the app is embedded and, it needs to send the URL
i would really appreciate it if you could help me on this one!
thanks!

You can accomplish your task by using JAVA SCRIPT and FLASH

Logic:

i) Using javascript you can find the url of the page ii) Pass the result to flash using the flash communication with javascript iii) External Interface is used to execute the javascript functions from flash iv) So based on the result you can have a logic there to implement your need.

Hope you understand.

marian99us
Newbie Poster
9 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

Actually what you want to control in flash? Are you changing animations based on the URL or something else?

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 
Actually what you want to control in flash? Are you changing animations based on the URL or something else?

here is the complete stroy:The flash app (.swf) is in the root of the website.
The same app is embedded in many different pages in different directories (not in the root!)
When the app is "called" on a webpage, it reads the text content from the directory where the page is embedded at the moment

marian99us
Newbie Poster
9 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

What content it reads? what type of swf is that? animation or anything? is it hosted?

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

not hosted yet!
the swf is a full fledged flash app
it reads text from the same directory

marian99us
Newbie Poster
9 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

Ok, Whether the text reads from a text file or xml? Is it contains different datas for different pages? Whats the problem now? You have flash fla with you?

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

the text files are XMLs
and each xml file has different contents!
so when the flash app loads, it needs to look for the XML file, and in order to look into the right folder, it needs to know where exactly it is embedded!

marian99us
Newbie Poster
9 posts since Sep 2009
Reputation Points: 10
Solved Threads: 0
 

Okay, then the problem is to change your fetching url code within your flash file. You know flash to edit the contents? There we have a external interface class to solve your problem.

One more quesiton, do you paste your code flash url code which is already there?

rajarajan07
Nearly a Posting Virtuoso
1,447 posts since May 2008
Reputation Points: 167
Solved Threads: 239
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: