views:

34

answers:

1

I have this flash code - I need to add getURL(this.mainurl, "_self"); so that this.mainurl is a dynamic value from an XML file.

Can anybody maybe show me how to make the getURL value dynamic

myPhoto = new XML();

myPhoto.ignoreWhite = true;

myPhoto.onLoad = function(success) {

//portfolioTag = this.firstChild;

numimages = this.firstChild.childNodes.length;

spacing = 32;

for (i=0; i<numimages; i++) {

this.picHolder = this.firstChild.childNodes[i];

this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);

this.thumbHolder._x = i*spacing;

this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);

this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);

this.thumbHolder.mainurl = this.thumbHolder.attributes.mainurl;

this.thumbHolder.onRelease = function() {

 getURL(this.mainurl, "_self");

};

}

};

myPhoto.load("/flash/languages.xml");

XML FILE:

< image title="Found" mainurl="http://www.de." thmb="\flash\image2.jpg"/>

A: 

myPhoto = new XML(); myPhoto.ignoreWhite = true; myPhoto.onLoad = function(success) { //portfolioTag = this.firstChild; numimages = this.firstChild.childNodes.length; spacing = 35; for (i=0; ix = ispacing; this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0); this.thumbLoader.loadMovie(this.picHolder.attributes.thmb); this.thumbHolder.title = this.picHolder.attributes.title; this.thumbHolder.main = this.picHolder.attributes.main; this.thumbHolder.onRelease = function() { getURL(this.main, "_self"); loader.loadMovie(this.main); main_txt.text = this.main; }; } }; myPhoto.load("/flash/languages.xml");

Gerald Ferreira