home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 102 / CD-ROM 102.iso / aplic / 2sync / 2SyncSetup.exe / launcher / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2002-03-20  |  4.1 KB  |  124 lines

  1. var1 = "225213189225203";
  2. set("_level0/data:dstring",_target add ":var1");
  3. _level0.env = new Object();
  4. _level0.env.ch = new Object();
  5. _level0.env.ch.colour = {n_dark_ra:39,n_dark_ga:41,n_dark_ba:63,n_dark_aa:100,n_light_ra:51,n_light_ga:55,n_light_ba:77,n_light_aa:100,n_text_ra:100,n_text_ga:100,n_text_ba:100,n_text_aa:100,o_dark_ra:16,o_dark_ga:18,o_dark_ba:41,o_dark_aa:100,o_light_ra:19,o_light_ga:20,o_light_ba:41,o_light_aa:100,o_text_ra:100,o_text_ga:100,o_text_ba:100,o_text_aa:100,p_dark_ra:19,p_dark_ga:20,p_dark_ba:41,p_dark_aa:100,p_light_ra:19,p_light_ga:20,p_light_ba:41,p_light_aa:100,p_text_ra:100,p_text_ga:100,p_text_ba:100,p_text_aa:100};
  6. _level0.colour = function(me)
  7. {
  8.    if(_level0.colourSet != true)
  9.    {
  10.       _level0.setChannelColour();
  11.       _level0.colourSet = true;
  12.    }
  13.    this.state = new Object();
  14.    this.state.clear = _level0.env.ch.clear;
  15.    this.state.none = _level0.env.ch.none;
  16.    this.state.normal = _level0.env.ch.normal;
  17.    this.state.over = _level0.env.ch.over;
  18.    this.state.pressed = _level0.env.ch.pressed;
  19.    this.dInst = new Color(me.dark);
  20.    this.lInst = new Color(me.light);
  21.    this.tInst = new Color(me.text);
  22.    this.setState = colourObj_setState;
  23.    this.none = function()
  24.    {
  25.       this.setState("none");
  26.    };
  27.    this.normal = function()
  28.    {
  29.       this.setState("normal");
  30.    };
  31.    this.rollover = function()
  32.    {
  33.       this.setState("over");
  34.    };
  35.    this.pressed = function()
  36.    {
  37.       this.setState("pressed");
  38.    };
  39.    this.clear = function()
  40.    {
  41.       this.setState("clear");
  42.    };
  43.    this.init = colourObj_init;
  44.    this.refresh = colourObj_refresh;
  45.    this.init();
  46.    _level0.colourObjStack.push(me);
  47. };
  48. _level0.colourObj_setState = function(which)
  49. {
  50.    this.dInst.setTransform(this.state[which].dark);
  51.    this.lInst.setTransform(this.state[which].light);
  52.    this.tInst.setTransform(this.state[which].text);
  53.    this.currentState = which;
  54. };
  55. _level0.colourObj_init = function()
  56. {
  57.    this.normal();
  58. };
  59. _level0.colourObj_refresh = function()
  60. {
  61.    this.state.normal = _level0.env.ch.normal;
  62.    this.state.over = _level0.env.ch.over;
  63.    this.state.pressed = _level0.env.ch.pressed;
  64.    this.state.clear = _level0.env.ch.clear;
  65.    this.setState(this.currentState);
  66. };
  67. _level0.setChannelColour = function()
  68. {
  69.    if(_level0.env != null && _level0.env.ch != null)
  70.    {
  71.       var tempObjRef = _level0.env.ch;
  72.       var states = ["normal","over","pressed"];
  73.       var colObjects = ["dark","light","text"];
  74.       var setTrans = ["ra","rb","ga","gb","ba","bb","aa","ab"];
  75.       tempObjRef.none = new Object();
  76.       tempObjRef.none.dark = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  77.       tempObjRef.none.light = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  78.       tempObjRef.none.text = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  79.       tempObjRef.clear = new Object();
  80.       tempObjRef.clear.dark = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  81.       tempObjRef.clear.light = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  82.       tempObjRef.clear.text = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  83.       i = 0;
  84.       while(i < states.length)
  85.       {
  86.          tempObjRef[states[i]] = new Object();
  87.          var stateObj = tempObjRef[states[i]];
  88.          c = 0;
  89.          while(c < colObjects.length)
  90.          {
  91.             stateChar1 = states[i].charAt(0);
  92.             stateObj[colObjects[c]] = new Object();
  93.             t = 0;
  94.             while(t < setTrans.length)
  95.             {
  96.                stateObj[colObjects[c]][setTrans[t]] = tempObjRef.colour[stateChar1 + "_" + colObjects[c] + "_" + setTrans[t]];
  97.                t++;
  98.             }
  99.             c++;
  100.          }
  101.          i++;
  102.       }
  103.       if(_level0.colourObjStack == null)
  104.       {
  105.          _level0.colourObjStack = [];
  106.       }
  107.       else
  108.       {
  109.          for(i in "_level0:colourObjStack")
  110.          {
  111.             if(_level0.colourObjStack[i]._target == null)
  112.             {
  113.                _level0.colourObjStack.splice(i,1);
  114.             }
  115.             else
  116.             {
  117.                _level0.colourObjStack[i].colour.refresh();
  118.             }
  119.          }
  120.       }
  121.    }
  122. };
  123. stop();
  124.