Post by Giraffe » Thu Dec 11, 2008 7:33 am

Hi

I am currently working on fashion boutique which will be based entirely on opencart but i stumbled into a bit strange problem.
I am runing wamp server on my second pc and i access it through ip adress.
I've constructed for myself xhtml + css layout of the webpage and currently I'm converting it step by step to be run by opencart.

Now when I wanted to place flash slideshow into opencart homepage no pictures are showing up.
But the slideshow works in my layout. And i've also noticed that flash object loads.
I'm suspecting it has something to do with paths in xml file but after 5 hours of changing and studying paths in it I simply lost any desire to carry on ...  am I missing something?  but what?

Ok so first info:

slideshow is well known over the net flash slideshow called slideshow_as2.swf with xml file simple but nice and does the job.

Flash parses information about paths and settings contained in .xml and then starts displaying pictures.

path to the template is:
shop/catalog/template/content/home.tpl

flash is saved in the same directory and images.xml file is saved there too.

images are stored in
'shop/catalog/template/content/img directory and named bg1.jpg to bg9.jpg.

in the home.tpl i've placed flash object declaration pointing to swf file with path:
'../slideshow.swf' (literaly)

now in the xml file i've placed first obvious path like
'../img/bg1.jpg' (literaly)

then I load the shop and i see black square so i right click on it and i see
that flash object loaded but no pictures

then i do it again but with a full path to the image like:
shop/catalog/template/content/img/bg1.jpg and so on but no luck...

what can be wrong ??? maybe xml file are very specific when it comes to paths or maybe it is some error in action script in slideshow?? personally i don;t now action script so it will be hard for me to look into this avenue any ideas?

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am

Post by Luvz2drv » Thu Dec 11, 2008 11:40 am

would help if you posted your embed code

Global Moderator

Posts

Joined
Fri Mar 21, 2008 10:58 am

Post by david.gilbert » Thu Dec 11, 2008 2:33 pm

I have made a dynamic XML based slideshow for opencart before that automatically displays the latest products and images, contact me via pm if you'd like some help to get it working :)

-Dave

Professional Website Services - http://www.davidmgilbert.com/


Active Member

Posts

Joined
Sun Jan 06, 2008 5:02 pm
Location - Mount Compass, South Australia

Post by JNeuhoff » Thu Dec 11, 2008 6:38 pm

Here is how I embedded my flash slide show for http://shop.glassfusion.com.au :

Code: Select all

<div class="objectheader" title="Advertisement">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
      codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
      width="400" height="100">
   <param name="movie" value="server/images/glassfusion.swf" />
   <param name="quality" value="high" />
   <!--[if !IE]>-->
   <object data="server/images/glassfusion.swf" type="application/x-shockwave-flash" 
         width="400" height="100">
      <param name="pluginurl" value="http://www.adobe.com/go/getflashplayer" />
      <param name="quality" value="high" />
   <!--<![endif]-->
      <div class="alternate">
        <a href="http://www.adobe.com/go/getflash" target="_new">
          <img title="Install Adobe Flash Player" alt="Install Adobe Flash Player" src="server/images/64px-Adobe_Flash_Player_CS3.png" style="float:right; margin:1em 1em 1em 1em;"/>
        </a>
        <p style="margin:2em 1em 1em 1em;">Install Adobe Flash Player to view content.</p>
      </div>
   <!--[if !IE]>-->
   </object>
   <!--<![endif]-->
</object>
</div>
The SWF file is loacted within the OpenCart directory at 'server/images/glassfusion.swf', that is, directory 'server' is located at the same level as 'catalog' or 'admin', all relative to OpenCart's base directory. I am not using the  element because that is not standard compliant.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Giraffe » Thu Dec 11, 2008 7:45 pm

Ok my current embed code for flash object

Code: Select all

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="600" height="210" id="slideshow" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="../slideshow.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#000000" />
<embed src="../slideshow.swf" quality="high" bgcolor="#000000" width="600" height="210" name="slideshow" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
but i think problem is with xml file that loads images and how i define paths to them code in xml is:

Code: Select all

<gallery timer="7" order="sequential" fadetime="3" looping="yes" xpos="0" ypos="0">
<image path="shop/catalog/template/default/content/img/bg2.jpg" />
<image path="shop/catalog/template/default/content/img/bg1.jpg" />
<image path="shop/catalog/template/default/content/img/bg3.jpg" />
<image path="shop/catalog/template/default/content/img/bg4.jpg" />
<image path="shop/catalog/template/default/content/img/bg5.jpg" />
<image path="shop/catalog/template/default/content/img/bg6.jpg" />
<image path="shop/catalog/template/default/content/img/bg7.jpg" />
<image path="shop/catalog/template/default/content/img/bg8.jpg" />
<image path="shop/catalog/template/default/content/img/bg9.jpg" />
</gallery>
I have this flash slideshow working but placed in normal html file in the root folder of server, but once i put it in the content catalog in home.tpl file its not working anymore...

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am

Post by Qphoria » Thu Dec 11, 2008 7:49 pm

first try it with absolute paths. That will at least prove that it works. Then worry about relative paths

Code: Select all

<gallery timer="7" order="sequential" fadetime="3" looping="yes" xpos="0" ypos="0">
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg2.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg1.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg3.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg4.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg5.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg6.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg7.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg8.jpg" />
<image path="[color=red]http://www.mysite.com/[/color]shop/catalog/template/default/content/img/bg9.jpg" />
</gallery>

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Giraffe » Thu Dec 11, 2008 8:07 pm

ok i've tried absolute paths like

http://192.168.0.1//shop/catalog/templa ... nt/bg2.jpg

but no luck.....

ok maybe action script will give us some answers:

Code: Select all

