Please excuse & move topic - If posted in the wrong category. This my 1st post
on this forum.
Hello All,
I'm currently hacking together code snippets I've found and have edited
together to make
an "Events Calendar" for a bar/pub/night club. I have an xml document which
has the
[event] [date] [time] [image] for a band performance. Everything works just
fine EXCEPT
the "mx.controls.Loader" doesn't want to load the image.
PLEASE let me know what's going on here and where my mistake is located. If
you need
more info please let me know. THANK YOU!
Best Regards,
-Tom Long
////////// MY ACTIONSCRIPT ///////////
/// THANKS FOR HELPING --- PLEASE find the areas commented like ///////// HELP
HERE PLEASE ///////
var TheBand: mx.controls.Loader;
/* COMMENTED OUT FOR DEBUGGING
var my_pbar: mx.controls.ProgressBar;
my_pbar._visible = false;
my_pbar.indeterminate = true;
my_pbar.setSize(160, 30);
my_pbar.source = my_picLDR;
my_pbar.mode = "polled";
var pbarListener:Object = new Object();
pbatListener.complete = function(evt:Object) { evt.target._visible = false; };
my_pbar.addEventListener("complete", pbListener);
*/
////////////////////////////////////////////////////////////////////////////////
//////
this.page_content = new Array();
this.myXML = new XML();
this.myXML.ignoreWhite = true;
this.myXML.load("content.xml");
_root.pageMove = function(loc) { _global.pagesY = loc; trace("location:
"+loc); }
_root.pictMove = function(pos) { _global.pictsY = pos; trace("position:
"+pos); }
this.onEnterFrame = function() {
startY = GetProperty(_root.cards,_y)+23.7; //MAGIC NUMBER!?!?
beginY = GetProperty(_root.picts,_y)+400; //MAGIC NUMBER!?!?
vertNumber = pagesY-startY;
vertValue = pictsY-beginY;
setProperty (_root.cards, _y, startY+(vertNumber/6)); //DIVIDED BY MAGIC
NUMBER!?!?
setProperty (_root.picts, _y, beginY+(vertValue/2)); //DIVIDED BY MAGIC
NUMBER!?!?
}
this.myXML.onLoad = function(success) {
if (success) {
trace("XML Loaded!");
_global.allNodes = this.firstChild.childNodes; // SETTING UP VAR FOR XML
trace("Total Pages: " + allNodes.length);
j = 0;
eListOffSet = 18; //SET THE NEXT EVENT LIST X px DOWN
eInfoOffSet =245; //SET THE NEXT EVENT INFO X px DOWN
ePictOffSet = 80; //SET THE NEXT EVENT PICT X px DOWN
while (j<allNodes.length) {
duplicateMovieClip(_root.pages["page"], "page"+j, j);
duplicateMovieClip(_root.cards["card"], "card"+j, j);
duplicateMovieClip(_root.picts["pict"], "pict"+j, j);
setProperty(_root.pages["page"+j], _y, (j+1)*eListOffSet);//+1 because of
the orginal page
setProperty(_root.cards["card"+j], _y, j*eInfoOffSet);//the orginal
empty CARD auto deletes
setProperty(_root.picts["pict"+j], _y, (j+1)*ePictOffSet);//+1 for the
orginal pict
//SETTING VALUES FOR THE ROLLOVER & RELEASE EVENTS - NOTE:CODE LOCATED IN
MC PAGES.PAGE
_root.pages["page"+j].move2pos = -j*ePictOffSet;
_root.pages["page"+j].move2loc = -j*eInfoOffSet;
//PULL OUT ALL THE NODES NAMED "page" & THEIR ATTRIBUTES
if (allNodes[j].nodeName == "page") {
_root.pages["page"+j].eTitle.html = true;
_root.pages["page"+j].eTitle = allNodes[j].attributes.title;
_root.pages["page"+j].eDate = allNodes[j].attributes.date;
_root.pages["page"+j].eTime = allNodes[j].attributes.time;
//_root.pages["page"+j].ePict = allNodes[j].attributes.pict; // I don't
think I'm using this anymore
///////////////////////////////////////////// HELP HERE PLEASE
//////////////////////////////////////////
_root.cards["card"+j].TheBand.load(allNode[j].attributes.src);
}
j++;
}
//PULL OUT THE SUB NODES
for (i=0; i<allNodes.length; i++) { page_content[i] =
allNodes[i].childNodes; }
for (k=0; k<page_content.length; k++) {
for (l=0; l<page_content[k].length; l++) {
_root.cards[l].card.contentBox.html = true;
if (page_content[k][l].nodeName == "eventInfo") {
_root.cards["card"+[k]].contentBox.html = true;
_root.cards["card"+[k]].contentBox = page_content[k][l];
////////////////////////////
HELP HERE MAYBE /////////////////////////////
/// I also tried putting the image attribute in a child node of the
"page" node /////
_root.cards["card"+[k]].TheBand.load(attributes.src);
}
}
}
}
else { trace("XML didn't load."); }
}
//////////////////////////////////////////////// MY XML
///////////////////////////////////
/// NOTE: I tried putting the attribute "SRC" in <page> and I tried again
inside the child node <eventInfo> ////
/// But I haven't gotten either to work ////
<content>
<page id="_1" date="Oct 3rd" time=" 9:10" title="The Rolling Stones"
src="DCP_0730.jpg">
<eventInfo src="DCP_0730.jpg">It's Only Rock-N-Roll But I like
It!</eventInfo>
<pic>hello world</pic>
</page>
<page id="_2" date="Oct 4th" time=" 9:20" title="Cody Chesnutt"
src="DCP_0731.jpg">
<eventInfo src="DCP_0731.jpg">And If <a href="http://www.dogsters.com"
target="_new">Mary Drops a Baby Girl Tonight</a>, I'll name her
Rock-N-Roll.</eventInfo>
</page>
<page id="_3" date="Oct 5th" time=" 9:30" title="The Roots"
src="DCP_0732.jpg">
<eventInfo src="DCP_0732.jpg">She got knocked up 0 months ago!</eventInfo>
</page>
<page id="_4" date="Oct 6th" time=" 9:40" title="The Who"
src="DCP_0733.jpg">
<eventInfo src="DCP_0732.jpg">She got knocked up 1 months ago!</eventInfo>
</page>
</content>