flash xml question

lisar - December 7, 2006 - 13:07

Hi, I have a flash with xml that I want to put on my front page. I've put the call to flash in and it's pulling up the flash when I look at the site, but it's not taking the xml data to get the specific images (it's a slide show). I've been reading but I can't tell if something special has to be done when it's xml. I have a data.xml file that is in the same directory as my images and my flash that calls the images. So I think everything is fine on that end. But is there a something in the drupal end of things I need to do?

Thanks,
Lisa

I've put the call to flash

Chill35 - December 7, 2006 - 13:18

I've put the call to flash in and it's pulling up the flash when I look at the site.

Hello Lisa. What do you mean by "putting the call to Flash in" and "it's pulling up the Flash" ?

How did you embed the Flash object ?

When you do Source View of the web page, do you see anything unusual about the way your Flash object is "embedded" on the page ? Is it part of a story, page or part of a block (on the front page) ?

Are you using LoadVar in your SWF file ?

Caroline

stumbling along

lisar - December 7, 2006 - 13:23

This is what I've put in the content of the front_page.

object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="485" height="332" title="flash">
        <param name="movie" value="files/flash/slide2.swf" />
        <param name="quality" value="high" />
        <embed src="files/flash/slide2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="485" height="332"></embed>

      </object>

The file loads correctly if I go to to the flash file url directly rather than through the main front page. As to the loadVAR in the swf file, I'm not sure. I had someone do the flash for me. But as I said, it works if I look at the .swf file directly on the server, just not through the front page. I'm not sure if that makes a lot of sense. I only know enough to make myself dangerous, learning as I go;)

Thanks,
Lisa

How is the xml specified - I

alexmc - December 7, 2006 - 13:28

How is the xml specified - I cant see it in the object code above.

What is the URL it fetches?

Please try the following,

Chill35 - December 7, 2006 - 13:45

Please try the following, instead :

*** all that I have done is adding a parameter that is "allowscriptaccess" and set it to "always" ****
in both embed and object

object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="485" height="332" title="flash">
<param name="movie" value="files/flash/slide2.swf" />
<param name="quality" value="high" />
<param name="allowscriptaccess" value="always" />
<embed src="files/flash/slide2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="485" height="332" allowscriptaccess="always"></embed>
</object>

Can you break down the

alexmc - December 7, 2006 - 13:23

Can you break down the problem? Can you fetch the xml file with a browser? what does your error log say? access log?

This is what I've put in the

Chill35 - December 7, 2006 - 13:35

This is what I've put in the content of the front_page.

When you do a View Source of the front page in the browser and look at the HTML do you see that markup you just posted ?

Caroline

yes

lisar - December 7, 2006 - 13:42

I actually just copied and pasted it into here for it.

more info

lisar - December 7, 2006 - 13:38

I don't really understand all that stuff to be honest. But I'll try and break it down. I can't post the url because it's in a password protected area, so I'll just use generic ones.

If I go to www.mydomain.com/files/flash/slider2.swf
the flash looks as it should, it loads the images from data.xml and it works correctly, slide show, etc.

the data.xml file is this;

