Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: xml array

  1. #1
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post xml array

    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


    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.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    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
    jeremy - gnomeontherun
    Educated questions often get educated answers, and simple questions often get simple answers.

  • #3
    New to the CF scene
    Join Date
    Feb 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Respect to you

    Thank you very much for taking the time to reply at my post.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •