Hi everyone, I’m new to the forum and to flash.
I would like to ask for assistance with solving a particular problem in flash.
Task:
Create a flash application which will be displayed on a web page which will read from a list of text inside an XML file and display them randomly with fade-in fade-out effects and also at random positions.
My current approach to the problem is using a Dynamic Text Area which will read from the xml file, however I only got to the stage where the swf will read the xml file. Trying to get the fade effect and the positioning effect is proving very difficult for me.
The sample XML I am working with:
<tag>
<tagline>Global Jobs Pact</tagline>
<tagline>Green Jobs</tagline>
<tagline>Decent Work</tagline>
<tagline>Promoting jobs</tagline>
<tagline>Global unification</tagline>
</tag>
My current flash script (which I found on the web)
var tags:Array = new Array();
_global.data_xml = new XML();
_global.data_xml.load(“texttag.xml”);
_global.data_xml.ignoreWhite = true;
_global.data_xml.onLoad = function(success) {
if (success) {
_global.track_xml = data_xml.firstChild.firstChild;
doMenu(this);
} else {
trace(“error reading file”);
}
i = _global.total_xml;
}
function doMenu(data_xml:XML) {
_global.total_xml = data_xml.firstChild.childNodes.length;
for (var i = 0; i < _global.total_xml; i++) {
tags* = data_xml.firstChild.childNodes*.firstChild.nodeValue;
}
initMessages();
}
function initMessages(){
var duration:Number = 3000; //2 seconds
intervalId = setInterval(this, “showRandomMessage”, duration);
}
function showRandomMessage():Void {
content = tags[random(5)];
}
Thank you, I would appreciate any assistance.