Hi all,
I’m trying to accomplish something thats way out of my league, I am trying to make a multiple gallery of videos on my webpage. I have managed to create a multiple picture gallery which is working fine ( www.theoaps.co.uk click on galleries and then select one ). This gallery works fine and you select the gallery via scrolling thumbnails at the bottom.
But i now want to do the same with my videos page, can someone help me with the Action script as i am taking the Picture Action script and trying to change parts of it to work for te video.
Picture Action Script:
//----------Multiple Gallery----------//
spacing = 10;
containerMC._alpha = 0;
var pArray = new Array();
var tArray = new Array();
var iArray = new Array();
var sArray = new Array();
var cur;
MovieClip.prototype.loadPic = function(pic) {
clearInterval(id);
containerMC._alpha = 0;
this.loadMovie(pArray[pic]);
cur = pic;
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = 1;
per = Math.round((l/t)*100);
if (l == t && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
bar._visible = 0;
picinfo.info.text = tArray[pic];
GInfo_txt.text = iArray[pic];
GSpec_txt.text = sArray[pic];
delete this.onEnterFrame;
} else {
bar._width = per;
//gives the bar a max width 100
picinfo.info.html = true;
picinfo.info.htmlText = per+" % loaded";
}
};
};
MovieClip.prototype.resizeMe = function(w, h, pic) {
//trace(w);
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
prevb._x = Math.round(this._x-this._width/2)-35;
nextb._x = Math.round(this._x-this._width/2)+this._width+35;
nextb._y = prevb._y=this._y+this._height/30 ;
//picinfo._y = nextb._y-5;
//picinfo._x = border._x-picinfo._width/2;
if (Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1) {
this._width = w;
this._height = h;
containerMC._x = this._x-this._width/2+spacing/2;
containerMC._y = this._y-this._height/2+spacing/2;
containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
function galleryChoice(a) {
cur = 0;
pArray = new Array();
tArray = new Array();
iArray = new Array();
sArray = new Array();
var gallery_xml = new XML();
gallery_xml.ignoreWhite = true;
gallery_xml.onLoad = function(success) {
if (success) {
var gallery = this.firstChild.childNodes[a];
for (var i = 0; i<gallery.childNodes.length; i++) {
tArray.push(gallery.childNodes*.attributes.title);
pArray.push(gallery.childNodes*.attributes.source);
iArray.push(gallery.childNodes*.attributes.info);
sArray.push(gallery.childNodes*.attributes.spec);
}
//loading first picture
id = setInterval(containerMC, "loadPic", 100, 0);
} else {
title_txt.text = "Error!";
}
};
gallery_xml.load("multiple_gallery.xml");
}
prevb.onRelease = function() {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
GInfo_txt.text(iArray.length-1);
GSpec_txt.text(sArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
nextb.onRelease = function() {
cur++;
if (cur>pArray.length-1) {
containerMC.loadPic(0);
GInfo_txt.text(0);
GSpec_txt.text(0);
} else {
containerMC.loadPic(cur);
}
};
stop();
var butArray:Array = new Array("gal1_btn", "gal2_btn", "gal3_btn", "gal4_btn", "gal5_btn", "gal6_btn", "gal7_btn", "gal8_btn", "gal9_btn", "gal10_btn", "gal11_btn", "gal12_btn", "gal13_btn", "gal14_btn", "gal15_btn");
function galleryButtons():Void {
for (var i:Number = 0; i<butArray.length; i++) {
this.Galleries[butArray*].id = i;
this.Galleries[butArray*].onRelease = function():Void {
galleryChoice(this.id);
}
}
}
galleryButtons();
//----------Scrolling Galleries----------//
Galleries.onRollOver = panelOver;
function panelOver(){
this.onEnterFrame = scrollPanel;
delete this.onRollOver;
}
var b = stroke.getBounds(_root);
function scrollPanel(){
if(_root._xmouse<b.xMin || _root._xmouse>b.xMax || _root._ymouse<b.yMin || _root._ymouse>b.yMax){
this.onRollOver = panelOver;
delete this.onEnterFrame;
}
if(Galleries._x >= 60.4){
Galleries._x = 60.4;
}
if(Galleries._x <= -770.7){
Galleries._x = -770.7;
}
var xdist = _xmouse - 400;
Galleries._x += -xdist / 20;
}
Picture XML :
<?xml version="1.0" encoding="UTF-8"?>
<portfolio>
<gallery name="BF1942">
<image title="Battlefield 1942 ~ Screen 1 of 10" source="GScreens/BF1942/bf1942_4x3_001.jpg" info=" " spec=" " />
<image title="Battlefield 1942 ~ Screen 2 of 10" source="GScreens/BF1942/bf1942_4x3_002.jpg" info="Test2" />
<image title="Battlefield 1942 ~ Screen 3 of 10" source="GScreens/BF1942/bf1942_4x3_003.jpg" info="Test3" />
<image title="Battlefield 1942 ~ Screen 4 of 10" source="GScreens/BF1942/bf1942_4x3_004.jpg" info="Test4" />
<image title="Battlefield 1942 ~ Screen 5 of 10" source="GScreens/BF1942/bf1942_4x3_005.jpg" info="Test5" />
<image title="Battlefield 1942 ~ Screen 6 of 10" source="GScreens/BF1942/bf1942_4x3_006.jpg" info="Test6" />
<image title="Battlefield 1942 ~ Screen 7 of 10" source="GScreens/BF1942/bf1942_4x3_007.jpg" info="Test7" />
<image title="Battlefield 1942 ~ Screen 8 of 10" source="GScreens/BF1942/bf1942_4x3_008.jpg" info="Test8" />
<image title="Battlefield 1942 ~ Screen 9 of 10" source="GScreens/BF1942/bf1942_4x3_009.jpg" info="Test9" />
<image title="Battlefield 1942 ~ Screen 10 of 10" source="GScreens/BF1942/bf1942_4x3_010.jpg" info="Test10" />
</gallery>
<gallery name="BF2">
<image title="Battlefield 2 ~ Screen 1 of 10" source="GScreens/COD2/COD2_4x3_001.png" spec=" " info=" "/>
<image title="Battlefield 2 ~ Screen 2 of 10" source="GScreens/BF2/bf2142_5x4_002.jpg"/>
<image title="Battlefield 2 ~ Screen 3 of 10" source="GScreens/BF2/bf2142_5x4_003.jpg"/>
<image title="Battlefield 2 ~ Screen 4 of 10" source="GScreens/BF2/bf2142_5x4_004.jpg"/>
<image title="Battlefield 2 ~ Screen 5 of 10" source="GScreens/BF2/bf2142_5x4_005.jpg"/>
<image title="Battlefield 2 ~ Screen 6 of 10" source="GScreens/BF2/bf2142_5x4_006.jpg"/>
<image title="Battlefield 2 ~ Screen 7 of 10" source="GScreens/BF2/bf2142_5x4_007.jpg"/>
<image title="Battlefield 2 ~ Screen 8 of 10" source="GScreens/BF2/bf2142_5x4_008.jpg"/>
<image title="Battlefield 2 ~ Screen 9 of 10" source="GScreens/BF2/bf2142_5x4_009.jpg"/>
<image title="Battlefield 2 ~ Screen 10 of 10" source="GScreens/BF2/bf2142_5x4_010.jpg"/>
</gallery>
</portfolio>
I have played about and i can seem to get it to work, if somone would be so kind as to offer some advice so i can get this sorted.:beam:
Thanks
Dunkyb123