1 Replies - 2700 Views - Last Post: 01 June 2008 - 09:34 PM

#1 armagnis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-April 08

Flash swf header with time of day

Posted 22 April 2008 - 02:16 AM

I found a code online with four different settings for time, which is what I need to display four flash headers on a website I'm building.

Here it is:

 
	  <script language="Javascript">

day=new Date()	 //..get the date

x=day.getHours()	//..get the hour

if(x>=0 && x<4) {

   document.write('<style type="text/css">body{background: white url(1st.jpg); color: black}</style>')
   
} else

if(x>=4 && x<12) {

   document.write('<style type="text/css">body{background: white url(2nd.jpg); color: black}</style>')

} else

if(x>=12 && x<18) {

   document.write('<style type="text/css">body{background: white url(3rd.jpg); color: black}</style>')

} else

if (x>=18 && x<24) {

   document.write('<style type="text/css">body{background: white url(4th.jpg); color: black}</style>')

}

</script>



Problem is...well, it won't display the flash. I know that background won't work and I won't be using jpegs of course, but I want to be able to post this in an invisible table, which is in my body, that's where the headers will be placed. Is there even a way to put a flash movie in javascript such as this? Do I require any css to make this work?

If you think there's a better way to do this, with something other than this script, I definitely welcome it.

I thank you for your help. :)
-Armagnis

Is This A Good Question/Topic? 0
  • +

Replies To: Flash swf header with time of day

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1199
  • View blog
  • Posts: 7,309
  • Joined: 07-September 06

Re: Flash swf header with time of day

Posted 01 June 2008 - 09:34 PM

Sorry, I am not quite sure that you are attempting here, but I think what you are trying to do is make a flash application that changes and image based on the time of day (correct?).

If so, it would be easier to create a simple action script application that changes which movieclip is visible depending on what time of day it is. Granted, flash can't be placed as a page background or anything it can be placed inline (as part of your page) and viewed, plus it will update automatically depending on what you tell it to do.

Hope that helps point you in the right direction.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1