Zen Cart Logo
Forums / General Questions / Embedding Flash with xml data

Embedding Flash with xml data

Locked

Views: 1,648

Results 1 to 20 of 20
This thread is locked. New replies are disabled.
7 Sep 2010, 1:17 PM
#1
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Embedding Flash with xml data

Hi

I am trying to place a flash mp3 player in a products page that runs off an xml file. I've uploaded the flash files, mp3 files and xml file to the server in includes/modules/custom/ - not sure if that's the best place but I've referenced that path in the HTML anyway so I think it should still work.

The flash player is appearing but it looks like it's failing to load the xml, which is in the same folder as the flash file and is referenced as such in the xml file.

I've used the flash embed code generated by Dreamweaver CS4 to embed the flash.

The page is here
http://www.radiationsun.co.uk/shop/another-test/fanfare

Please forgive the awful look, haven't got around to working on the appearance yet!

Thanks for any assistance / ideas

7 Sep 2010, 1:19 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

I'd be inclined to put the .xml file in the root of the site, not under the includes folder.

7 Sep 2010, 1:30 PM
#3
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Hi thanks I'll try that.

I think I've spotted a potential problem though - I'm trying to get the product page (which is the one in product_info_music) to include within the head tags the line:

<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>

I was doing this in the early hours of this morning and thought I'd done it, but in fact it is showing in the source code:

<script type="text/javascript" src="includes/modules/pages/product_music_info/jscript_flash.js"></script>

which is the file I placed the first snippet in if I was reading the instruction correctly, perhaps not.

So I'm not sure if this is actually working?

Thanks again

7 Sep 2010, 1:38 PM
#4
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

I'm not sure I expressed myself clearly above. What I'm trying to say is I'm expected the head to show:

<script src="Scripts/swfobject_modified.js" type="text/javascript"></script>

not an include for the file that contains this, that seems like it wouldn't work. I spent some time trying to figure out how to do this, maybe I was going in the wrong direction.

7 Sep 2010, 1:44 PM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

Rename includes/modules/pages/product_music_info/jscript_flash.js to .php instead of .js

7 Sep 2010, 2:24 PM
#6
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Hi

Thank you so much, that has helped. The flash player is now showing the playlist but not actually playing anything!

It's like one painful step at a time.

I've moved everything to the root folder but still not a peep out of it. I'm getting some functionality out of it.

Can't think what else could be the problem. Should I try different embedding code?

7 Sep 2010, 2:27 PM
#7
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Forgot to say, I've also removed this file from the server for the Media Manager module, in case it was causing a problem, but hasn't helped anything

includes/templates/YOUR_CUSTOM_TEMPLATE/templates/tpl_modules_media_manager.php

7 Sep 2010, 2:45 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

lol - so, the problem is no longer with getting the flash to run, but rather to get the flash to work as you had intended it to.

You've likely got it looking in the wrong path.
If you look at the apache server access logs or better yet, the error logs, they may tell you what files it's rejecting you for due to invalid paths, and that might give you a clue to what you need to change in your flash code.

7 Sep 2010, 2:52 PM
#9
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Yes, one problem then another. I have just thought however to test a regular html file with the flash embedded on the server and that doesn't work in just the same way so there evidently is a problem in the flash file even though it works locally!

Not immediately sure how to check the server logs, I'm embarrassed to say! I will find out.

thanks for the help

7 Sep 2010, 2:54 PM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

What's the file structure on your local site, and how does that differ from the live site? That may give you some clues.

7 Sep 2010, 3:45 PM
#11
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

The only difference is on the server the files are in the 'shop' folder with all the Zencart stuff, and locally they are in the root folder for the web site (was trying out 3 different applications for this site).

The only other difference is the additional php file to include the ref to the swfobject_modified.js, which I'm pretty sure that's OK now.

I've also just tried changing the file names to exclude spaces - not ideal as it shows them that way in the flash player.

I've looked at the logs, the only error now is for a gif file it's not finding that's apparently mentioned in the stylesheet. I can see the GET requests are being made for the songs in the playlist, if I click another song that also produces a GET request on the server.

