Jump to content

How to embed flash in html with php?


figo2476

Recommended Posts

Hi:

 

I have a flash photo gallery. What it does is to load external xml, which contains locations of images.

 

* It works well, when it is accessed via decent url e.g. http://domain/test/gallery/display.swf

so /test, /gallery are folders in the server

 

* But it is accessed via e.g. http://domain/controler/action (Model view controller pattern for example)

The flash appears, but it cannot display images and it seems it can't find the xml file.

 

I wonder do you guys have the same problem or is there any way to get around.

Link to comment
https://forums.phpfreaks.com/topic/110878-how-to-embed-flash-in-html-with-php/
Share on other sites

THree things to check.  all silly, but important.  First, make sure the images are uploaded.  It sounds retarded but it happens to me mor than I care to mention.  Make sure that you FLA script is pointed to a relative address, and not an external URL.  Flash has a security set up where it will not pull from other URLs for some reason.  You can create a proxy in PHP if this is the problem.  Lastly, if the XML file is local, then keep it in the same folder as the SWF.

Reply to JADASDesigner:

 

* Images are uploaded.

* XML file is at xml/images.xml and the swf file is next to xml/

The relative path inside the .swf is set to xml/images.xml to load images.

 

* Here is my guess:

When using relative path in flash, the swf will depend on the decent url, which user accesses. So flash can figure the actual path by adding the decent url + relative path. e.g. http://domain/test/gallery/display.swf

 

But if it is used in some php framework (e.g. phpcake), the relative path won't work, since it is wrong.

e.g. http://domain/controler/action/display.swf

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.