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! !!!

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

Member Avatar for rajarajan2017

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.

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.

Member Avatar for rajarajan2017

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

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
Member Avatar for rajarajan2017

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

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

Member Avatar for rajarajan2017

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?

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!

Member Avatar for rajarajan2017

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.