2 Replies Latest reply on Nov 28, 2006 1:14 AM by Newsgroup_User

    Passing Variables

    ][odine Level 1
      Hello all,

      I had a quick question regarding Passing a Variable VIA the URL. I know you can do something like "www.someurl.com?somevar=true" or somethign like that. But i need to somehow pass a date via the URL Var

      ActionScript Code:
      var oldDate = new Date(2005,10,25);
      var newDate = new Date();
      var elapsed = newDate - oldDate;

      How on earth do i pass a date with multiple entried (2005,10,25) via a URL variable? I NEED to send the var oldDate = new Date(); in the URL. i know i cant go "?oldDate = new Date(2003,9,21)"

      So how do i pass a variable like that???

      Cheers all!
      --][--
        • 1. Re: Passing Variables
          Peter Lorent Level 2
          A comfortable solution is using SWFObject to load your movie (see http://blog.deconcept.com/swfobject/). Then you can use getQueryParamValue() to parse the vars in the url.
          • 2. Re: Passing Variables
            Level 7
            how about sending 3 different vars?
            something like:
            myMovie.swf?myYear=2005&myMonth=10&myDay=25

            and in your code:
            var oldDate = new Date(Number(myYear), Number(myMonth)-1, Number(myDay))

            i've substracted 1 from the month because its 0 based - so in this example,
            if you want to pass october as a month, without the substraction flash would
            think you meant november.

            eRez

            "][odine" <webforumsuser@macromedia.com> wrote in message
            news:ekgfla$6rv$1@forums.macromedia.com...
            > Hello all,
            >
            > I had a quick question regarding Passing a Variable VIA the URL. I know
            > you
            > can do something like "www.someurl.com?somevar=true" or somethign like
            > that.
            > But i need to somehow pass a date via the URL Var
            >
            > ActionScript Code:
            > var oldDate = new Date(2005,10,25);
            > var newDate = new Date();
            > var elapsed = newDate - oldDate;
            >
            > How on earth do i pass a date with multiple entried (2005,10,25) via a URL
            > variable? I NEED to send the var oldDate = new Date(); in the URL. i
            > know i
            > cant go "?oldDate = new Date(2003,9,21)"
            >
            > So how do i pass a variable like that???
            >
            > Cheers all!
            > --][--
            >