...

View Full Version : xml array



hmdadou
02-18-2009, 02:19 PM
I have a function that reads from an array inside flash I wanted to be read from an xml instead.

Here's the link to my flash file it's only 320kb click here (http://narocast.net/quotes.fla)


Or here's the function if you can't download the file which reads 5 arrays everyday.


var dat:Date = new Date();
var compareDat = dat.getDate();
var compareMont = dat.getMonth() + 1;
var arr1:Array = new Array();
var arr2:Array = new Array();
var arr3:Array = new Array();
var arr4:Array = new Array();
var arr5:Array = new Array();

make365();

//---------------------------------
var nyeve_date = new Date((new Date()).getFullYear(), 11, 31);

var now_date = new Date((new Date()).getFullYear(),0,1);

// convert difference in milliseconds to days
var TotalDays = Math.floor((nyeve_date - now_date)/86400000);
var now_date = new Date();
var currDay = Math.floor((nyeve_date - now_date)/86400000);
var val:Number= TotalDays - currDay;



quote1.text = arr1[val];
quote2.text = arr2[val];
quote3.text = arr3[val];
quote4.text = arr4[val];
quote5.text = arr5[val];
//---------------------------------

toda.text = compareDat + "/" + compareMont + "/" + dat.getFullYear();

//trace(dat.getUTCMonth());


And this is the array section which I wanted it to be an xml file instead

function make365()
{
arr1[49] = "05:30"
arr2[49] = "12:35"
arr3[49] = "13:10"
arr4[49] = "15:55"
arr5[49] = "18:20"

arr1[50] = "06:21"
arr2[50] = "12:33"
arr3[50] = "14:12"
arr4[50] = "16:23"
arr5[50] = "19:17"

arr1[51] = "04:21"
arr2[51] = "11:30"
arr3[51] = "14:12"
arr4[51] = "16:50"
arr5[51] = "20:30"

arr1[52] = "06:30"
arr2[52] = "12:11"
arr3[52] = "13:18"
arr4[52] = "17:30"
arr5[52] = "19:21"


}

Any suggestion would be much appreciated.

gnomeontherun
02-18-2009, 07:54 PM
Well its good to start with making an xml file. So do that and then read up on how to bring XML data into Flash here.

http://www.kirupa.com/web/xml/index.htm

hmdadou
02-18-2009, 09:51 PM
Thank you very much for taking the time to reply at my post.:)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum