Time sensitive background, day and night - SWiSHMax Tutorials
 
  Buy Ebooks, Video Games, DVDs, Electronics and more !
Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads Make Money Online Blog . Free Image and Photo Sharing and Hosting

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Free image hosting
   Web Design Pakistan
   Swish Templates
   SWiSH Climax
   Talkfreelance Community
   Template Desire
   Lite boards
   Script Sector
   GimpTalk
   13dots
   Idea Designs
   PHP Cafe
   Sposatoettore
   Free swishmax templates
   Swishzone

Manage your site with Flax Article Content Management System
Time sensitive background, day and night
Category : SWiSHMax | Level : Beginner | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

Hi,

I want to show you this awsome example, how to create time sensitive background for your web page.So, if the time is 10:00 the background=day and if the time is 22:00 the background=night.

Time sensitive background

1.Before to start with this tutorial you must first to have two same pictures (by day and by night).So insert this two pictures in Swishmax.

2.Select the day picture and groupit as sprite.Add name day.Do the same action with the second picture night (group as sprite) and add name night.

3.Now select two sprites ( day and night ), and group as sprite again.Add name for this sprite Hours.

4.Click on the Hours sprite and in the timeline onFrame(1) add this script:

onFrame (1) {
timeDataObj = new Date();
localtimeH = timeDataObj.getHours();
if (localtimeH >= 6 && localtimeH <= 18) {
this.gotoAndPlay("day");
} else {
if (localtimeH >= 19 && localtimeH <= 24) {
this.gotoAndPlay("night");
} else {
if (localtimeH >= 0 && localtimeH <= 5) {
this.gotoAndPlay("night");
}
stop();
}
}
}


5.OnFrame(2) add the label day, onFrame(2) for the day sprite add effect place and onFrame(10) add stop().

6.OnFrame(11) set label night and below this label add place effect for sprite night and the remove effect for the sprite day.

7.OnFrame(20) add stop() action.

8.That's all.Now test your *swf movie clip with changing the time on your computer.Enjoy! wink.gif


© 2002-2005 Flaxweb Network | Article Manager | Gimp Tutorials Library | RAD C++ Library | Free C/C++ Sourcecode |
Sites of interest : Web Design Blog | Swish Templates | Swishmax Ebook | Photoshop Templates | Gimp Tutorials | Text Forum | Make Money Online