A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: getdate to jump in the timeline?

  1. #1
    Member
    Join Date
    Sep 2000
    Posts
    49

    getdate to jump in the timeline?

    What I'm trying to do is jumping in the timeline of an MC depending on what day of the month it is, eg like today is 18 my MC will jump to frame 18 of my timeline:::

    I'm trying with this:

    var today_date: Date = new Date();
    var date_str:String = today_date.getDate()


    I'm doing this to convert my date in a string that i can pass to a gotoAndStop(string) ?????

  2. #2
    Uses MX 2004 Pro Quixx's Avatar
    Join Date
    Nov 2004
    Location
    U.S.
    Posts
    877
    getDate() returns a number. Your variable "date_str" won't except it because it isn't a string. You could make it a string by using String(today_date.getDay()), but since you're using the code to send your movie to a numbered frame it would be better to just keep it as a number. So try the following code instead.

    Code:
    var today_date:Date = new Date();
    var date_str:Number = today_date.getDate();
    trace(date_str);

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center