Hi everyone,
I am trying to create a photo slideshow using 15 buttons to load two ext texts from xml and I’m not having much luck. While the first text loads fine, it does not change with the button clicks. Could someone please show me what I’m not doing right with my coding and help me get back on track??? I’ve loaded a .rar file with everything in it if someone would be nice enough to help me with the coding errors. THX!
Here is my xml:
<?xml version=“1.0” encoding=“ISO-8859-1”?>
<texts>
<text1 caption=“Infinity” description=" Artist’s simple study of mirrored reflections and the vortexs they appear to create. One can
almost walk into another dimension of sight, sound and reality; or even into oblivion." />
<text2 caption=“The Waterfall of Hearts” description=“Inspired by a poem the artist has been trying to write for years.” />
<text3 caption=“The Nature of the Heart” description=" Artist’s concept of the human heart with its many strings and attachments all
tied together and emanating from the center. This is love." />
</texts>
here is my xml actionscript in the actions layer:
stop();
//place default artwork path here
myLoader.contentPath = “images/image1.jpg”;
var x:XML = new XML();
x.ignoreWhite = true;
var captions:Array = new Array();
var descriptions:Array = new Array();
var whichText:Number;
x.onLoad = function() {
var texts:Array = this.firstChild.childNodes;
for(i=0;i<texts.length;i++) {
captions.push(texts*.attributes.caption);
descriptions.push(texts*.attributes.description);
}
holder.loadMovie(texts[0]);
caption.text = captions[0];
description.text = descriptions[0];
whichText = 0;
}
x.load(“art.xml”);
//with previous and next buttons
previous.onRelease = function() {
if (whichText > 0){
whichText–;
holder.loadMovie(texts[whichText]);
caption.text = captions[whichText];
decription.text = descriptions[whichText];
}
}
next.onRelease = function() {
if (whichText < texts.length-1){
whichText++;
holder.loadMovie(texts[whichText]);
caption.text = captions[whichText];
decription.text = descriptions[whichText];
}
}
//place loader transition here
import mx.transitions.;
import mx.transitions.easing.;
TransitionManager.start(myLoader, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
TransitionManager.start(bg_mc, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
//place text fields load functions here
And here is the code for the first three buttons:
import mx.transitions.;
import mx.transitions.easing.;
//place button onRelease actions here
b1.onRelease = function() {
myLoader.contentPath = “images/image1.jpg”;
TransitionManager.start(myLoader, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
}
b2.onRelease = function (){
myLoader.contentPath = “images/image2.jpg”;
TransitionManager.start(myLoader, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
}
b3.onRelease = function (){
myLoader.contentPath = “images/image3.jpg”;
TransitionManager.start(myLoader, {type:Fade, direction:Transition.IN, duration:1, easing:None.easeNone});
}