Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Why won't Flash using XML file load images?

Why won't Flash using XML file load images?

Locked

Views: 17,722

Results 1 to 20 of 31
This thread is locked. New replies are disabled.
1 Mar 2008, 9:31 AM
#1
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Why won't Flash using XML file load images?

If I can get flash swf to display, why can't I get images called from an XML file to load?

Location - path ?

Dimensions ?

Suggestions? Explanations?

:wacko::blink::blush::no::shocking::dontgetit:cry:

thanks

1 Mar 2008, 9:39 AM
#2
drbyte avatar

drbyte

Sensei

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

Re: Why won't Flash using XML file load images?

You most likely haven't set the correct path for the images.
I believe flash generally treats the image path as relative to the folder where your swf is located.

1 Mar 2008, 9:52 AM
#3
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

thanks Doc, that's what I thought too - I put copies of the images in several locations hoping it would find it. not so.

My fear was you were going to say that ZenCart won't allow Flash swf to use the XML file to id the images and location. Not solved and have been trying a variety of Flash samples using different XML approaches. :(

Your help appreciated. Just wish I could figure this out.

1 Mar 2008, 6:06 PM
#4
drbyte avatar

drbyte

Sensei

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

Re: Why won't Flash using XML file load images?

Have you tried turning on some alert() debugging in your flash object to have it tell you what it's looking for and what it's finding?

What's the URL?

2 Mar 2008, 3:52 AM
#5
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

thanks Dr. -

url: www.elephantrealestate.com

the location will be obvious - there is a big gaping hole where the flash movie should be...:laugh: what is weird is that buttons display but not the background for the swf.

I can't figure out how to set debugging from the .fla or .swf ... I'm not that adept, I just used some free templates floating around.

I have had other flash working - just not with the XML.

I put the images in many different places.

I changed permissions for the folders and files.

