A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Weird sorta Problem

  1. #1
    XRave tongxn's Avatar
    Join Date
    Apr 2005
    Location
    Somewhere near Here
    Posts
    870

    Weird sorta Problem

    Hi guys can you solve this problem for me?

    Code:
    amp = mydate.getHours();
    // 
    // below is what sets the am-pm 0-24 to display Am & Pm
    if (amp eq "0" or amp eq "1" or amp eq "2" or amp eq "3" or amp eq "4" or amp eq "5" or amp eq "6" or amp eq "7" or amp eq "8" or amp eq "9" or amp eq "10" or amp eq "11") {
    	_root.clock.ampm.gotoAndStop(1);
    }
    if (amp eq "12" or amp eq "13" or amp eq "14" or amp eq "15" or amp eq "16" or amp eq "17" or amp eq "18" or amp eq "19" or amp eq "20" or amp eq "21" or amp eq "22" or amp eq "23") {
    	_root.clock.ampm.gotoAndStop(2);
    }
    Now this is a code for a am or pm displayer, am is on frame 1 and pm is on frame 2

    this is quite delicate and I cant get it to work.

    Thanks guys.
    When you actually know what "OMG I have so much homework!" means, you won't want to be me.
    Xrave

  2. #2
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    Code:
    var amp = mydate.getHours();
    // assume it's am (frame 1)
    var frame = 1;
    // if the hour is greater than 11 it's pm
    if (amp > 11) {
        // so we want frame 2
        frame = 2;
    } 
    // send the clip to the right frame
    _root.clock.ampm.gotoAndStop(frame);

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