1 Reply Latest reply on Apr 19, 2006 9:57 AM by Newsgroup_User

    Searching XML

    K_C
      I believe what I am about to ask is possible, and if so, any direction to a source would be very helpful.

      I would like to be able to load an XML file (this part is fine) containing for instance, a team scheulde. Within the XML there would be a game date and various other game data (time, opponent, etc). I would like to display the next game based on the user's system date. For example ... the next game is 4/22. It is currently 4/19 so I would like to display the next game where: gameDate >=current Date < nextGame.

      This might not be possible, and if you feel it isn't please let me know and I will adjust my plans accordingly.

      Thanks,

      K_C
        • 1. Re: Searching XML
          Level 7
          Just use and if statement to control what is displayed.

          Something like this:

          gameDate=this.firstChild.childNodes //or whatever your tree looks like
          var today_date ate = new Date();
          var date_str:String =
          (today_date.getDate()+"/"+(today_date.getMonth()+1)+"/"+today_date.getFullYear());
          trace(date_str); // displays current date in United States date format

          if(gameDate>=date_str){
          //your code here. write to a text field or something
          }

          --


          Dan Mode
          *Must Read* http://www.smithmediafusion.com/blog
          *Flash Helps* http://www.smithmediafusion.com/blog/?cat=11

          "K_C" <webforumsuser@macromedia.com> wrote in message
          news:e25pbf$5bu$1@forums.macromedia.com...
          >I believe what I am about to ask is possible, and if so, any direction to a
          > source would be very helpful.
          >
          > I would like to be able to load an XML file (this part is fine) containing
          > for
          > instance, a team scheulde. Within the XML there would be a game date and
          > various other game data (time, opponent, etc). I would like to display
          > the
          > next game based on the user's system date. For example ... the next game
          > is
          > 4/22. It is currently 4/19 so I would like to display the next game
          > where:
          > gameDate >=current Date < nextGame.
          >
          > This might not be possible, and if you feel it isn't please let me know
          > and I
          > will adjust my plans accordingly.
          >
          > Thanks,
          >
          > K_C
          >