Problem Reading XML - Help!
I"m having issues defining values in my AS from the XML. For some reason my AS won't read my XML File. See below. Am I missing anything?
I've been going through this for hours and can't figure out what I'm missing.
AS:
Code:
var newsWidth=300;//news tricker width;
var newsHeight=335;//news tricker height;
var itemspace=15;//between two item space.
var speed=40;//slide speed.
system.useCodepage=true;
Stage.scaleMode = "noscale";
// -- draw rectangle
MovieClip.prototype.drawrect = function(pos_x, pos_y, w, h) {
// --
this.px = pos_x;
this.py = pos_y;
this.an = w;
this.al = h;
// --
with (this) {
beginFill(0x000000, 30);
moveTo(px, py);
lineTo(px+an, py);
lineTo(px+an, py+al);
lineTo(px, py+al);
lineTo(px, py);
endFill();
}
};
// -- format text
myFormat = new TextFormat();
myFormat.font = "verdana";
myFormat.size = 20;
myFormat.color = 0x000000;
// xml parsing.
xmlParse = function (xmlObj) {
this = xmlObj;
var xpos = 0;
var ypos =0;
for (var i = 0; i<this.firstChild.childNodes.length; i++) {
item = newsTicker_mc.attachMovie("Ticker_mc", "Ticker"+i, 100+i);
//item.mytext.embedFonts = true;
item.main.mytext.autoSize = true;
item.main.mytext.text = this.firstChild.childNodes[i].attributes.mytext;
item.mylink = this.firstChild.childNodes[i].attributes.links;
item.main.mytext.setTextFormat(myFormat);
item._x = xpos;
item._y = ypos;
ypos += item.main.mytext.textHeight+itemspace;
// --
item.onRelease = function() {
this.main.mytext.textColor = 0x000000;
// -- open the link
getURL(this.mylink, target="_blank");
};
// --
item.onRollOver = function() {
this.news.mytext.textColor = 0x000000;
// --clear interval
clearInterval(idInterval);
};
// --
item.onRollOut=item.onReleaseOutside = function() {
this.main.mytext.textColor = 0x000000;
// -- re setInterval,go on move
idInterval = setInterval(scrollit, speed, this._parent);
};
}
};
// --load xml
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(succes) {
if (succes) {
xmlParse(this);
} else {
trace("Error al cargar datos");
}
};
myXML.load("http://tabletrac/tv/text/L.xml");
// --define scroll
scrollit = function (myclip) {
myclip._y -= 1;
updateAfterEvent();
// -- hitTest
if (!myclip.hitTest(maskTicker)) {
myclip._y = maskTicker._y+maskTicker._height+50;
}
};
// -- create mask
this.createEmptyMovieClip("maskTicker", this.getNextHighestDepth());
this.maskTicker.drawrect(newsTicker_mc._x, newsTicker_mc._y, newsWidth, newsHeight);
newsTicker_mc.setMask(this.maskTicker);
// -- setInterval
idInterval = setInterval(scrollit, speed, newsTicker_mc);
XML:
Code:
<main>
<news>
<new links="" mytext="Welcome to 7 Clans Casino | Thief River Falls"/>
<new links="" mytext=" "/>
<new links="" mytext="...................................."/>
<new links="" mytext="Our friendly Player Club Staff are here to guarantee that you experience the best of Northern Minnesota's celebrated hospitality each time you visit us. "/>
<new links="" mytext="Don't forget to sign-up for our Players Club! Jackpot will be starting at 4:00pm"/>
<new links="" mytext=" "/>
<new links="" mytext="...................................."/>
<new links="" mytext="Check out the pool"/>
<new links="" mytext=" "/>
<new links="" mytext="...................................."/>
<new links="" mytext="Lunch and Dinner Buffets starting at $11.95"/>
<new links="" mytext=" "/>
<new links="" mytext="...................................."/>
</news>-->
</main>
Quick question about adding description in xml and flash
Hello I have a flash xml photo gallery that was previously made. I love everything about it but i would like to be able to have descriptions of the pictures once they are clicked. I know this isnt very hard i am just not very famililar with xml or flash. I know in xml i can just add something like <desc>THIS IS MY DESCRIPTION</desc> in the already created xml however I am not sure how to create the container or whatever so it will display in flash.
The site that I am working on is
http://www.wpc-consulting.com/~stxmi...=photo_gallery
The gallery works great like i said i am just interested in getting some descriptions.
xml looks like this
Code:
<?xml version="1.0" encoding="utf-8"?>
<images>
<image>
<url>pics/img_1.png</url>
<big_url>big_pics/img_1.png</big_url>
</image>
<image>
<url>pics/img_2.png</url>
<big_url>big_pics/img_2.png</big_url>
</image>
<image>
<url>pics/img_3.png</url>
<big_url>big_pics/img_3.png</big_url>
</image>
<image>
<url>pics/img_4.png</url>
<big_url>big_pics/img_4.png</big_url>
</image>
<image>
<url>pics/img_5.png</url>
<big_url>big_pics/img_5.png</big_url>
</image>
<image>
<url>pics/img_6.png</url>
<big_url>big_pics/img_6.png</big_url>
</image>
<image>
<url>pics/img_7.png</url>
<big_url>big_pics/img_7.png</big_url>
</image>
<image>
<url>pics/img_8.png</url>
<big_url>big_pics/img_8.png</big_url>
<desc>View of Seattle</desc>
</image>
<image>
<url>pics/img_9.png</url>
<big_url>big_pics/img_9.png</big_url>
</image>
<image>
<url>pics/img_10.png</url>
<big_url>big_pics/img_10.png</big_url>
</image>
<image>
<url>pics/img_11.png</url>
<big_url>big_pics/img_11.png</big_url>
</image>
<image>
<url>pics/img_12.png</url>
<big_url>big_pics/img_12.png</big_url>
</image>
<image>
<url>pics/img_13.png</url>
<big_url>big_pics/img_14.png</big_url>
</image>
<image>
<url>pics/img_14.png</url>
<big_url>big_pics/img_14.png</big_url>
</image>
<image>
<url>pics/img_15.png</url>
<big_url>big_pics/img_15.png</big_url>
</image>
</images>
Let me know if you would like me to send you the .fla file. It is bigger than the 300kb so i will give you a link to download it if you need to. Thanks for the help.