Forum Moderators: open
Here is part of xml file:
<?xml version="1.0"?>
- <slideShow>
- <image>
<path>/winter/assets/gallery/1.jpg</path>
<caption>December 29, 2006: Getting ready to Chair.</caption>
</image>
- <image>
<path>/winter/assets/gallery/2.jpg</path>
<caption>February 8, 2006: Snowboard at Sun Peaks photo: Adam Benton</caption>
</image>
- <image>
<path>/winter/assets/gallery/3.jpg</path>
<caption>March 9, 2006: Telemark turns on Bushwacker. Photo: Corey Wilson</caption>
</image>
... ... ... ...
</slideShow>
Here is html code of gallery:
<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase', 'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0', 'width', '767', 'height', '550', 'id', 'Gallery', 'align', 'middle', 'src', 'gallery/Gallery?xmlPath=gallery/xml.aspx', 'quality', 'high', 'wmode', 'opaque', 'bgcolor', '#ffffff', 'name', 'Gallery', 'allowscriptaccess', 'sameDomain', 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'movie', 'gallery/Gallery?xmlPath=gallery/xml.aspx' ); //end AC code
</script><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="gallery/Gallery.swf?xmlPath=gallery/xml.aspx" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="gallery/Gallery.swf?xmlPath=gallery/xml.aspx" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>
<!-- end gallery code -->
[edited by: jatar_k at 4:03 pm (utc) on Sep. 21, 2007]
[edit reason] fixed sidescroll [/edit]
The answer is in XSLT [w3schools.com].
I can't make the time right now to go through your specific code, but this is exactly what XSLT was designed to do.
<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','767','height','550','id','Gallery','align','middle','src',
'Gallery?xmlPath=gallery.xml','quality','high','wmode','opaque','bgcolor','#ffffff','name',
'Gallery','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Gallery?xmlPath=gallery.xml' ); //end AC code
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Gallery.swf?xmlPath=gallery.xml" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="Gallery.swf?xmlPath=gallery.xml" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>
<!-- end gallery code -->
Maybe "AC_FL_RunContent" not work on non-aspx servers?
[edited by: tedster at 3:21 pm (utc) on Oct. 2, 2007]
[edit reason] fix side-scroll [/edit]
I added an include statement <script src="AC_RunActiveContent.js" type="text/javascript"></script> and tested page offline (all files on desktop) - it works fine.
But not work on web server. I suspect, that its may be connected with the path to files: should be absolute, or relative path used?
<BODY>
<script src="AC_RunActiveContent.js" type="text/javascript"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<!-- begin flash gallery -->
<tr>
</tr></table>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','767','height','550','id','Gallery','align','middle','src',
'Gallery?xmlPath=gallery.xml','quality','high','wmode','opaque','bgcolor','#ffffff','name',
'Gallery','allowscriptaccess','sameDomain','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','Gallery?xmlPath=gallery.xml' ); //end AC code
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="767" height="550" id="Gallery" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="Gallery.swf?xmlPath=gallery.xml" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="wmode" value="opaque" />
<embed src="Gallery.swf?xmlPath=gallery.xml" quality="high" wmode="opaque" bgcolor="#ffffff" width="767" height="550" name="Gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object></noscript>
</tr>
<!-- end gallery code -->
</BODY>
-----
<?xml version="1.0"?>
<slideShow>
<image>
<path>picture1.jpg</path>
<caption>Picture 1</caption>
</image>
<image>
<path>picture2.jpg</path>
<caption>Picture 2</caption>
</image>
... ...
</slideShow>
[edited by: tedster at 3:20 pm (utc) on Oct. 2, 2007]
[edit reason] fix side scroll [/edit]
curious... since it works fine on the desktop, but not when run on a server... you might be dealing with a domain-crippled SWF.
I've used the technique myself to prevent others from stealing my SWFs and using them on other sites. In frame 1 of the SWF, I'd put in a little actionscript that looks for the "domain" - this is an environment variable in Actionscript - and if it is anything other than "localhost" or "example.com", the SWF would promptly stop everything.
To find out if this is the problem, you'll have to crack open the SWF with a decompiler.
But that's just a guess. "not work on web server" is not sufficient for anyone to help you debug - could you explain in greater detail what you see? are there error messages or output?