I’m just trying to load ONE image with xml- a title, description and image.
Can’t figure out what I’m doing wrong- no picture ever shows (though title & desc work).
I put the title, description text fields and picture movie clip in containerMC.
Any help is GREATLY appreciated. I highlighted relevant code in blue to help. : )
cut.xml:[INDENT]<daTextBox>
<daTitle><p class=“title”>COLOR</p></daTitle>
<daContent><p class=“content”>The less color a diamond has, the more valuable it is. Diamonds are graded on a scale from D (colorless) to Z (light yellow).</p></daContent>
<daPic>graphics/cut.gif"</daPic>
</daTextBox>
[/INDENT]actionscript:[INDENT]stop();
//set styles//
_global.style.setStyle(“themeColor”, 0x2E67B2);
//init TextArea component
daClip.containerMC.daContent.html = true;
daClip.containerMC.daContent.wordWrap = true;
daClip.containerMC.daContent.multiline = true;
daClip.containerMC.daContent.label.condenseWhite=true;
//load in XML
daTextBoxContent = new XML();
daTextBoxContent.ignoreWhite = true;
daTextBoxContent.load(“cut.xml”);
daTextBoxContent.onLoad = function(success)
{
if(success)
{
[COLOR=Blue]daXMLTitle = this.firstChild.childNodes[0].childNodes;
daXMLContent = this.firstChild.childNodes[1].childNodes;
daXMLPic = this.firstChild.childNodes[2].childNodes; [/COLOR]
//load css
var format = new TextField.StyleSheet();
var path = “flash.css”;
format.load(path);
format.onLoad = function(success) {
if (success) {
//set the style sheets
daClip.containerMC.daContent.styleSheet = format;
daClip.containerMC.daTitle.styleSheet = format;
[COLOR=Blue] //assign the appropriate text and image[/COLOR]
[COLOR=Blue]daClip.containerMC.daContent.text = daXMLContent;
daClip.containerMC.daTitle.text = daXMLTitle;
daClip.containerMC.daPic.image = daXMLPic;[/COLOR]
} else {
daClip.containerMC.daContent.text = "Error loading CSS file!";
}
};
}
}
//end styles//
//tell btn to do present data with text and then go to another area//
//when first friend btn is pressed go to email frame//
friend.onPress = function () {
gotoAndStop(“email”);
emailForm.gotoAndPlay(“showBox”);
}
[/INDENT]