<?xml version="1.0" encoding="iso-8859-1"?>
<Slider duration="5">
<item image="files/flash/slide1.jpg" ><![CDATA[http://www.mydomain.com/join/]]></item>
<item image="files/flash/slide-show2.jpg" ><![CDATA[http://www.mydomain.com/connect/]]></item>
<item image="files/flash/track-slide-3.jpg" ><![CDATA[http://www.mydomain.com/track/]]></item>
</Slider>

if I go to www.mydomain.com the flash is in the content of the front page, ie. in the admin/settings/front_page, I put the html code as you saw above that embedded the flash. This loads up the slider2.swf but it's "empty" in that it shows my slider buttons and transition item,but not the images, that the data.xml file refers to. The flash and other text copy is inside a table. I just put all that code in the front_page section in admin.

No error in any of the logs is showing. Hopefully that helps. I really appreciate all the responses:)

Look above for a suggestion

Chill35 - December 7, 2006 - 13:49

Look above for a suggestion I have made. Please try that.

The problem comes from the Flash object being embedded.

didn't work:(

lisar - December 7, 2006 - 13:56

here's the source code to verify that I put in the right thing:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="485" height="332" title="flash">

<param name="movie" value="files/flash/slide2.swf" />
<param name="quality" value="high" />
<param name="allowscriptaccess" value="always" />
<embed src="files/flash/slide2.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="485" height="332" allowscriptaccess="always"></embed>
</object>

still the same. Is there another way to put in the flash without embedding?

If that doesn't work....

Chill35 - December 7, 2006 - 14:00

Your friend is probably using code like this in the Flash file :

var xmlVal:XML = new XML();
xmlVal.load(“data.xml”);

Try reducing the size

Chill35 - December 7, 2006 - 14:06

Try reducing the size parameters :

width="485" height="332"

I have had no Flash showing when the html block in which it was inserted was too small. I know you're getting the Flash but no pictures loaded by it.

[edit] sorry, asking a question already answered

Caroline

front_page module

lisar - December 7, 2006 - 14:07

I just copied and pasted the html in the body area in the front_page module, at admin/settings/front_page. You don't create a separate page, it's just all done in there with that module.

I just copied and pasted the

Chill35 - December 7, 2006 - 14:13

I just copied and pasted the html in the body area in the front_page module, at admin/settings/front_page. You don't create a separate page, it's just all done in there with that module.

Ho boy. You are using a contributed module called front_page ? I don't have that installed.

I don't unserstand how you

Chill35 - December 7, 2006 - 14:09

I don't unserstand how you can put Flash on an admin page

There is no such page for me, by the way :

http://localhost/drupal-4.7.4/?q=admin/settings/front-page

front page module

lisar - December 7, 2006 - 14:13

you have to have the front page module installed to see that option.

I have the .fla file

lisar - December 7, 2006 - 14:11

where would I look for that? I've done some flash so I know my way around in there a bit. And if I do find it is like that,what should it be?

Thanks,
Lisa

in reference to

lisar - December 7, 2006 - 14:23

the code you mentioned above in the .fla file;

var xmlVal:XML = new XML();
xmlVal.load(“data.xml”);

Sorry Lisa, I am very tired

Chill35 - December 7, 2006 - 14:30

Sorry Lisa, there's most probably nothing wrong with the code in the FLA file.

There's something about the way it's embedded...

Have you tried viewing the same page in Firefox ?

In IE... now, a Flash swf movie will not play unless we click on it. Unless it's embedded through JavaScript or something crazy like that.

Try viewing the page in Firefox.

Lisa

Chill35 - December 7, 2006 - 14:49

Then...

Have you tried embedding your Flash on an html page (not Drupal) on the remote server, with all files (pictures, xml file, swf) in the same directory, using the code above, to see if it works.

Flash embedded -vs- Flash not embedded is a different story.

For example, when you play the .swf file directly :

http://my.web.site/files/flash/flash.swf

... the browser will use the latest Flash plug-in for it. Whereas when you embed you specify which Flash player to use...

In your code, you ask for a Flash Player #version=7,0,19,0....

worked on non drupal page

lisar - December 7, 2006 - 15:37

I installed it in a non drupal area and it worked. So it's definitely related to being embedded in drupal. I tried changing the version, etc.too and that made no difference. It's got to be something with the embedding.

So I guess what that comes down to. Is there another way to get flash in my page that uses xml?

L

swfobject

Roger López - December 7, 2006 - 16:51

use the swfobject.module. it uses swfobject.js to embed your swf using javascript, which gets around the IE object activation stuff. We use it every time we embed flash, and the majority of these make some kind of xml call.

rz

Chill35 - December 7, 2006 - 18:41

rz

Do you think there's a way though to use both front-page and SWFObject modules at the same time ?

Lisa, if you use SWFObject, you will need to download a file from an external web site (other than this one) and unzip it and copy a javascript file in your Drupal folder, in the /sites/default/modules/swfobject/js/ folder.

Then you can "place" that block which will contain your Flash object in the "content" area, and give it a light "weight" so that it stays on top (the block).

Then you can control on which page that block will be shown. You can select <front> for Front (or Home) page.

As far as I know, with SWFObject you can only put SWFObject in a block, which is great actually, then place that block anywhere on the page.

frustrated

lisar - December 7, 2006 - 19:27

I can embed regular .swf file no problem. It's the xml part that is not working within drupal. So I installed this module and it's doing the same thing. The flash slide show without the xml called images shows. And with this method as a block, I can't see how to put it in context with the rest of my copy on my front page. Although I'm sure there's a way to call the block within the page content. But still overall, it didn't solve my problem.

I put the javascript up on the server, installed the swfobject module.
I put code in my page for the front_page;

<script type="text/javascript" src="modules/swfobject/js/swfobject.js"></script>

<div id="files/flash/slide2.swf">
</div>

<script type="text/javascript">
   var so = new SWFObject("/files/flash/slide2.swf", "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", "485", "332", "7", "#ffffff");
   so.addVariable("files/flash/data.xml");
   so.write("flashcontent");
</script>

which brought up nothing, not even the space for the flash, like nothing was even put there.

Then I tried it by creating a block and the same thing happened as what was happening originally, the .swf file shows without the images from the xml file.

At my wit's end and I need to complete this, maybe I'll have to post on the drupal developer's needed page. Unless someone who reads this says, "oh I know why that's happening":(

Thanks for everyone's help today:)

block

lisar - December 7, 2006 - 19:33

if I look at the block it created;

<div class="block block-swfobject" id="block-swfobject-1">
<div class="block-title"></div>
<div class="block-content"><div id='swfobject-container-1'><a href="http://www.macromedia.com/go/getflashplayer">Get Flash Player</a></div>
<script type='text/javascript'>
var swfobject1 = new SWFObject("files/flash/slide2.swf","clsid:D27CDB6E-AE6D-11cf-96B8-444553540000","485","332","7","#FFFFFF");
swfobject1.write('swfobject-container-1');
</script>

is there a way to have it call the xml file or is the swf supposed to do that automatically?

Automatically, it seems.

Chill35 - December 7, 2006 - 19:51

Automatically, it seems. Since when you embed it on non-Drupal pages, it works.

Lisa check at the beginning of the source file (View Source)...

Is the html linking correctly to the swfobject.js file ?

Lisa

Chill35 - December 7, 2006 - 19:37

You need to send a variable to Flash in order for it to know which xml file to load ?

so.addVariable("files/flash/data.xml");

When there's a Javascript error, the script usually halts. Check your Javascript console in the browser.

Why chose "7" for the Flash Player ? Shouldn't it be "8" ?

I don't understand how your HTML needs to send the info about the xml file while the way you embed your Flash object on other non-Drupal pages, or run it on its own, you don't give Flash that "info" and it all works...??!!

Follow me ? :)

Lisa

Chill35 - December 7, 2006 - 19:47

Lisa, when you run the Flash SWF file on its own, i.e.

http://............long path ....../hello.swf

It works RIGHT ?

----

Now here are 2 things to try :

FIRST, use this code as example (Satay method)

change width, height, path... and forget swfObject for now.

<object type="application/x-shockwave-flash" data="..../..../movie.swf" width="550" height="400">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="..../..../movie.swf" />
</object>

NO EMBED TAG!!

The way the html page is parsed may cause problems with embed.

still didn't work

lisar - December 7, 2006 - 21:06

I really appreciate all the help you've been Chill, I wish it had worked:(

Yes, the file works on it's own with the long path. ie. http://www.mydomain.com/files/flash/slide2.swf

I tried the above code and it's the same thing, it doesn't show the xml images, just the "empty" swf file.

Lisa

Chill35 - December 7, 2006 - 21:25

Lisa, I believe you should report this as a bug. If it turns out it's not a bug with Drupal, than that bug can be closed.

It might be difficult to reproduce that bug... maybe using a lighter version than your own slideshow ?

I'd be happy to be able to reproduce the bug on my end.

I just tested the Flash ExternalInterface class using Drupal's swfObject module. That worked, but it's another ball game, it's about the Flash movie talking to the HTML page, calling Javascript functions defined on the web page, or built-in-core Javascript functions. That part works really well.

I wish I could help you more. And maybe I will be able to.

Caroline

I tried the above code and

Chill35 - December 7, 2006 - 21:29

I tried the above code and it's the same thing, it doesn't show the xml images, just the "empty" swf file.

Is it possible that your browser and modem just did not have the time to upload the pictures OR the child swf movie, if one is the container of another.... ? Nahhh, forget it. You're probably saying : I waited 5 minutes or more... LOL...

Caroline

email

lisar - December 8, 2006 - 00:11

Hi Caroline,
I sent you an email through your contact link. Hopefully it's a valid email:)

Thanks,
Lisa

crossdomain.xml

bcswebstudio - December 30, 2006 - 05:17

Shot in the dark: my xml load woes have been solved in the past by including a file "crossdomain.xml" in the same dir as the swf (or is it site root?..) containing something like:

  <?xml version="1.0" ?>
  <!DOCTYPE cross-domain-policy (View Source for full doctype...)>
  <cross-domain-policy>
  <allow-access-from domain="*" secure="true" />
  </cross-domain-policy>

You'd want to read up on it on macrodobe's site of course..
--
..happiness is point and click..

yup that solved my

duntuk - January 19, 2007 - 04:35

yup that solved my problem...

read about it here:
http://www.jeroenwijering.com/?item=Embedding_Flash

probably

dman - December 30, 2006 - 05:48

I've encountered the same problem once before.
Solved it pretty quickly once I saw the 404 it was creating.

It seems that some flash/slideshow/XML files go looking for their XML source RELATIVE to where the swf was (they don't use absolute URLs - which is basically correct)

However, if the flash is embedded in a page THAT IS NOT IN THE SAME DIRECTORY PATH as the swf, the relative calculations are made relative to the browser page URL, and not to the swf source.

So.
SWF file /files/flash/slideshow.swf viewed on its own invokes ./file.xml and retrieves the neighbouring /files/flash/file.xml
OK

BUT
Page /node/17 embeds /files/flash/slideshow.swf which invokes ./file.xml and therefore tries to retrieve /node/file.xml - relative to the current URL, not the Flash URL.

You'll see the failed request for /node/file.xml in your logs.

I worked around it with mod_rewrite, as I didn't have access to the fla.

Up to you to figure how you want to fix it. Either make the XML path more absolute, or place your xml files where they get looked for, or catch all requests for the xml file and rewrite them to the real path.

It's not directly Drupal, it's a side-effect of using virtual URL resolution rather than static pages. Also should be able to be fixed within Flash (a directive resolve links relative to the swf, not the wrapper page) but I dunno how that's done.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

Whoo Hoo

Chill35 - December 30, 2006 - 08:07

Sooo... we're faced with the same tedious challenge when inserting Flash objects in nodes or pages as we are when inserting inline images by hand, more or less... As you say, it is a "it's a side-effect of using virtual URL resolution rather than static pages".

You'll see the failed request for /node/file.xml in your logs.

So the problem arises when clean URLs is enabled. We get paths as if we are accessing different pages in different directories. Of course, there is no such thing as a /node subfolder in your Drupal folder : the url query has been changed to deliver the user with a "clean" URL. So...Something like http://www.mySite.com/index.php?q=node/6 is changed to
http://www.mySite.com/node/6 in the browser's address bar.

I worked around it with mod_rewrite, as I didn't have access to the fla.

What rewrite rule did you use exactly ?
It would be very useful of you to share !! There's a a similar problem with images : when inserting them "by hand" we can't use relative paths to index.php when clean URL is turned on : the path the browser is using to access the image file then turns into http://www.mySite.com/node/6/files/myImage.jpg... and the browser can't find the file so the link is broken.

Either make the XML path more absolute, or place your xml files where they get looked for, or catch all requests for the xml file and rewrite them to the real path.

Placing the xml files where they get looked for probably won't work... unless creating directories just for that purpose, such as : node/6

How do you catch all requests for a specific sub-directory, say "files", and rewrite these requests in .htaccess ?

Please share!!!!

You've got it

dman - December 30, 2006 - 08:32

There's always a pull between absolute and relative links. I like relative (more portable) but root-absolute just works better for most situations.

This problem became more pronounced in Drupal when between 4.6 and 4.7 we dropped the HTML BASE. A good thing, but requires double-think in some cases.

I work around it when I can by rewriting (in the code) to up-and-over (albeit long) URLs when I can.

The mod_rewrite was an unpleasant special case hack. Sorry I don't have access to the actual rule this week. It was actually to support flash that dynamically loaded other flash files, and a legacy setup where all flash was in /flash so I just caught all (*.swf) and returned /flash/$1 (IIRC)

Yes, you can't use relative paths when clean URLs and aliases are happening. Even node/edit/n paths give different results than node/n , creating broken images in one or the other case. The work-around is to begin the URLs with a /
Still not optimal for me, but it can be made to work,

I'd like to paste the rule, but I'm on holiday at the moment...

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

dman

Chill35 - December 30, 2006 - 10:27

Even node/edit/n paths give different results than node/n , creating broken images in one or the other case.

You've got that right.

The thing is I have used paths starting with /, but I test locally and remotely, and move my web sites around, and occasionally have installations in subdirectories, I certainly don't want to have to change the absolute paths in my node content, one by one. I am the only one, as admin now, that inserts images "by hand" — without using a contributed module to do so, that's what I mean — hence I use "php code" as my Input "filter". I use drupal's function base_path() to construct my web site root-relative path.

The reasons why I don't want to use a contributed module myself, or a WYSIWYG interface, are many : the WYSIWYG interfaces are buggy (tinyMCE is, anyway, in MSIE), and I know my HTML and CSS and want to have absolute control as to where and how to place my Flash content and images in my nodes...

The work-around is to begin the URLs with a /. Still not optimal for me, but it can be made to work.

For the reason I mention above, that does not work for me...

The mod_rewrite was an unpleasant special case hack.

I don't mind so much that it can be ugly. I am concerned however that it may add a little "delay" (minimal, mind you, but they all add up) in rewriting requests... and also I am having a hard time understanding regular expressions. I think though that for someone who knows a bit, it might not be so hard to figure out a rewrite rule. That's why I am asking.

Basically the rewrite rule must do the following :

  1. Check for the string "files" in the path
  2. Chop whatever comes before it
  3. Keep the rest

Something like that. Instead of catching all files ending with .swf...

Hence whatever is in /files (actual, real directory) and subfolders of /files will be accessible with a relative path, say <img src="files/pictures/IloveDrupal.gif" alt="Drupal rocks anyways" />.

Take your time! I'll remind you in a couple of weeks :)

Have great hollidays, i.e. the rest of them...

Happy new year!

Caroline

same problem, any updates?

treepour - January 18, 2007 - 04:13

Having exactly the same problem. Any updates on how mod_rewrite hack (or any other advice/suggestions)?

same problem, any updates? Please!

sbarsky - November 10, 2007 - 18:36

I'm also having the same problem and very interested in the mod_rewrite solution.

Same problem, a little more complex

AntoineSolutions - November 20, 2007 - 02:16

I am having the same issue. I am currently trying to use the free dfGallery on dezinerfolio.com to show a slideshow in my first node. The flash slideshow filename is gallery.swf and it calls gallery.xml which has two paths in the xml file, one for thumbnails and one for full size images.

My first problem was it couldn't find the xml file. I reviewed the logs and found that it was trying to find the xml file at /node/gallery.xml. I therefore wrote the following rewrite rule to catch all calls to /node/gallery.xml and rewrite the request as /gallery.xml. Please see rewrite rule below.

rewriteRule ^/node/gallery.xml$ /gallery.xml

This worked. It allowed the swf file to find the xml file but, the images still aren't loading. The problem is now I am seeing two instances in my access file of /node/undefined. I believe these are the references in the xml file to the thumbnail and full size image folders.

I don't have access to the fla file so I'm not sure this can be fixed but if anyone has any clue as to how I can correct this issue, please let me know. One clue might be that it was working fine until I turned on the CleanURLs module. This seems to be screwing things up.

Thanks in advance,

Jon Antoine
Owner
Antoine Solutions

Helps when you look at the manual

AntoineSolutions - November 21, 2007 - 02:03

I assumed the provided xml file was trying to pull images from a folder rather than a url like yahoo, photobucket, etc. After reading through the documentation and xml file thoroughly, i found this wasn't the case.

Jon Antoine
Owner
Antoine Solutions

flashnode tries to reference files from drupal root...

plutado - December 28, 2007 - 21:21

I'm going to try and write a mod_rewrite solution as well. For now, I've managed to get swf + xml working by using the flashnode module. I simply dropped the xml files that my swf file was attempting to reference into the drupal root directory. This means that my swf file was uploaded (by default) into the ./files folder - but the xml files are located on the same folder "level" as the files.

Having said that, I don't think it's true that drupal is looking for xml files @ node/file.xml. Rather, it's looking for your xml folder in your drupal root [the top] directory.

Hope this helps.

sometimes, yes

dman - December 29, 2007 - 07:42

With clean URLs off, you will indeed see it looking in the root.
Or if the Flash encoded blob pointed to the resource with a leading slash.
But if the link was rel, and clean URLs are on, You'll see where it was requested from in your access logs

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

i had the same problem and

alexpeterson - July 1, 2008 - 13:22

i had the same problem and spent 4 hours trying to solve it in various ways. The solution is simple. I moved the XML file to the root. That's all. Didn't edit any paths. And it worked. Hope this helps.

tracking

brf123 - September 3, 2008 - 23:39

tracking

solution using BASE parameter

geraldito - October 4, 2008 - 11:23

I detected the same problem described here. Using Firefox's LiveHTTPHeaders showed an 404 error for XML files that were not found at /node/test.xml (with clean URLs on). The easiest solution for me was to use the Flash BASE parameter with one of the following options:
- in the object tag: <param name="base" value="/drupal6/sites/default/files/flashexample/" />
- in the embed tag: base="/drupal6/sites/default/files/flashexample/"
- with SWFObject: so.addParam("base", "/drupal6/sites/default/files/flashexample/");
- using Flashnode: set base parameter in "Advanced flash node options"

It's nice to know that Flash

dman - October 4, 2008 - 11:38

It's nice to know that Flash now supports a BASE concept - to make up for the confusion in between versions.
Good solution.

BASE

Chill35 - October 4, 2008 - 15:07

Cool!

Caroline
11 heavens.com

 
 

Drupal is a registered trademark of Dries Buytaert.