The swf does work using Flash reader. (I thought maybe it was image dimensions but since it works with different sized images I don't think that is it)

The mystery (and misery) continues.

Is using XML for image calls compatible with ZenCart?

THANKS!!

2 Mar 2008, 4:32 AM
#6
drbyte avatar

drbyte

Sensei

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

Re: Why won't Flash using XML file load images?

wasana:

Is using XML for image calls compatible with ZenCart?
Zen Cart doesn't care what you're doing inside your flash object to display images. Doing that is strictly up to you and your HTML which launches the flash object.

Launching your flash object directly seems to work:
http://www.elephantrealestate.com/flash/dynamic_gallery.swf

So, something might be wrong with the way your JS is launching it.
Or maybe the way you're specifying the xml file is wrong, or your path to it is too specific or not specific enough, etc.
I suspect it's not finding the xml file correctly, or it's getting confused by whatever image paths you have in your xml file, vs their relativity to your site root vs the location of your flash script.

2 Mar 2008, 5:41 AM
#7
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

I'm still new at PHP, but I think due to the way it works your root for loadVariables() would come out different then when using straight html. I do know there is better ways to work with php and mysql then xml.

Looking at the script within your swf loader, 'loadVariables(this.image,_root.box.foto_effetto)'

the swf, xml, images would all need to be in the same place as the root of your page. No subfolders. Best to find a better written flash for use with php and one that makes use of Mysql database.

LoadVariables() is one way flash can interact with the web page. Google 'loadvariables php' for more info on using it with php.

One thought, maybe setting it up the same as a image may get the path right. Place it in \includes\languages\english\YOUR_TEMP\other_images_name.php and use the php code in the path to the swf! Not sure if that would work.

2 Mar 2008, 9:11 AM
#8
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

thanks DaveWest, however what you are talking about is beyond me. I do agree that flash using php to pull images from mysql (a flash movie of featured or special products for example) would be very popular. Whoever issues a sample with step by step instructions for we novices will be voted Zencartian of the year.

To check the path reference I have put copies of the images that are referred to by the XML file in just about every place I can think of.

I inserted the script reference in a non-php index page and the swf displayed but not the images (with image copies placed all over) so I'm not sure it is an XML in a php world problem.

Hoping someone might spot the js script error ... :blush:

In my zencart the following method is getting a variety of swf to work but not if they use XML for images.

on my main page I have a reference to a jscript in templates that calls a swf in another location

in my define_main_page.php I inserted:

<script src="http://www.elephantrealestate.com/includes/templates/ElephantRealEstate/jscript/ERE_flash_intro.js"></script>

in my ...jscript/ERE_flash_intro.js I have:

// JavaScript Document
document.write('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"');
document.write('WIDTH="500" HEIGHT="250" id="dynamic_gallery.swf" ALIGN="">');
document.write('<PARAM NAME=movie VALUE="I think it has something to do with the js./dynamic_gallery.swf"> <PARAM NAME=loop VALUE=true> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#798767> <EMBED src="http://www.elephantrealestate.com/flash/dynamic_gallery.swf" loop=true menu=false quality=high bgcolor=#798767 WIDTH="500" HEIGHT="250" NAME="dynamic_gallery.swf" ALIGN=""');
document.write('TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>');
document.write('</OBJECT>');

http://www.elephantrealestate.com/flash folder I have
a folder for the images
the images not in the folder (and images in the zencart images folder, the template images folder, the www.ele...com directory)
the swf file
the xml file

the xml file is simply the following:

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <images> <thumb displayNum="6" separation="5"> <image>A27x.JPG</image> <description>LAND</description> </thumb> <thumb> <image>A50x.JPG</image> <description>A50</description> </thumb> <thumb> <image>B018x.jpg</image> <description>B18</description> </thumb> <thumb> <image>B19x.JPG</image> <description>Tartaruga</description> </thumb> <thumb> <image>foto5.jpg</image> <description>Bosco</description> </thumb> <thumb> <image>/foto6.jpg</image> <description>Spot Cocacola</description> </thumb> <thumb> <image>/foto7.jpg</image> <description>Alessandra Ambrosio</description> </thumb> </images>

I played with changing the image path adding and subtracting but without luck

So.... could there be something wrong with the javascript ? classid or version?

should I change the reference and move the swf, xml and image file to templates or somewhere else like up one level?

THANK YOU for any assistance

2 Mar 2008, 8:18 PM
#9
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

I hope to have some time here to work on integrating more flash into my site. When I do, I may set up a mod to upload.

For now, your problem turned out to be simple to solve. I had to set up a quick image loader to test with php to see where things needed to be. I found that everything but the xml file could be in one folder. So if you have a folder name 'flash' with the .swf in it, and a subfolder for your images.. 'flash/photos/' then place the xml file at the root of your site 'public_html' it should work.

Change the link to the swf file in your object tag to 'flash/dynamic_gallery.swf'
Change the link to your images in your xml file to 'flash/photos/B018x.jpg'

You could just insert the object tag without using script in your define_main_page.php page. I use script in my other site to offer something different for folks that don't have script turned on by adding the noscript tag.

As a side note.. I also found that if I set the location to the flash folder in the movie code, I didn't need the xml file to be at the root level. It could stay with the swf file. If you have access to the fla file, change 'dati.xml' to 'flash/dati.xml' so it can be placed in the flash folder.

3 Mar 2008, 12:05 AM
#10
wasana avatar

wasana

Zen Follower

Join Date:
Apr 2006
Location:
Chiang Mai
Posts:
203
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

I humbly thank you. Will do the changes in the next day or two. Seems so simple when explained like that...

One of the downfalls of the scrolling sideboxes (jscript not flash) for featured or specials was that they loaded all the images - making for slow loading. Another obvious place for a flash slide show would be the main product image.

Looking forward to what you might come up with. thanks again.

:smartalec:

3 Mar 2008, 7:04 AM
#11
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Why won't Flash using XML file load images?

downfalls of the scrolling sideboxes (jscript not flash) for featured or specials was that they loaded all the images
Note in ZenCart 1.3.8/1.3.8a.. you can set, via admin, how many products to show in side boxes for new/featured/special.

EDIT:
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=775
For my own info, tested my scrolling featured sidebox, (url above)with 1.3.8.a, and set via admin, how many products to scroll..works fine..not tested other scrolling boxes for whats new/specials as yet..

3 Mar 2008, 3:37 PM
#12
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

One of the downfalls of the scrolling sideboxes (jscript not flash) for featured or specials was that they loaded all the images

Anytime you use images you run into this problem. I've spent hours sizing images to get the fastest load and the most effects I can. I been programing my flash and refining it to get the smallest size file I can. To make sure I was giving you the right info, I uploaded my test file to my front page. The size of the file is 33kb. Larger then I like to try for, and I didn't do a load delay yet.

The swf works with xml in the flash folder and gets the images from my images/product folder. So it's just a programing issues, setting flash up to work with php.

17 Dec 2008, 2:22 AM
#13
rweeks avatar

rweeks

New Zenner

Join Date:
Jul 2008
Location:
San Diego, CA
Posts:
45
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

I am having the same issue.
I have added flash code to the product template. When I bring up the product, the flash loads, but the music clips do not play. So seems like the xml does not load.
When I run the .swf file on its own (outside of zen-cart) but from the same folder, it works fine.

The .swf, .xml and .mp3 files are all in the same folder.

Working locally, so don't have an example to show.

Any insight or advice would be appreciated.

17 Dec 2008, 4:12 AM
#14
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

rweeks:

I am having the same issue.
I have added flash code to the product template. When I bring up the product, the flash loads, but the music clips do not play. So seems like the xml does not load.
When I run the .swf file on its own (outside of zen-cart) but from the same folder, it works fine.

The .swf, .xml and .mp3 files are all in the same folder.

Working locally, so don't have an example to show.

Any insight or advice would be appreciated.

Same as with others... the xml and swf file need to be called in the same folder, but due to the nature of how php builds web pages, the action script call to load the xml can't located it.

If your the coder of the loader swf, you need to point myLoadData.load ('myData.xml'); in the right direction... This looks for myData.xml at the root of your site when used in php, but is the normal way of doing it for html pages. For php, the addressing needs to be where you plan on having both xml and swf located. myLoadData.load("includes/templates/MYTEMPLATE/flash/myData.xml');

17 Dec 2008, 6:13 PM
#15
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

you need to point myLoadData.load ('myData.xml'); in the right direction...This is what happens when you don't use xml loads... Sorry but I was wrong with the action script. With myLoadData.load ('myData.xml'); as is, it does need to be in the same folder as the swf. In the xml file, you need to write the courrect patchways to your file.

So say I have a gallory.swf and a Photos.xml all are in a folder at 'mysite.com/flash/' the Photos.xml would load images from my product folder.

The xml file would look like this;

<?xml version="1.0" encoding="UTF-8"?>
<Slides>
  <slideNode jpegURL="images/products/item22.jpg" jpegWidth="120" jpegHeight="77"></slideNode>
  <slideNode jpegURL="images/products/item23.jpg" jpegWidth="116" jpegHeight="120"></slideNode>
</Slides>
```Gallory.swf was a quick test I did last night and what I learned from it.
16 Mar 2009, 1:08 AM
#16
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

Hey guys,

After reading this thread about 10 times and a couple of others, i am seeking your help.
I have a Flash header made by someone else (no .fla available) and i got 5 elements, using a xml file to call for the images displayed in the animation:

  1. the swf file, "galleriasmall.swf"
  2. the xml file listing my images, "fotos.xml"
  3. the images folder, "images"
  4. an html file, "galleria.html"
  5. and a php file, "lettore.php"

If i understand how things were done, lettore.php and fotos.xml have the same purpose : look for the images to place into the swf...
I have been told to have all 5 elements in the same location, so all are in /damien/images/flash (damien being MY_TEMPLATE)

I had a previous very simple Flash header that worked just fine. I used the technic from Seethrou So i know the code in tpl_header worked for that 1st one.

Obviously my php coding skill are still close to none. PHP to me stands for "Pure Headhache Period" :D but i'm trying...
I still can't figure why the background of the new animation show but nothing else.

I tried to move the 4 elements to the root. Still not working...

I'm lost... HELP !!!

I still got those files in both locations. the code in tpl_header points to the swf in the root.
You can get access to our site here.

Thanks,

Damien

16 Mar 2009, 6:24 AM
#17
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

DamienDLSkinSolution:

Hey guys,

After reading this thread about 10 times and a couple of others, i am seeking your help.
I have a Flash header made by someone else (no .fla available) and i got 5 elements, using a xml file to call for the images displayed in the animation:

  1. the swf file, "galleriasmall.swf"
  2. the xml file listing my images, "fotos.xml"
  3. the images folder, "images"
  4. an html file, "galleria.html"
  5. and a php file, "lettore.php"

If i understand how things were done, lettore.php and fotos.xml have the same purpose : look for the images to place into the swf...
I have been told to have all 5 elements in the same location, so all are in /damien/images/flash (damien being MY_TEMPLATE)

I had a previous very simple Flash header that worked just fine. I used the technic from Seethrou So i know the code in tpl_header worked for that 1st one.

First you need to do some clean up.. open your includes/configure.php file and look for this line and remove the ending '/'

 define('HTTP_SERVER', 'http://looloos-skincare.com/');
 define('HTTPS_SERVER', 'https://looloos-skincare.com/');
```Having that '/' there is cussing a double // in your addressing.

Next, you should upgrade swfobject to 2.0 or 2.1, the code you're using would work on 1.0 which had problems working with other scripts. Once you do that, change the name of swfobject.js to jscript_swfobject.js and place it in includes/templates/damien/jscript folder and you can delete the script call in tpl_header.  swfobject will auto load that way.  Then replace the call to your swf as below.. 
<script type="text/javascript">swfobject.embedSWF("flash/galleriasmall.swf", "myContent", "800", "250", "7.0.0");</script> <div id="myContent"><p>Alternative content</p></div> ```I like having a flash folder at the root of the site to keep things clean, place "galleriasmall.swf" and "fotos.xml" within that folder also have your image folder there. I'm assuming the html and php files are demo's of how to use the swf... If galleriasmall.swf is hard coded to load fotos.xml, then it should work, if not, then you'll need to post the flash object code from the html file for us to figure out the rest.

SwfObject can be found here.. code.google.com/p/swfobject/

20 Mar 2009, 1:20 AM
#18
damiendlskinsolution avatar

damiendlskinsolution

Zen Follower

Join Date:
Sep 2008
Posts:
97
Plugin Contributions:
0

Re: Why won't Flash using XML file load images?

Dave,

Thank you soooo much for taking the time to look at my problem.

I followed your instructions and the swf loads... but not the images.
So here is the content of the html file :

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>galleriasmall</title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
</head>
<body bgcolor="#666666">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '800',
			'height', '250',
			'src', 'galleriasmall',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'window',
			'devicefont', 'false',
			'id', 'galleriasmall',
			'bgcolor', '#666666',
			'name', 'galleriasmall',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'galleriasmall',
			'salign', ''
			); //end AC code
	}
</script>
<noscript>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="800" height="250" id="galleriasmall" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="galleriasmall.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#666666" />	<embed src="galleriasmall.swf" quality="high" bgcolor="#666666" width="800" height="250" name="galleriasmall" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
</noscript>
</body>
</html>

and here is the content of the php file :

<?

$dir = "images";

echo "<?xml version='1.0' encoding='UTF-8'?>\n";
echo "<galeria>\n";

if (is_dir($dir)) {
	if ($d = opendir($dir)){
	
		while (($file = readdir($d))!== false){
			if (filetype($dir.'/'.$file) == 'file'){
				echo "	<fotos gde=\"images/{$file}\"/>\n";
				//$vars .= "fotos gde=".$file;
				//echo $vars;
			}		
		}
		closedir($d);
	}
}
echo "</galeria>\n";



?>

I hope that will help... :blush:
Once again thank you very much for your help.

Damien

22 Mar 2009, 3:52 AM
#19
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: Why won't Flash using XML file load images?

Sorry Damien, got me stumped on this one. Looks like you could hard code the script into tpl_header, just not sure what the php file is doing.

Flash 4 and above can do anything javascript could do. Just not sure why this gallery would require so much outside scripting. Also I don't see the normal calls for loading the xml list, so I'm assuming that's what all the extra scripting is doing. :wacko:

22 Mar 2009, 6:05 AM
#20
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: Why won't Flash using XML file load images?

Try placing xml file and swf file etc in zencart root folder...