0

I am developing a Wordpress theme. In one page I have to use iframe to get content from another website. That page is an image slider and it uses flash for it. I don't have any idea about flash. It uses something like AC_FL_RunContent.

I need to get information of the images to show some text based on the image. I mean different text for different image. Is there any way, can I pull out the information like the name of the image from this iframe?

I have full access to the flash file too. But they are on different domain. Thanks in advance.

sakibmoon
  • 2,026
  • 3
  • 22
  • 32

2 Answers2

2

You cannot access the content of an IFRAME that is pointing to another site. The SOP will prevent that. It will be a security threat.

Cheers.

vtortola
  • 34,709
  • 29
  • 161
  • 263
  • With this I can get access of an DOM, but can I use it in case of flash? I need to get the image name at least. There is no
    or any HTML tag in that iframe. What to do in this case?
    – sakibmoon Dec 05 '12 at 13:05
  • I have never used flash, sorry I cannot help you with that :( – vtortola Dec 05 '12 at 13:08
  • Thanks anyway. You gave me some good piece of information. Cheers. – sakibmoon Dec 05 '12 at 13:23
1

If you have access to the source file(s) for the flash you might be able to work around the iFrame's sandbox by using a LocalConnection to a small, invisible proxy flash file in your template that runs subsequent JS calls. It would require you to make changes to the original image gallery and recompile it.

The model would be as follows:

  1. Image gallery flash sends file name as a message over LocalConnection.
  2. Proxy flash recieves message, uses ExternalInterface to call JS function on page.
  3. JS function on page recieves function call from proxy flash and performs relevant actions.

Adobe LiveDocs on using LocalConnection

Adobe LiveDocs on using ExternalInterface

It's not pretty I admit, but it's the only solution I can think of if the image gallery is a flash.

nordhagen
  • 799
  • 5
  • 18
  • An iframe still has it's own non-penetrable sandbox, even if the contents in it reside on the same domain as the page hosting it. You would still need some kind of proxy between them. Although Flash isn't the ideal solution it will work, especially since it is what you already have. Flash will even allow cross-domain communication as long as the the reciever of the request is hosting a cross-domain policy file that allows access from the requesting domain. – nordhagen Dec 06 '12 at 13:26