I think there must be some sort of problem with the flash file, I'll try testing another flash object on the page.

7 Sep 2010, 3:59 PM
#12
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Exact folder structure:

mp3files (folder contains mp3s)
Scripts (folder contains flash js files)
swf file
xml file

7 Sep 2010, 4:10 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

JennieD:

I can see the GET requests are being made for the songs in the playlist, if I click another song that also produces a GET request on the server.
Are those GET requests successful? ie: do they return a 200-OK response? or a 404-not-found response?
Is the path mentioned in the log for those GET requests actually the correct path to the mp3 files?
What happens if you put that path in your browser (after the domain name of course) and try to open the mp3 that way?

7 Sep 2010, 4:52 PM
#14
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

This is example from log file

radiationsun.co.uk 212.159.59.73 - - [07/Sep/2010:17:46:59 +0100] "GET /shop/mp3_files/Spells.mp3 HTTP/1.1" 404 9433 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"

If I put that path into my browser the mp3 file plays in the default player.

7 Sep 2010, 5:02 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

JennieD:

The page is here
http://www.radiationsun.co.uk/shop/another-test/fanfare
So, that's saying that the store's files are under /shop/another-test/fanfare/
JennieD:

Exact folder structure:

mp3files (folder contains mp3s)
Scripts (folder contains flash js files)
swf file
xml file
And that's suggesting that the mp3s are under
/shop/another-test/fanfare/mp3files
JennieD:

This is example from log file

radiationsun.co.uk 212.159.59.73 - - [07/Sep/2010:17:46:59 +0100] "GET /shop/mp3_files/Spells.mp3 HTTP/1.1" 404 9433 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"
And that's saying that the test was to /shop/mp3_files/Spells.mp3

But those are all different:
/shop/another-test/fanfare/
/shop/another-test/fanfare/mp3files
/shop/mp3_files/Spells.mp3

7 Sep 2010, 5:04 PM
#16
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Embedding Flash with xml data

JennieD:

This is example from log file

radiationsun.co.uk 212.159.59.73 - - [07/Sep/2010:17:46:59 +0100] "GET /shop/mp3_files/Spells.mp3 HTTP/1.1" 404 9433 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8"

If I put that path into my browser the mp3 file plays in the default player.
The "404" in that log message means "404 Not Found", as in: no, that file did not play as a result of that particular request, because it could not be located at the path specified.

7 Sep 2010, 5:32 PM
#17
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Hi

I'm not sure I totally get this. The zencart main folder is the shop folder, it's just the product page that resides under the Url

http://www.radiationsun.co.uk/shop/another-test/fanfare

I've installed the CEON seo module which is why I've got that nice URL, but the main folder is the shop folder.

I agree it looks like the file is not being found, confirmed by this latest test:

http://www.radiationsun.co.uk/shop/test4.html

But I can't for the life of me see why - oh I wonder if it has something to do with the CEON module rewriting urls....

I'll just check this out...

7 Sep 2010, 6:22 PM
#18
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

OK, have uploaded the same set of files to another server, and it works fine. I'm pretty sure now this has to do with the CEON module as it's definitely server specific and that's pretty much the only thing I've added, but my brains are totally addled and I'm going to have dinner before I try and work it out.

The working example is here:

http://www.jenniedawson.co.uk/radiation/test.html

I can't think why I didn't think of this before as I already had to exclude the media folder from the rewrite. Hopefully I'll be able to put the necessary files in the media folder to fix it.

Thanks for all the help.. will let you know if it works.

7 Sep 2010, 7:00 PM
#19
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Just to confirm that was the problem!

I've put all the mp3 / flash / xml files inside the media folder, which has been specifically excluded from the rewrites, and it is finally working.

Thanks for all the support and help, I certainly learned a few things here.

http://www.radiationsun.co.uk/shop/another-test/fanfare

Cheers

7 Sep 2010, 7:17 PM
#20
jennied avatar

jennied

New Zenner

Join Date:
Sep 2010
Posts:
17
Plugin Contributions:
0

Re: Embedding Flash with xml data

Spoke too soon, starts playing the first track but can't move to the others... I give up for the moment.