# Time displays image

**URL:** <https://forum.kirupa.com/t/time-displays-image/3009>\
**Category:** flash\
**Created:** [February 11, 2002, 6:28am UTC](https://forum.kirupa.com/t/time-displays-image/3009 "2002-02-11T06:28:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2002, 6:28am UTC](https://forum.kirupa.com/t/time-displays-image/3009/1 "2002-02-11T06:28:51Z")

</div>

How can I get different images to display base on the time in Flash?\r\rThx.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2002, 12:32pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/2 "2002-02-11T12:32:35Z")

</div>

Hey, live from my brand new laptop ! I hope that will make me a better flasher…\r\rAnyway, about your problem : the getTimer() should be your Ali Baba cave. Or was it Alladin ? Anyway, putting :

```auto
 time = getTimer () ;\r\rif (time/1000 > 5) gotoAndPlay (2) ;

```

that will make your movie play frame 2 after 2 seconds (or course you’ll have to put a stop action in the first frame…)\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2002, 4:57pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/3 "2002-02-11T16:57:13Z")

</div>

Thanks for the actionscript!\r\rMy only problem is that the movie should open with the image greeting instead of a button release. How can I fix this problem?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2002, 6:48pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/4 "2002-02-11T18:48:46Z")

</div>

??? I don’t understand what you mean. What’s released ? And what’s the image ?\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 11, 2002, 7:50pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/5 "2002-02-11T19:50:45Z")

</div>

perhaps the Date object is your abu dhabi’s cave. ; )

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 12, 2002, 4:16am UTC](https://forum.kirupa.com/t/time-displays-image/3009/6 "2002-02-12T04:16:14Z")

</div>

I have fours images that represent "early morning, morning, afternoon and evening.\r\rEach time my flash movie is opened, I want one of the greetings to appear based on the time of day. \r\rI have tested and opened my movie but the images does not appear until I click on my home button (this is where my images will display). The actionscript does start with “on release”.\r\rI want to know if I can do something to trigger the movie to open at a particular frame on a given time.\r\rHope this makes sense!\r\rThx.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 12, 2002, 6:02am UTC](https://forum.kirupa.com/t/time-displays-image/3009/7 "2002-02-12T06:02:31Z")

</div>

yup… the date object is what you want. If Supra doesn’t explain it by the time I get home I’ll try to post something.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 12, 2002, 6:20pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/8 "2002-02-12T18:20:55Z")

</div>

Don’t you guys know Ali Baba ? And the 40 thieves ??? Great story.\r\rpom 0]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 12, 2002, 6:25pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/9 "2002-02-12T18:25:34Z")

</div>

i know the story ilyslamasse, i was making fun. ; )\r\rlook in the help for date object. it’s a pretty thorough explanation.\r\rsomething like:

```auto
 \r\rmydate = new Date();\r\rtrace(mydate.getHour());

```

\r\r

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 13, 2002, 5:03am UTC](https://forum.kirupa.com/t/time-displays-image/3009/10 "2002-02-13T05:03:54Z")

</div>

Its just not working for me!\r\rI thought trace action usually works with text display (output), how will this display my image(s)?\r\rI still have my “if functions” included, is this the problem?\r\rBut if the “if function” is not included then how will flash know when to display my image?\r\rBtw, thanks for the help…I have no knowledge of Flash.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 13, 2002, 8:31am UTC](https://forum.kirupa.com/t/time-displays-image/3009/11 "2002-02-13T08:31:43Z")

</div>

sorry to be so vague, i put the trace action in there just you could see what the output was.\r\rnow that you know what it outputs, use it however you want.\r\rprobably something like\r\rimagemovie.gotoAndStop(hour);\r\rthen make imagemovie have the right image in the right frames.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 14, 2002, 4:47am UTC](https://forum.kirupa.com/t/time-displays-image/3009/12 "2002-02-14T04:47:24Z")

</div>

I’m not getting it! This can take forever!\r\rIs it possible if I can get you to write the whole thing down?\r\rThis is what I want…\r\rif the hr is \>=0 // \<=4 then the “early” image displays,\relse\rif the hr is \>=4 // \<=12 then the “morning” image displays,\relse\rif the hr is \>=12 // \<=18 then the “noon” image displays,\relse\rif the hr is \>=18 // \<=24 then the “evening” image displays.\r\rI tried your method and this it what I have…\r\rmydate=newDate()\rtrace (mydate.getHour ());\rearly.gotostop(hour\>=0 && \<=4)\rand so with the morning, noon and evening.\r\rWhat is the problem?\r\rHope you’re not sick of me yet!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 14, 2002, 7:41pm UTC](https://forum.kirupa.com/t/time-displays-image/3009/13 "2002-02-14T19:41:34Z")

</div>

ok, rather than tracing the mydate.getHours(), maybe assign it to hour? that way, when you reference hour later, it’ll actually contain some information. ; )\r\rhow about you make a movie, call it image. put your early image in frames 1-4, your morning image in 5-12… etc.\r\rthen:

```auto
 \r\rmydate = new Date();\r\rhour = mydate.getHours();\r\r_root.image.gotoAndStop(hour);

```
