PDA

View Full Version : Load swf with "FLVPlayback" from xml instead of jpg and load the next when finished


Christian H.C.
07-11-2008, 02:12 PM
Hi, I´m using a "photo gallary" and instead of loading jpg´s I´m trying to change it to load swf (with FLVPlayback inside), and I have no problem with the first swf, but the problem starts when I click on the next button (step 2, 3, 4, ...).
I could´nt find the problem, therefor I thought may be it better to post both AS and xml.
I am a beginner and I do need help and I really appreciate any help!!

//This is an XML for (data)
thumbs = new XML();
thumbs.ignoreWhite = true;
thumbs.load("data.xml");
// Scroll dimensions .XML
thumbs.onLoad = function() {
root = this.firstChild;
total = root.childNodes.length;
displayNum = Number(root.childNodes[0].attributes.displayNum);
separation = Number(root.childNodes[0].attributes.separation);
//scroll settings
w = 60;
h = 30;
mask._width = displayNum*(w+separation);
mask._height = h+20;
forward._x = mask._width+30;
forward._y = back._y=h/2;
mcs = [];
for (i=0; i<total; i++) {
mcs.push(i);
newThumb = thumbnailer.container.duplicateMovieClip("container"+i, i);
with (newThumb) {
_x = (w+separation)*i;
preloader._x = w/2;
preloader._y = h/2;
shape._width = w;
shape._height = h;
}
var image = root.childNodes[i].childNodes[0].firstChild.nodeValue;
var image1 = root.childNodes[0].childNodes[0].firstChild.nodeValue;
newThumb.image = root.childNodes[i].childNodes[0].firstChild.nodeValue;
newThumb.desc = root.childNodes[i].childNodes[1].firstChild.nodeValue;
newThumb.link = root.childNodes[i].childNodes[2].firstChild.nodeValue;
loadMovie(image1, _root.box.foto_effetto);
_root.box._xscale = _root.scala_x;
// scale to large
_root.box._yscale = _root.scala_y;
// scale to release where to change to load the movies
newThumb.onRelease();
newThumb.cont.loadMovie(image);
//courser of thumbs thumbs
newThumb.cont2.loadMovie(image);
//courser of thumbs and scales
newThumb.cont._xscale = 8.2;
// courser of enlarge
newThumb.cont._yscale = 12.2;
// scale of thumb and over all images
newThumb.cont2._xscale = newThumb.cont._xscale;
newThumb.cont2._yscale = newThumb.cont._yscale;
newThumb.onRelease = function() {
loadMovie(this.image, _root.box.foto_effetto);
// courser of images with clip effect
_root.box.play();
// action for the box
_root.box._xscale = _root.scala_x;
// scale to enlarge
_root.box._yscale = _root.scala_y;
// scale after release
};
if (descriptions) {
newThumb.onRollOver = function() {
alert.desc = this.desc;
alert._visible = true;
this._xscale = 100;
this._yscale = 110;
this._y = this._y-10;
this._x = this._x-2;
this.swapDepths(9);
};
newThumb.onRollOut = function() {
alert._visible = false;
this._xscale = 100;
this._yscale = 100;
this._y = this._y+10;
this._x = this._x+5;
};
}
}
-----------------------------------

And this is the XML: "data.xml"

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<thumb displayNum="6" separation="5">
<PATH>images/1445-0500-0001-D01.SWF</PATH>
<description>Step 1 Chain tightener Description 1445-0500-0001</description>
</thumb>
<thumb>
<image>images/1445-0500-0001-D02.swf</image>
<description>Step 2 Chain tightener Description 1445-0500-0001</description>
</thumb>
<thumb>
<image>images/1445-0500-0001-D03.swf</image>
<description>Step 3 Chain tightener Description 1445-0500-0001</description>
</thumb>
<thumb>
<image>images/1445-0500-0001-D04.swf</image>
<description>Step 4 Chain tightener Description 1445-0500-0001</description>
</thumb>
<thumb>
<image>images/1445-0500-0001-D05.swf</image>
<description>Step 5 Chain tightener Description 1445-0500-0001</description>
</thumb>
<thumb>
<image>images/1445-0500-0001-D06.swf</image>
<description>Step 6 Chain tightener Description 1445-0500-0001</description>
</thumb>
</images>