/****************************/
/* Crossfading slide show   */
/* Author: Todd Dominey     */
/* http://whatdoiknow.org   */
/* http://domineydesign.com */
/****************************/

// set random # variables - each must be 0 for first 'while' loop below
var randomNum = 0;
var randomNumLast = 0;

// parent container
var container_mc = this.createEmptyMovieClip("container",0);
// movie clip containers
container_mc.createEmptyMovieClip("loader1_mc",2);
container_mc.createEmptyMovieClip("loader2_mc",1);

// preload watcher
this.createEmptyMovieClip("watcher_mc",100);

// load xml
images_xml = new XML();
images_xml.ignoreWhite=true;
images_xml.onLoad = parse;
images_xml.load("images.xml");

function parse(success) {
	if (success) {
		imageArray = new Array();
		var root = this.firstChild;
		_global.numPause = Number(this.firstChild.attributes.timer * 1000);
		_global.order = this.firstChild.attributes.order;
		_global.looping = this.firstChild.attributes.looping;
		_global.fadetime = Number(this.firstChild.attributes.fadetime);
		_global.xpos = Number(this.firstChild.attributes.xpos);
		_global.ypos = Number(this.firstChild.attributes.ypos);
		var imageNode = root.lastChild;
		var s=0;
		while (imageNode.nodeName != null) {
			imageData = new Object;
			imageData.path = imageNode.attributes.path;
			imageArray=imageData;
			imageNode = imageNode.previousSibling;
			s++;
		}
		// place parent container
		container_mc._x = _global.xpos;
		container_mc._y = _global.ypos;
		// parse array
		imageArray.reverse();
		imageGen(imageArray);
	} else {
		trace('problem');
	}
}

// depth swapping
function swapPlace(clip,num) {
	eval(clip).swapDepths(eval("container_mc.loader"+num+"_mc"));
}

function loadImages(data,num) {
	if (i==undefined || i == 2) {
		i=2;
		createLoader(i,data,num);
		i=1;
	} else if (i==1) {
		createLoader(i,data,num);
		i=2;
	}
}
function createLoader(i,data,num) {
	thisLoader=eval("container_mc.loader"+i+"_mc");
	thisLoader._alpha=0;
	thisLoader.loadMovie(data[num].path);
	watcher_mc.onEnterFrame=function () {
		var picLoaded = thisLoader.getBytesLoaded();
		var picBytes = thisLoader.getBytesTotal();
		if (isNaN(picBytes) || picBytes < 4) {
			return;
		}
		if (picLoaded / picBytes >= 1) {
			swapPlace("container_mc.loader2_mc",1);
			alphaTween = new mx.transitions.Tween(thisLoader, "_alpha", mx.transitions.easing.Regular.easeOut,0,100,_global.fadetime,true);
			timerInterval = setInterval(imageGen,_global.numPause,data);
			delete this.onEnterFrame;
		}
	}
}
function imageGen(data) {
	// random, or sequential?
	if (_global.order=="random") {
		// choose random # between 0 and total number of images
		while (randomNum == randomNumLast) {
			randomNum = Math.floor(Math.random() * data.length);
			trace(randomNum);
		}
		loadImages(data,randomNum);
		randomNumLast = randomNum;
	} else if (_global.order=="sequential") {
		// start at 0, increment to total number of images, then drop back to zero when done
		if (p==undefined || p==data.length && _global.looping=="yes") { p=0; } else { break; }
		loadImages(data,p);
		p++;
	} else {
		trace ("order attribute in xml isn't correct - must specify either 'random' or 'sequential'");
	}
	clearInterval(timerInterval);
}
stop();

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am

Post by JNeuhoff » Thu Dec 11, 2008 8:07 pm

Code: Select all

<param name="movie" value="../slideshow.swf" />
I am not sure whether this is correct. Where exactly is your 'slideshow.swf' located?

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Giraffe » Thu Dec 11, 2008 8:18 pm

it is located in:
http://192.168.0.1/shop/catalog/templat ... deshow.swf
and ../is a relative path to it doesen't matter if I provide full path or relative one slideshow will load regardless the problem is it doesen't know where to load images from ...

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am

Post by Qphoria » Thu Dec 11, 2008 9:48 pm

Giraffe wrote: ok i've tried absolute paths like

http://192.168.0.1//shop/catalog/templa ... nt/bg2.jpg

but no luck.....
Maybe its a file path not a url path?
C:/xampp/htdocs/shop/catalog/template/default/content/bg2.jpg ?

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Giraffe » Thu Dec 11, 2008 11:27 pm

hmmm... so why it works in my html template? then slideshow and xml file are placed in a root folder and xml says:

Code: Select all

<gallery timer="7" order="sequential" fadetime="3" looping="yes" xpos="0" ypos="0">
<image path="img/slideshow/bg2.jpg" />
<image path="img/slideshow/bg1.jpg" />
<image path="img/slideshow/bg3.jpg" />
<image path="img/slideshow/bg4.jpg" />
<image path="img/slideshow/bg5.jpg" />
<image path="img/slideshow/bg6.jpg" />
<image path="img/slideshow/bg7.jpg" />
<image path="img/slideshow/bg8.jpg" />
<image path="img/slideshow/bg9.jpg" />
</gallery>

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am

Post by JNeuhoff » Fri Dec 12, 2008 12:08 am

I think it's all relative to either your OpenCart directory, or to your domain's root directory.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by Giraffe » Fri Dec 12, 2008 4:05 am

well i've ended up creating slideshow with picures imported inside without xml file
here is a link to a nice tutorial how to do it:

http://www.tutorial5.com/content/view/128/46/

Case closed

Giraffe :P

User avatar
New member

Posts

Joined
Tue Dec 09, 2008 4:40 am
Who is online

Users browsing this forum: No registered users and 0 guests