I know this can be shortened but i'm stuck trying

Hi all
I'm so sure that this can be shortened but i'm having real difficulties with the for, and if statements, and the orders.. i figure why suffer over it... get some help.
heres the code:
if ((dat) >= "1") { block_1._alpha = 50; }
else { block_1._alpha = 100;}
if ((dat) >= "2") { block_2._alpha = 50; }
else { block_2._alpha = 100;}
if ((dat) >= "3") { block_3._alpha = 50; }
else { block_3._alpha = 100;}
if ((dat) >= "4") { block_4._alpha = 50; }
else { block_4._alpha = 100;}
if ((dat) >= "5") { block_5._alpha = 50; }
else { block_5._alpha = 100;}
if ((dat) >= "6") { block_6._alpha = 50; }
else { block_6._alpha = 100;}
if ((dat) >= "7") { block_7._alpha = 50; }
else { block_7._alpha = 100;}
if ((dat) >= "8") { block_8._alpha = 50; }
else { block_8._alpha = 100;}
if ((dat) >= "9") { block_9._alpha = 50; }
else { block_9._alpha = 100;}
if ((dat) >= "10") { block_10._alpha = 50; }
else { block_10._alpha = 100;}
if ((dat) >= "11") { block_11._alpha = 50; }
else { block_11._alpha = 100;}
if ((dat) >= "12") { block_12._alpha = 50; }
else { block_12._alpha = 100;}
if ((dat) >= "13") { block_13._alpha = 50; }
else { block_13._alpha = 100;}
if ((dat) >= "14") { block_14._alpha = 50; }
else { block_14._alpha = 100;}
if ((dat) >= "15") { block_15._alpha = 50; }
else { block_15._alpha = 100;}
if ((dat) >= "16") { block_16._alpha = 50; }
else { block_16._alpha = 100;}
if ((dat) >= "17") { block_17._alpha = 50; }
else { block_17._alpha = 100;}
if ((dat) >= "18") { block_18._alpha = 50; }
else { block_18._alpha = 100;}
if ((dat) >= "19") { block_19._alpha = 50; }
else { block_19._alpha = 100;}
if ((dat) >= "20") { block_20._alpha = 50; }
else { block_20._alpha = 100;}
if ((dat) >= "21") { block_21._alpha = 50; }
else { block_21._alpha = 100;}
if ((dat) >= "22") { block_22._alpha = 50; }
else { block_22._alpha = 100;}
if ((dat) >= "23") { block_23._alpha = 50; }
else { block_23._alpha = 100;}
if ((dat) >= "24") { block_24._alpha = 50; }
else { block_24._alpha = 100;}
Any help would be awesome.. cheers all
B

Perfect
Cheers for that
What gets me is both of those codes worked fine, even though they were written very differently.
The dat' bit is what i had down as a day. Its for a calendar. so dat will (for a christmas calendar) only go up to 24, and will be displayed as a number.
cheers for your help again
B

