# Changing image gallery from xml to php

**URL:** <https://forum.kirupa.com/t/changing-image-gallery-from-xml-to-php/196889>\
**Category:** Uncategorized\
**Created:** [August 11, 2006, 5:18pm UTC](https://forum.kirupa.com/t/changing-image-gallery-from-xml-to-php/196889 "2006-08-11T17:18:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![beegcheef](https://avatars.discourse-cdn.com/v4/letter/b/9fc29f/32.png) [@beegcheef](https://forum.kirupa.com/u/beegcheef)\
**Post date:** [August 11, 2006, 5:18pm UTC](https://forum.kirupa.com/t/changing-image-gallery-from-xml-to-php/196889/1 "2006-08-11T17:18:14Z")

</div>

Hi, im pretty new at flash but i wanted to change an existing gallery that calls an xml file to a gallery that calls a php file that gets variables from a database. i want to include in my actionscript a variable that flash can read and then adds it to the end of the php file i want to access. e.g. "/images.php?+(the variable). the variable could point to something like id=3 or something. is this possible? how can i do this??

here is my actionscript as it is:

spacing = 10;  
containerMC.\_alpha = 0;  
var pArray = new Array();  
var tArray = new Array();  
var cur = 0;  
MovieClip.prototype.loadPic = function(pic) {  
cur = pic;  
containerMC.\_alpha = 0;  
this.loadMovie(pArray[pic]);  
this.\_parent.onEnterFrame = function() {  
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();  
bar.\_visible = 1;  
per = Math.round((l/t)_100);  
if (t != 0 && Math.round(l/t) == 1 && containerMC.\_height != 0) {  
var w = containerMC.\_width+spacing, h = containerMC.\_height+spacing;  
border.resizeMe(w, h);  
bar.\_visible = 0;  
picinfo.info.text = tArray[pic];  
delete this.onEnterFrame;  
} else {  
bar.\_width = per;  
//gives the bar a max width 100  
picinfo.info.text = per+" % loaded";  
}  
};  
};  
MovieClip.prototype.resizeMe = function(w, h, pic) {  
var speed = 3;  
this.onEnterFrame = function() {  
this.\_width += (w-this.\_width)/speed;  
this.\_height += (h-this.\_height)/speed;  
nav.\_x = Math.round(this.\_x-this.\_width/2);  
nav.\_y = Math.round(this.\_y+this.\_height+spacing/2);  
//if you want the next and prev button on a solid place, skip next three lines  
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+spacing/2;  
containerMC.\_alpha = 100;  
delete this.onEnterFrame;  
}  
};  
};  
var gallery\_xml = new XML();  
gallery\_xml.ignoreWhite = true;  
gallery\_xml.onLoad = function(success) {  
if (success) {  
var gallery = this.firstChild;  
for (var i = 0; i\<gallery.childNodes.length; i++) {  
tArray.push(gallery.childNodes_.attributes.title);  
pArray.push(gallery.childNodes\*.attributes.source);  
}  
//loading first picture  
containerMC.loadPic(0);  
} else {  
title\_txt.text = “Error!”;  
}  
};  
gallery\_xml.load(“wig\_gallery.xml”);  
prevb.onRelease = function() {  
cur–;  
if (cur\<0) {  
containerMC.loadPic(pArray.length-1);  
} else {  
containerMC.loadPic(cur);  
}  
};  
nextb.onRelease = function() {  
cur++;  
if (cur\>pArray.length-1) {  
containerMC.loadPic(0);  
} else {  
containerMC.loadPic(cur);  
}  
};

thanks!
