Go Back   kirupaForum > Flash > Flash CS4

Reply
 
Thread Tools Display Modes
Old 11-24-2009, 01:39 PM   #16
Bone
Registered User
 
Bone's Avatar
At the end of each 'case' you need to put a the line "break;". This stops it from just carrying on and executing all of the code, essentially breaking out of the switch statement.
Bone is offline   Reply With Quote

Sponsored Links (Guests Only) - Register | Need Help?
 

Old 11-24-2009, 03:29 PM   #17
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,159
As I said, check the other threads to see the detail.

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Old 11-30-2009, 12:14 PM   #18
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,159
Here you go. I had a few spare minutes:
http://www.kirupa.com/forum/showthre...43#post2520343

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Old 11-30-2009, 06:07 PM   #19
someguero
Registered User
Ok, now there seems to be an issue. Once December first happens all the November movies wont load. Is there a way to change the if statement to allow the cases from November?

Code:
today = new Date();
date = today.getDate();
month = today.getMonth();
if (month == 10) {
   switch (date) {
        case 22 :
      loadMovieNum("n22.swf", 1);
      break;
        case 23 :
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
        case 24 :
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
        case 25 :
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
        case 26 :
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
          case 27 :
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
                case 28 :
      loadMovieNum("n28.swf", 7);
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
                case 29 :
      loadMovieNum("n29.swf", 8);
      loadMovieNum("n28.swf", 7);
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
                case 30 :
      loadMovieNum("n30.swf", 9);
      loadMovieNum("n29.swf", 8);
      loadMovieNum("n28.swf", 7);
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      break;
      
      etc
   }
}
if (month == 11) {
   switch (date) {
      case 1 :
      loadMovieNum("d1.swf", 10);
      break;
      case 2 :
      loadMovieNum("d2.swf", 11);
      loadMovieNum("d1.swf", 10);
      etc
   }
}

Last edited by someguero; 11-30-2009 at 06:15 PM..
someguero is offline   Reply With Quote
Old 11-30-2009, 06:36 PM   #20
glosrfc
Registered User
 
glosrfc's Avatar
Location Halley Research Station, Latitude 75°35' S, Longitude 26°39' W, Brunt Ice Shelf, Coats Land, Antarctica

Posts 4,159
Why have you still got "etc" in that code?

And try this:
ActionScript Code:
if (month == 11) {
   switch (date) {
      case 1 :
      loadMovieNum("n30.swf", 9);
      loadMovieNum("n29.swf", 8);
      loadMovieNum("n28.swf", 7);
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      loadMovieNum("d1.swf", 10);
      break;
      case 2 :
      loadMovieNum("n30.swf", 9);
      loadMovieNum("n29.swf", 8);
      loadMovieNum("n28.swf", 7);
      loadMovieNum("n27.swf", 6);
      loadMovieNum("n26.swf", 5);
      loadMovieNum("n25.swf", 4);
      loadMovieNum("n24.swf", 3);
      loadMovieNum("n23.swf", 2);
      loadMovieNum("n22.swf", 1);
      loadMovieNum("d2.swf", 11);
      loadMovieNum("d1.swf", 10);
      break;
   }
}


Effectively, all you're doing is appending an extra movieclip on each day.

__________________
©2006 GlosRFC - Searching 8,168,684,336 brain cells
glosrfc is offline   Reply With Quote
Old 11-30-2009, 06:49 PM   #21
someguero
Registered User
The answer was so easy I didn't see it... thnx again.
someguero is offline   Reply With Quote
Reply

Tags
conditions, date, else if


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:37 PM.

SUPPORTERS:

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
Creative web apps. Make your own free flash banners and photo slideshows.
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.

Flash Transition Effects

Flash Effect Tutorials

Digicrafts Components
Flash effects. Art without coding. Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com
Streamsolutions Content Delivery Networks Flipping Book - page flip flash component.
Flash-Gallery.com - Get your flash photo gallery (flash component or swf gallery Learn how to advertise on kirupa.com
 

cdn
content delivery network (cdn)

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd. Copyright 2010 - kirupa.com Copyright 2010 - kirupa.com