Similar Messages

  • Can you print from an iPad 2 using 3G in a home with no computer or wifi by using an iPhone 5 hot spot connection if the printer has been set up in another place with live wifi? I know this question is loaded but my dad lives in a rural area

    Can you print from an iPad 2 using 3G in a home with no other computer or wifi by using an iPhone 5 hot spot connection if the printer has been set up in another place with live wifi? I know this question is loaded but my dad lives in a rural area and is wanting a printer to use occasionally. He doesn't want to deal with a computer and I keep his iPad updated for him at my home.  Please shed some light on this for us PLEASE. Thanks

    In that case, it should be possible. I haven't tried this directly, but I believe it should work.
    You'll need to get an actual AirPrint compatible Printer.
    Check here for a list of Printers you can choose from.
    http://support.apple.com/kb/ht4356
    Once you have the compatible printer, using the Hotspot feature from the iPhone he'll have to create the Wifi bubble form the iPhone, and connect the Printer to that Wifi network.
    Then connect the iPad to that same Wifi network provided by the iPhone. When all that is done, the printer should appear in any of the Apps that can Print under the Action Arrow button.
    For instance in email, pressing the action arrow should show a Print option. In there the printer should appear.
    Alternatively you can simply buy a wireless router and setup the network through there even if there is no internet attached.  Connect the wireless printer to the router network, and connect the iPad or iPhone to that same wifi network to print.

  • I know this can be done with javascript, but how precisely?

    Hi there, I have a personal art website that I've been having trouble with.  The website in question is http://www.aidenart.com.  The issue that I'm dealing has to do with the concept art page which  you can click on using the top navigation bar.  On that page there are  thumbnails of images and when you click on any one of those image  thumbnails you should be taken to a new WEB PAGE with the full image on  it.  The fact that the link brings you to a new web page is important.   On each of the web pages that shows the full image I want to provide  some navigation for the visitor to use.  There's going to be a button  that will link back to the main concept art page and a jump menu that  will let the visitor go to any of the other concept art pages that they  want.  Both of those things I already know how to do.  The thing is I  also want put in NEXT and PREVIOUS buttons that will allow the visitor  to go to the next or previous page in the list of concept art pages even  if they've never visited the page before.
    I know this  can be done because I've seen other websites that have it.  I took a  look at their source code and most of them seem to be using some sort of  javascript code with an onClick or onChange behavior.  If someone could  just help me find the basic coding for making this happen in  Dreamweaver with maybe at least two or three pages then I could probably  figure the rest out from there.
    The last time I asked  this forum about this problem everyone seemed to think that I wanted to  create an image gallery, but I don't.  I want the visitor to be able to  cycle through the WEB PAGES that have the image and might have more  images in the future, not just the images themselves.  And using some  sort of code that has to do with the web browser's history isn't going  to do what I want.
    Here's some code from other websites that I found using just what I want to accomplish.
    <TD  ALIGN=RIGHT><INPUT TYPE=BUTTON Value=' &lt;  Prev '  onClick="self.location='/s/3112627/1/Yami_no_Game_Dark_Saga'">  <SELECT title='chapter navigation' Name=chapter  onChange="self.location = '/s/3112627/'+  this.options[this.selectedIndex].value +  '/Yami_no_Game_Dark_Saga';"><option  value=1 >1. Meet and  Duel<option  value=2 selected>2. Voyage to the Kingdom<option   value=3 >3. The Great Insect Combos: Yami vs Haga<option  value=4  >4. Scented Scheme Tactics: Mai vs Jou<option  value=5 >5.  Ocean Madness: Yami vs Kajiki<option  value=6 >6. The Messenger  from Hell<option  value=7 >7. Prehistoric Battle: Ryuzaki vs  Jou<option  value=8 >8. Hunters of the Night: Eliminator  Panik<option  value=9 >9. Arrivals and Secrets Revealed<option   value=10 >10. Escaping Death: Jou vs Kozuka<option  value=11  >11. Battle in the Labyrinth for Freedom<option  value=12 >12.  Duel of Fate, part 1<option  value=13 >13. Duel of Fate, part  2<option  value=14 >14. A Brother's Promise<option  value=15  >15. First Round of Finals: Yami vs Mai<option  value=16 >16.  Second Round of Finals, part 1<option  value=17 >17. Second Round  of Finals, part 2<option  value=18 >18. Duel of Kings, part  1<option  value=19 >19. Duel of Kings, part 2<option  value=20  >20. Closing: Duelist Kingdom<option  value=21 >21. Virtual  Adventure: Start!<option  value=22 >22. Virtual Adventure: First  Task<option  value=23 >23. Virtual Adventure: Final Dungeon  Appears<option  value=24 >24. Closing: Virtual  Adventure<option  value=25 >25. The Shop of Broken  Hearts<option  value=26 >26. Gaining the Upper Hand<option   value=27 >27. Emotional Rollercoaster<option  value=28 >28.  Closing: Dungeon Dice Monsters<option  value=29 >29. Mysterious  New Force<option  value=30 >30. Start of a New  Tournament<option  value=31 >31. The Decision<option  value=32  >32. The Announcement<option  value=33 >33. The  Ambush<option  value=34 >34. Battle City: Start!</select>  <INPUT TYPE=BUTTON Value=' Next &gt; '  onClick="self.location='/s/3112627/3/Yami_no_Game_Dark_Saga'"></TD>
                 </TR>
    The first example is from http://www.fanfiction.net/.   If you click on any of the stories there that have more than one  chapter then you should see code somewhere that looks like the above  example.  This type of navigation, which can be seen in the upper right  corner of stories that use it, is exactly what I've been trying to  accomplish for quite some time now.
    Here's another example.
    <form method="" action="" name="hero_form">
             <select name="hero_choices" onChange="swap_hero(this.options[this.selectedIndex].value);">
             <option value='1'>Jeran</option><option  value='2'>Space Faerie</option><option  value='3'>Fyora</option><option  value='4'>Lisha</option><option value='5'  SELECTED>Illusen</option><option  value='6'>Kayla</option><option value='7'>King  Skarl</option><option  value='8'>Psellia</option><option  value='9'>Jhuidah</option><option value='10'>The Soup  Faerie</option><option  value='11'>Hannah</option><option value='12'>Master  Vex</option><option  value='13'>Galgarroth</option><option  value='14'>Cylara</option><option  value='15'>Gorix</option><option value='16'>Commander  Gormos</option><option value='17'>King  Kelpbeard</option><option value='18'>Swordmaster  Talek</option><option  value='19'>Garin</option><option  value='20'>Jacques</option><option value='21'>General  Dacon</option><option  value='22'>Nabile</option><option  value='23'>Tomos</option><option  value='24'>Armin</option><option value='25'>Judge  Hog</option><option value='26'>Hanso</option>       
             </select>
         </form>
         </center>
         <table width="200" border=0 align=center>
             <tr>
                 <td align=center>
                                         <a  href='showhero.phtml?hero=4'><img  src="http://images.neopets.com/galleryofheroes/goh_left_arrow.gif"  border=0 width=80 height=80></a>
                                 </td>
                 <td align=center><a href='../hero.phtml'><img  src="http://images.neopets.com/galleryofheroes/goh_home.gif" width=50  height=50 border=0></a></td>
                 <td align=center>
                                         <a  href='showhero.phtml?hero=6'><img  src="http://images.neopets.com/galleryofheroes/goh_right_arrow.gif"  border=0 width=80 height=80></a>
    With this example the website even used images as the buttons  instead of just simple input buttons.  I'd like to use my own images for  buttons if I can.
    My computer is a Macbook with the  most recent operating system (as far as I know) and I have Dreamweaver  CS5 installed on my computer.

    Your example uses straight text links.  Nothing fancy, no complicated JavaScripts are used.  Just a lot of manual linking.
    Example:  http://www.aidenart.com/Concept%20Art%20Pages/ConceptImage1.html
    PREVIOUS: http://www.aidenart.com/Concept%20Art%20Pages/ConceptPage2Arga.html
    MAIN: http://www.aidenart.com/ConceptArtMain.html
    NEXT: http://www.aidenart.com/Concept%20Art%20Pages/ConceptPostitTiratsu.html
    Each page contains a different PREVIOUS and NEXT link depending on where it appears within the site.
    Hopefully this answers your question.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • I know this is old now but since the update i can't get into icloud on my phone it keeps asking me to check t & c's and now no emails. Can't connect to server. I have 4S please help :-(

    I know this is old now but since the update i can't get into icloud on my phone it keeps asking me to check t & c's and now no emails. Can't connect to server. I have 4S please help :-(

    Hi Kellyssi,
    Thanks for visiting Apple Support Communities.
    If you're being asked repeatedly to check terms and conditions, try restarting and then resetting your iPhone:
    iOS: Turning off and on (restarting) and resetting
    http://support.apple.com/kb/ht1430
    All the best,
    Jeremy

  • I smashed my ipod screen today and i know apple can repair it but how should i contact them?

    please help, i smashed my ipod screen and i know apple can repair it but i dont get how they will and how to contact them! please help will be thankful!

    Apple will exchange your iPod for a refurbished one for this price. They do not fix yours.
    Apple - iPod Repair price       
    You can do the exchange at an Apple store
    Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar
    Or send it to Apple;
    Apple - Support - iPod - Service FAQ     
    A third-party place like the following maybe less. Google for more.
    iPhone Repair, Service & Parts: iPod Touch, iPad, MacBook Pro Screens
    Replace the screen yourself if you are up to it
    iPod Touch Repair – iFixit

  • I use Adobe Premiere Elements 11. I want to make a Credit Roll and start off screen and stop with the credit remaining still in the middle of the screen. I know this can be done with CS6. Can this be done in Elements 11? Does Elements 12 or 13 have these

    I use Adobe Premiere Elements 11. I want to make a Credit Roll and start off screen and stop with the credit remaining still in the middle of the screen. I know this can be done with CS6. Can this be done in Elements 11? Does Elements 12 or 13 have these options for Credit Roll.

    stevel
    Please read my work on this topic which involves Premiere Elements Preroll and Postroll settings.
    ATR Premiere Elements Troubleshooting: PE: Preroll and Postroll Options Interpreted
    Especially the section relating to Titler, Roll and Crawl Titles.
    Please let us know if that worked for you.
    Thank you.
    ATR

  • I can purchase apps but whenever i'm trying to make in app purchase its failing again and again

    i can purchase apps but whenever i'm trying to make in app purchase its failing again and again

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Something happened to my phone and lost all contacts.I did not know this and backed up my phone.When i tried to restore back up the contacts were still not there.How to access older back up?

    Something happened to my phone and lost all contacts.I did not know this and backed up my phone.When i tried to restore back up the contacts were still not there.How to access older back up?

    Her contacts would be wherever she put them
    The iphone is designed to be synced to your computer or cloud service regularly.  If she failed to do this, then they are likely gone.

  • Stuttery playback Premiere Pro CS6, I know this is a FAQ but I can't find a fix.

    I'm going to list as much as I can if I forget anything please don't be harsh, I will make sure to add/reply with what I missed. Please bare in mind I may add stuff that is not a cause of the issue but I'm just trying to give you as much background as possible.
         Basically I have been using Premiere Pro for quite a while (around 4-6 months with no issue) I came over from Sony Vegas and have never looked back, (I use Ps, Au, Ai & Ae also so the intergration is perfect) a couple of weeks ago I started havng issues with playback I will add my specs below and you can see I have quite a beefy PC which makes me think it's maybe a hard drive issue. Everytime I open Pr I hit the 'HDV 1080p 30fps' preset drag my clip in and hit 'change sequence settings' Screenshots: http://imgur.com/a/kXG8n
    Then as I mentioned about 2 weeks ago I started having stuttery playback (frames will stutter foward and after around 10 frames with jult back around 4-5 frames), I found a fix of copying & pasting my timeline into a new sequence but this fix is no longer working. One thing I have noticed is that the work area render bar used to be red and is now yellow when I add my footage, I am using the software MPE (I have an AMD GPU and as far as I'm aware I cannot do any different) I have 10gb of ram allocated to Adobe products in the 'memory' tab. I have tried 'optimizing rendering for' both performance & memory and giving it all 15gb of RAM that I can but it all makes no difference. Screenshots: http://imgur.com/a/Guanm
    I have been googling it every day for the past two weeks, I even have the search 'stuttery playback in premiere pro' bookmarked and have have tried every possible thing. I have been forced to go back to Vegas for the moment and I want to be using Premiere Pro again so can anyone help?
    i'm aware that it could be a hard drive issue as I only have one HDD, this has never been an issue before and I don't wanna go out and spend unnecessary money. I appciate any response, I'm not sure how these forums work with upvotiing or anything like that but if you could share this discussion with people that would be fantastic, thank you very much for your time.]
    My PC specs: (I have put all that I think is relevent, if anything else is needed please let me know).
    Processor: Intel® Core™i7-2700k Quad Core (3.50GHz, 8MB Cache) + HD Graphics
    Motherboard: ASUS® P8Z77-M: MICRO-ATX, USB 3.0, SATA 6GBs, ATI®CrossFireX
    Memory: 16GB SAMSUNG DUAL-DDR3 1333MHz (2 X 8GB)
    Graphics Card: 2GB AMD RADEON™ HD7850 - DVI,HDMI,2 mDP - DX® 11, Eyefinity 4 Capable
    Memory: 1TB 3.5" SATA-III 6GB/s HDD 7200RPM 32MB CACHE (Please note: this drive is currently writing at 183 MB/sec)
    Once again thank you for your time.

    Part of the reason for such stuttery playback performance lies with the limitations of the single SATA connection (channel) itself. You see, SATA is not full duplex, but only half-duplex. That means that a block of transfers going in one direction must be completed before a block of transfers can even begin in the opposite direction. Think of the SATA channel (single connection) as a single-lane stretch of highway with traffic signals at each end. What's worse, that single disk must also deal with the Windows pagefile, the media cache, previews and various other things all going on at the same time. As a result, the effective performance of that single disk can plummet by a factor of six: That single disk, after accounting for all of the tasks it must perform at the same time as video playback, is left with only about 32 MB/s of bandwidth available for Premiere Pro.
    In other words, that single disk is being severely overworked as it is.

  • I know this will sound ridiculous but I have "lost" the arrow key (to go back or forward) at the top on the bar.  I swear I used to be able to just click and arrow to see the previous page and now it's not there.  Help!?

    I know this sounds crazy but I have "lost" my arrow key at the top of the screen to go forward or back.  I'm sure it used to be there but it's really bugging me that I can't find it.  It's a real pain trying to go one page back.  Help?!

    If this is Safari that you've lost the arrows in,  go to Safari > view > show toolbar.
    If the toolbar is present and the arrows missing then right click on the toolbar and select "customize toolbar".
    Drag the arrows or the default set back to the bar.
    Regards,
    Captfred

  • I know this has been said BUT K8N plat won't post

    I am at my wits end with this damn thing.  I have installed a ton of PCs and never as much trouble as I have with this AMD64 3000.  First I ordered it with the Chaintech 150 board after reading great reviews on it.  That was my mistake for not looking at the forums to see what the real users say.  
    OK after RMAing the board back and forth and getting jack I gave up on it, set it aside and got the MSI K8N.  Installed it with the things below only and actually got the power to stay on only to lock on keyboard and not post.  
    I then read everything I could find in forums and tried everything that was suggested on top of what is the usual steps and got squat.  I am wondering now if the board is bad and I need to RMA it.  Has anyone found a fix to this post problem as I see a lot of people have had it.  I can tell you that my board is not shorted out, I tried other ram and am convinced that is not the problem.  Went and bought a new USB keyboard I did not need and still crapo.  God what I would not do to see a bios screen or even a post!
    Any other suggestions?  If I RMA this and get the same damn problem I swear I am going to start looking for my chainsaw!  
    2 months and counting while Doom3 sits unopen!  

    OK I tried moving the SATA connect to all the other 3 plus I moved the mem.  I think now I have tried about every combo with the mem and have had no luck.
    One thing that I didn't mention as I thought it was part of how this mobo sets up, but as soon as I plug in the power cable and turn on the PS the PC powers up.  I then can control it via the power switch., but if I unplug it then it will repower as soon as the plug is reinserted.
    I let iit sit in this error state for quite some time also and it doesnt appear to be a heat issue.  There has to be something simple that I either did wrong or am missing.  I have read a lot of post of people with this exact same problem and now I am getting emails of more having the problem and asking me to let them know what worked.  It would have to have been a really bad Monday at MSI for this many boards to be faulty(and that is humor as I think it has to be something I am missing).
    Oh and the Chaintech board would powerup for a split second then shut off.  It never made it near a post .   Read someplace that Corsair mem would not work with the Chaintech (plus many others) and decided to switch to the mobo choice most forum people were suggesting for a AMD64.
    I appreciate all the suggestions.

  • I downloaded iso5 and lost all my apps which i know i can get back but one of them is pages so i have lost all my documents ! How do i get them back?

    I downloaded iso5 and lost all my apps. I know i can get them back but what about all the documents i have now lost through Pages? And to a lesser extent the levels and scores i got to with my games (eg. angry birds)?

    On your iPad tap Settings > Store
    Make sure Apps is switched on.
    For Documetns tap Settings > iCloud. Make sure Documents & Data ia switched on.
    Now resrtart your iPad.    Hold the On/Off Sleep/Wake button down until the red slider appears. Slide your finger across the slider to turn off iPhone. To turn iPhone back on, press and hold the On/Off Sleep/Wake button until the Apple logo appears.

  • I do not know how to get the music that I buy on itunes, on my mac, onto an ipod. I have already authorized my computer and "downloaded" my music, but that did not do anything. Please I really need to know how to do this on my own but I am stuck.Thank you

    I do not know how to get the music that I buy on itunes, on my mac, onto an ipod. I have already authorized my computer and "downloaded" my music, but that did not do anything, or provid the results that I was expecting, at least. Please, I really need to know how to do this on my own but I do not know what to do.Thank you in advance to anyone that is answering this question that I know most everyone but me knows how to accomplish. thanks!!!

    In iTunes go to the Help menu in the upper menu bar.  Then click on iTunes Help. Then on Sync your iPod, iPhone or iPad and follow the instructions.

  • I need to get back to ff4. I know this came up before but I don't have a link to the answer. My concern is the loss of use of Roboform.

    I need to get back to FF4. I did this in the past but lost the procedure. I need to get to FF4 so that Roboform tool bar works.

    Thanks for the right fix.
    By the way RF is now up to7.4.1
    Also when the install of FF5 ran it said that the Roboform toolbar was incompatible and said there was no upgrade. That is what sent me searching for away back to FF4. So I didn't even look at RF's site believing there was no upgrade available.

  • HT1695 My wifi password is 4 didgits, i know this for a fact, but my ipod touch won't let me connect because it doesn't register that short of a password

    I know my password for wifi, but the "join" button stays unselected because it doesn't recognize the password as being long enough what do i do?

    Are you using WEP security? If so you have to set up the router to use the first hexadecimal key and you have to use that key as the password.
    See:
    iOS: Recommended settings for Wi-Fi routers and access points

Maybe you are looking for

  • Report with Stock type against a material

    Hi All, We are creating a new report with the logic of MB5B (with exclusion of Material Movement from selection screen) and output will have fields from MB52 report (escpecially the stock type split data with qty & valuation amount along with other c

  • How to programmatically disable prompts for output file names in Acrobat X

    My code to programmatically disable output file names (below) is not working on a Windows 7 64-bit machine using Acrobat Distiller X.  It works perfectly on a Windows XP machine with Acrobat Distiller 8. The latest API Reference I was able to find is

  • Differences between the T420i and the T420

    Hey everyone, I currently own a X61. I have been thinking of buying a T420, and right now, with the ongoing 4th of july sale, plus a corporate discount, it's a pretty good deal. The only problem I have is that I don't quite understand what the differ

  • Regarding Table..

    Hi,          I have created a table , with table maintenence generator, and in that table i have some fields, in that i have three fields created by , created on , created time, so when ever i am creating entries in the ztable, it should automaticall

  • Fixed layout epub animation

    Hi, I have a question about the kinds of animations that can be realized with fixed layout epub: it's possible to create drag and drop elements and scrollable text? Can I use the overlay creator panel? I'm sorry, I'm new in the forum. thank you so mu