0 Replies Latest reply on Feb 17, 2012 9:04 AM by xcmuddman

    Simulating a CONTRAST changer on LCD screen

    xcmuddman Level 1

      Hi All / KGLAD... :-)

       

      I am making a simulator for an LCD screen and have the contrast changing with "btn_down" properly. I have an up button - "btn_up" that i would like to be able to control the contrast in the opposite direction, keeping track of the current color in the Array and moving back. I tried changing the code to increment negatively through the Array but something is screwy... It doesnt like the multiple duplicate values that i have and only works when "btn_down" has initially moved the array...

      any suggestions??

       

      Thank you in advance!

       

       

       

      //CONTRAST CHANGE

      //To Change Colors of HiLight Bar, Header Bar, and Plain Text
      var colorA:Array = [0x041607,0x041607,0x041607,0x041607,0x041607,0x041607,0x041607,0x041607,0x041607,0x26D94 9,0x26D949,0x26D949,0x26D949,0x26D949,0x26D949,0x26D949,0x26D949,0x26D949,0x26D949];

      mc_LCD_loader.c = new Color(mc_LCD_loader);
      mc_LCD_loader.index = 0;

      mc_LCD_text_loader.c = new Color(mc_LCD_text_loader);
      mc_LCD_text_loader.index = 0;

      //To Change Colors of LCD Screen and Selected Text
      var colorB:Array =[0x26D949,0x22C341,0x1EAD3A,0x1A9833,0x17832C,0x136D24,0x0F571D,0x0B4216,0x062900,0x0416 07,0x062900,0x0B4216,0x0F571D,0x136D24,0x17832C,0x1A9833,0x1EAD3A,0x22C341,0x26D949];

      mc_LCD.c = new Color(mc_LCD);
      mc_LCD.index = 0;

      mc_LCD_text_selected_loader.c = new Color(mc_LCD_text_selected_loader);
      mc_LCD_text_selected_loader.index = 0;


      btn_down.onRelease = function()
      {
      AudibleBeep1 = new Sound(this);
      AudibleBeep1.attachSound(btnPressBeep);
      AudibleBeep1.start(0, 1);

      mc_LCD_loader.c.setRGB(colorA[mc_LCD_loader.index]);
      mc_LCD_loader.index=(mc_LCD_loader.index+1)%colorA.length;
      mc_LCD_text_loader.c.setRGB(colorA[mc_LCD_text_loader.index]);
      mc_LCD_text_loader.index=(mc_LCD_text_loader.index+1)%colorA.length;

      mc_LCD.c.setRGB(colorB[mc_LCD.index]);
      mc_LCD.index=(mc_LCD.index+1)%colorB.length;
      mc_LCD_text_selected_loader.c.setRGB(colorB[mc_LCD_text_selected_loader.index]);
      mc_LCD_text_selected_loader.index=(mc_LCD_text_selected_loader.index+1)%colorB.length;
      }
      /*
      btn_up.onRelease = function()
      {
      AudibleBeep1 = new Sound(this);
      AudibleBeep1.attachSound(btnPressBeep);
      AudibleBeep1.start(0, 1);

      mc_LCD_loader.c.setRGB(colorA[mc_LCD_loader.index]);
      mc_LCD_loader.index=(mc_LCD_loader.index-1)%colorA.length;
      mc_LCD_text_loader.c.setRGB(colorA[mc_LCD_text_loader.index]);
      mc_LCD_text_loader.index=(mc_LCD_text_loader.index-1)%colorA.length;

      mc_LCD.c.setRGB(colorB[mc_LCD.index]);
      mc_LCD.index=(mc_LCD.index-1)%colorB.length;
      mc_LCD_text_selected_loader.c.setRGB(colorB[mc_LCD_text_selected_loader.index]);
      mc_LCD_text_selected_loader.index=(mc_LCD_text_selected_loader.index-1)%colorB.length;
      }
      */