Hey everyone, This is a thread about a rather complex SWF operation (for me at least is it complex)
What is done: I have a main SWF file that loads some other SWF to be displayed in it and also loads 2 JPG's as the background of the buttons. There are three slides and three buttons in the main SWF, depending on what button you click the corresponding SWF is shown which automatically plays. I use AS1 in the main SWF file and the flash version is pretty old, if I'm correct it's like v6, but that should not matter at all. The SWF has recently worked on some other domain and I'm sure I'm missing some detail that denies the main SWF from loading the other SWFs etc or .php with the xml correctly (see next sentence for the .php file).
I also have a .php with XML in it so the main SWF can find the other three SWFs and the JPG and some other information like text, colors etc:

<?xml version="1.0" ?><dynamic_content> 
<item blurb="Text 1" content_timer="8000" cycle="true" 
 content_border_color="0x" content_bg_image="" tab_hl_color="0x000000" 
 tab_border_color="0x000000" tab_color="0x000000" tab_arrow_color="0xFFFFFF" 
 tab_text_color="0xFFFFFF"  
 tab_image="/template/images/file.jpg" 
 tab_highlight_color="0x" tab_highlight_text_color="0x" tab_highlight_image="" 
 content_url=""  
 content_source="/template/images/file.swf"  
 content_target="_self" ></item> 
 
<item blurb="Text 2" content_timer="5000" cycle="true"  
    content_border_color="0x" content_bg_image="" tab_hl_color="0xFFFFFF"      
tab_border_color="0xFFFFFF" tab_color="0xFFFFFF" tab_arrow_color="0xFFFFFF"  
    tab_text_color="0xFFFFFF" tab_image="/template/images/file.jpg"      
tab_highlight_color="0x" tab_highlight_text_color="0x" tab_highlight_image=""  
content_url="http://www.domain.com/"  
content_source="/template/images/file.swf" content_target="_self" ></item> 
 
<item blurb="Text 3" content_timer="5000" cycle="true" content_border_color="0x"  
content_bg_image="" tab_hl_color="0xFFFFFF" tab_border_color="0xFFFFFF"  
tab_color="0xFFFFFF" tab_arrow_color="0xFFFFFF" tab_text_color="0xFFFFFF"  
tab_image="/template/images/file.jpg" tab_highlight_color="0x"  
tab_highlight_text_color="0x" tab_highlight_image=""    
content_url="http://www.domain.com/page.html"  
content_source="/template/images/file.swf" content_target="_self"      
></item></dynamic_content>

When running it on a web server it doesn't work, but locally it works great. All links are checked and correct. In FF the status bar says 'Waiting for www.mydomain.com...' (when direct linking to the SWF file) When I right click on the SWF I have the usual menu displayed, I can for instance choose play but nothing happens. I guess the main SWF doesn't load the .php with the xml correctly when on the server?! even though I have PHP enabled etc and I can't understand why it's not working. I have crossdomain in place, but it's not necesary for this SWF as all files that are used are on the same domain.

So what is it I'm missing around here?

Dani AI

Generated

Short summary and prioritized checklist (adds to original report and the tips from and ):

  • The three usual causes when a SWF works locally but fails on the server are (1) the server is returning the wrong content (HTML/login page or malformed XML), (2) Flash security/cross‑domain or publish‑settings flags, and (3) server MIME/permission issues. ’s publish‑settings suggestion (local vs network playback) is an important first check. ()

  • Quick verification steps that often find the problem:

    1. Open the PHP/XML URL directly in a browser and view source — confirm it’s well‑formed XML, not an error page or HTML redirect.
    2. Inspect headers (for example with curl -I) and confirm the XML is sent as an XML content type; watch for stray whitespace or a UTF‑8 BOM before the XML declaration (this breaks Flash XML parsing). (stackoverflow.com)
    3. Open the JPG and SWF URLs directly to confirm 200 responses and correct MIME types on the server (SWF should be served as application/x-shockwave-flash). (gsp.com)
  • Security / embedding specifics to check:

    • If any assets live on a different subdomain (e.g. sub.domain.com vs www.domain.com), a reachable crossdomain.xml at the target domain root is required and must grant access correctly. Be conservative with policy rules (don’t leave it overly permissive in production). (adobe.com)
    • ’s point about embedding parameters is relevant: confirm the published HTML/object/embed parameters aren’t restricting access or scripting between the page and the SWF.
  • Debugging tips and longer‑term note:

    • Use the Flash debug player / mm.cfg logging to capture XML parse or security errors; that will show if Flash is loading the file but failing to parse it. (apache.googlesource.com)
    • Finally, remember Flash Player reached end‑of‑life on December 31, 2020 and modern browsers block or remove plugin support; for long‑term reliability consider migrating the widget away from Flash. ()

If the PHP/XML is valid, headers and MIME types are correct, and crossdomain/publish flags are set for network access, the SWF’s external loads should work when hosted.

Recommended Answers

All 2 Replies

The first thing I'd check are your publish settings.
It could be that you need to set your .fla up to use the network rather than the local filesystem. This is part of the security sandboxing for flash.
I think by default it is set to 'use local filesystem', which is probably why it works locally for you, but does not work on the server. Perhaps try changing that setting to 'use network' instead and then re-export your .swf uploading it to your server and testing it.

It's been a considerable while since I used the flash IDE, so I can't remember exactly where you need to go to get to the publish settings...I think it might be something like 'file->publish settings' from the menu, but I could be wrong!

Anyway, that would certainly be my first port of call, so give that a shot and let me know how you get on.
Cheers for now,
Jas.

Member Avatar for Member #334542

Also try with your html embed and object tags for the code

<param name="allowScriptAccess" value="always"/>

Change the value if it is "never" or something to "always"
if not added this tag add the parameter like above.

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.