home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Interface / it.dig / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2008-08-19  |  12.1 KB  |  291 lines

  1. function abre_arquivo()
  2. {
  3.    getURL("http://www.digerati.com.br/loja/busca.php?tipo=2&busca=" + _root.var_loja + "&origem=" + _root.var_codigo,"");
  4. }
  5. function Categoria(Categoria_xml)
  6. {
  7.    function leia()
  8.    {
  9.       _root.myDataGrid.dataProvider.removeAll();
  10.       max = leitor.firstChild.childNodes.length;
  11.       var _loc13_ = Array();
  12.       var _loc6_ = Array();
  13.       var _loc14_ = Array();
  14.       var _loc12_ = Array();
  15.       var _loc8_ = Array();
  16.       var _loc9_ = Array();
  17.       var _loc7_ = Array();
  18.       var _loc11_ = Array();
  19.       var _loc5_ = Array();
  20.       var _loc10_ = Array();
  21.       var _loc4_ = Array();
  22.       var _loc28_ = new Object();
  23.       var _loc29_ = Array();
  24.       var _loc3_ = Array();
  25.       titulo = leitor.firstChild.attributes.name;
  26.       _root.categoria_mc.Categoria_titulo = titulo;
  27.       if(leitor.firstChild.attributes.subCategoria == "true")
  28.       {
  29.          _global.num = 1;
  30.          _root.subCategoria_cb.removeAll();
  31.          maxSub = leitor.firstChild.childNodes[0].childNodes.length;
  32.          _global.tem_sub = true;
  33.          _root.subCategoria_cb.addItem({label:"LISTAR TODOS",data:"all"});
  34.          i = 0;
  35.          while(i < maxSub)
  36.          {
  37.             _loc3_[i] = leitor.firstChild.childNodes[0].childNodes[i].firstChild;
  38.             _root.subCategoria_cb.addItem({label:_loc3_[i],data:_loc3_[i]});
  39.             i++;
  40.          }
  41.       }
  42.       else
  43.       {
  44.          _global.num = 0;
  45.          _root.subCategoria_cb.removeAll();
  46.          _global.tem_sub = false;
  47.       }
  48.       i = _global.num;
  49.       while(i < max)
  50.       {
  51.          _loc13_[i] = leitor.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
  52.          _loc6_[i] = leitor.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
  53.          _loc14_[i] = leitor.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
  54.          _loc12_[i] = leitor.firstChild.childNodes[i].childNodes[3].firstChild.nodeValue;
  55.          _loc8_[i] = leitor.firstChild.childNodes[i].childNodes[4].firstChild.nodeValue;
  56.          _loc9_[i] = leitor.firstChild.childNodes[i].childNodes[5].firstChild.nodeValue;
  57.          _loc7_[i] = leitor.firstChild.childNodes[i].childNodes[6].firstChild.nodeValue;
  58.          _loc11_[i] = leitor.firstChild.childNodes[i].childNodes[7].firstChild.nodeValue;
  59.          _loc5_[i] = leitor.firstChild.childNodes[i].childNodes[8].firstChild.nodeValue;
  60.          _loc10_[i] = leitor.firstChild.childNodes[i].childNodes[9].firstChild.nodeValue;
  61.          _loc4_[i] = leitor.firstChild.childNodes[i].childNodes[10].firstChild.nodeValue;
  62.          _root.myDataGrid.dataProvider.addItem({NUMERO:_loc13_[i],NOME:_loc6_[i],CATEGORIA:_loc14_[i],DESCRICAO:_loc12_[i],LICENCA:_loc8_[i],LIMITACAO:_loc9_[i],CAMINHO:_loc7_[i],IMAGEM:_loc11_[i],CONTROLES:_loc5_[i],COMANDOS:_loc10_[i],AVISO:_loc4_[i]});
  63.          i++;
  64.       }
  65.       if(_loc4_[_global.num] == undefined || _loc4_[_global.num] == "-")
  66.       {
  67.          _root.aviso.gotoAndStop(1);
  68.          _global.tem_aviso = false;
  69.       }
  70.       else
  71.       {
  72.          _global.tem_aviso = true;
  73.          _global.pri_aviso = _loc4_[_global.num];
  74.       }
  75.       _root.descri._visible = false;
  76.       _root.descri.gotoAndStop(3);
  77.       _root.descri.nome.text = _loc6_[_global.num];
  78.       _root.descri.controles_txt.text = _loc5_[_global.num];
  79.       _root.descri.descri.text = _loc12_[_global.num];
  80.       _root.descri.caminho.text = _loc7_[_global.num];
  81.       _root.descri.licenca.text = _loc8_[_global.num];
  82.       _root.descri.limitacao.text = _loc9_[_global.num];
  83.       _root.descri.comando.text = _loc10_[_global.num];
  84.       if(_loc5_[_global.num] == undefined)
  85.       {
  86.          _root.descri.controles_txt.text = "-";
  87.       }
  88.       else
  89.       {
  90.          _root.descri.controles_txt.text = _loc5_[_global.num];
  91.       }
  92.       _root.aviso.informacao.text = _loc4_[_global.num];
  93.       _root.descri.foto.my_ldr.contentPath = mdm.Application.path + "interface\\imagens\\" + _loc11_[_global.num] + ".jpg";
  94.       _root.descri.visible = false;
  95.    }
  96.    var leitor = new XML();
  97.    _global.var_source = mdm.Application.path + "xml/" + Categoria_xml + ".xml";
  98.    leitor.load(_global.var_source);
  99.    leitor.onLoad = leia;
  100.    leitor.ignoreWhite = true;
  101.    System.useCodepage = true;
  102.    _root.myDataGrid.resizableColumns = false;
  103. }
  104. function Buscar()
  105. {
  106.    function leiaBusca()
  107.    {
  108.       _root.myDataGrid.dataProvider.removeAll();
  109.       max = leitor.firstChild.childNodes.length;
  110.       var _loc15_ = Array();
  111.       var _loc6_ = Array();
  112.       var _loc16_ = Array();
  113.       var _loc7_ = Array();
  114.       var _loc9_ = Array();
  115.       var _loc10_ = Array();
  116.       var _loc8_ = Array();
  117.       var _loc13_ = Array();
  118.       var _loc14_ = Array();
  119.       var _loc11_ = Array();
  120.       var _loc12_ = Array();
  121.       var _loc29_ = new Object();
  122.       var _loc28_ = Array();
  123.       j = 0;
  124.       i = _global.num;
  125.       while(i < max)
  126.       {
  127.          _loc15_[i] = leitor.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
  128.          _loc6_[i] = leitor.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
  129.          _loc16_[i] = leitor.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
  130.          _loc7_[i] = leitor.firstChild.childNodes[i].childNodes[3].firstChild.nodeValue;
  131.          _loc9_[i] = leitor.firstChild.childNodes[i].childNodes[4].firstChild.nodeValue;
  132.          _loc10_[i] = leitor.firstChild.childNodes[i].childNodes[5].firstChild.nodeValue;
  133.          _loc8_[i] = leitor.firstChild.childNodes[i].childNodes[6].firstChild.nodeValue;
  134.          _loc13_[i] = leitor.firstChild.childNodes[i].childNodes[7].firstChild.nodeValue;
  135.          _loc14_[i] = leitor.firstChild.childNodes[i].childNodes[8].firstChild.nodeValue;
  136.          _loc11_[i] = leitor.firstChild.childNodes[i].childNodes[9].firstChild.nodeValue;
  137.          _loc12_[i] = leitor.firstChild.childNodes[i].childNodes[10].firstChild.nodeValue;
  138.          if(_root.chave.text != "")
  139.          {
  140.             var _loc3_ = undefined;
  141.             _loc3_ = _root.chave.text;
  142.             _loc3_ = _loc3_.toLowerCase();
  143.             var _loc4_ = new String(_loc6_[i]);
  144.             _loc4_ = _loc4_.toLowerCase();
  145.             var _loc5_ = new String(_loc7_[i]);
  146.             _loc5_ = _loc5_.toLowerCase();
  147.             if(_loc4_.indexOf(_loc3_,0) != -1 || _loc5_.indexOf(_loc3_,0) != -1)
  148.             {
  149.                _loc28_[j] = leitor.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
  150.                _root.myDataGrid.vPosition = 1;
  151.                _root.myDataGrid.dataProvider.addItem({NUMERO:_loc15_[i],NOME:_loc6_[i],CATEGORIA:_loc16_[i],DESCRICAO:_loc7_[i],LICENCA:_loc9_[i],LIMITACAO:_loc10_[i],CAMINHO:_loc8_[i],IMAGEM:_loc13_[i],CONTROLES:_loc14_[i],COMANDOS:_loc11_[i],AVISO:_loc12_[i]});
  152.                j++;
  153.             }
  154.          }
  155.          else
  156.          {
  157.             _root.myDataGrid.dataProvider.addItem({NUMERO:_loc15_[i],NOME:_loc6_[i],CATEGORIA:_loc16_[i],DESCRICAO:_loc7_[i],LICENCA:_loc9_[i],LIMITACAO:_loc10_[i],CAMINHO:_loc8_[i],IMAGEM:_loc13_[i],CONTROLES:_loc14_[i],COMANDOS:_loc11_[i],AVISO:_loc12_[i]});
  158.             _root.myDataGrid.vPosition = 0;
  159.          }
  160.          i++;
  161.       }
  162.       _root.chave.text = "";
  163.    }
  164.    var leitor = new XML();
  165.    leitor.load(_global.var_source);
  166.    leitor.onLoad = leiaBusca;
  167.    leitor.ignoreWhite = true;
  168.    System.useCodepage = true;
  169. }
  170. function SubCategorias()
  171. {
  172.    function leiaSub()
  173.    {
  174.       _root.myDataGrid.dataProvider.removeAll();
  175.       max = leitor.firstChild.childNodes.length;
  176.       var _loc13_ = Array();
  177.       var _loc4_ = Array();
  178.       var _loc3_ = Array();
  179.       var _loc11_ = Array();
  180.       var _loc6_ = Array();
  181.       var _loc7_ = Array();
  182.       var _loc5_ = Array();
  183.       var _loc10_ = Array();
  184.       var _loc12_ = Array();
  185.       var _loc8_ = Array();
  186.       var _loc9_ = Array();
  187.       var _loc25_ = new Object();
  188.       var _loc26_ = Array();
  189.       i = _global.num;
  190.       while(i < max)
  191.       {
  192.          _loc13_[i] = leitor.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
  193.          _loc4_[i] = leitor.firstChild.childNodes[i].childNodes[1].firstChild.nodeValue;
  194.          _loc3_[i] = leitor.firstChild.childNodes[i].childNodes[2].firstChild.nodeValue;
  195.          _loc11_[i] = leitor.firstChild.childNodes[i].childNodes[3].firstChild.nodeValue;
  196.          _loc6_[i] = leitor.firstChild.childNodes[i].childNodes[4].firstChild.nodeValue;
  197.          _loc7_[i] = leitor.firstChild.childNodes[i].childNodes[5].firstChild.nodeValue;
  198.          _loc5_[i] = leitor.firstChild.childNodes[i].childNodes[6].firstChild.nodeValue;
  199.          _loc10_[i] = leitor.firstChild.childNodes[i].childNodes[7].firstChild.nodeValue;
  200.          _loc12_[i] = leitor.firstChild.childNodes[i].childNodes[8].firstChild.nodeValue;
  201.          _loc8_[i] = leitor.firstChild.childNodes[i].childNodes[9].firstChild.nodeValue;
  202.          _loc9_[i] = leitor.firstChild.childNodes[i].childNodes[10].firstChild.nodeValue;
  203.          if(_global.sub == "all")
  204.          {
  205.             _root.myDataGrid.dataProvider.addItem({NUMERO:_loc13_[i],NOME:_loc4_[i],CATEGORIA:_loc3_[i],DESCRICAO:_loc11_[i],LICENCA:_loc6_[i],LIMITACAO:_loc7_[i],CAMINHO:_loc5_[i],IMAGEM:_loc10_[i],CONTROLES:_loc12_[i],COMANDOS:_loc8_[i],AVISO:_loc9_[i]});
  206.          }
  207.          else if(escape(_global.sub) == escape(_loc3_[i]))
  208.          {
  209.             _root.myDataGrid.dataProvider.addItem({NUMERO:_loc13_[i],NOME:_loc4_[i],CATEGORIA:_loc3_[i],DESCRICAO:_loc11_[i],LICENCA:_loc6_[i],LIMITACAO:_loc7_[i],CAMINHO:_loc5_[i],IMAGEM:_loc10_[i],CONTROLES:_loc12_[i],COMANDOS:_loc8_[i],AVISO:_loc9_[i]});
  210.          }
  211.          _root.myDataGrid.vPosition = 0;
  212.          i++;
  213.       }
  214.    }
  215.    var leitor = new XML();
  216.    leitor.load(_global.var_source);
  217.    leitor.onLoad = leiaSub;
  218.    leitor.ignoreWhite = true;
  219.    System.useCodepage = true;
  220. }
  221. stop();
  222. _root.var_loja = "Excel";
  223. _root._var_codigo_edicao = "ONCK056";
  224. _root.var_codigo = "CD_" + _root._var_codigo_edicao;
  225. if(_global.styles.DataGrid == undefined)
  226. {
  227.    _global.styles.DataGrid = new mx.styles.CSSStyleDeclaration();
  228. }
  229. if(_global.styles.DataGrid == undefined)
  230. {
  231.    _global.styles.DataGrid = new mx.styles.CSSStyleDeclaration();
  232. }
  233. _root.myDataGrid.setStyle("themeColor",12243179);
  234. _global.styles.DataGrid.setStyle("fontFamily","Verdana");
  235. _global.styles.DataGrid.setStyle("fontSize",11);
  236. _global.styles.DataGrid.setStyle("themeColor",13096683);
  237. _global.styles.DataGrid.setStyle("headerColors",[13096683,16777215]);
  238. _global.styles.DataGrid.setStyle("alternatingRowColors",[16777215,16120316]);
  239. _global.styles.DataGrid.setStyle("rollOverColor",16773313);
  240. _global.styles.DataGrid.setStyle("backgroundColor",13096683);
  241. _global.styles.DataGrid.setStyle("borderStyle","alert");
  242. _global.styles.DataGrid.setStyle("borderColor",13096683);
  243. _global.styles.DataGrid.setStyle("vGridLineColor",13096683);
  244. _global.styles.DataGrid.setStyle("hGridLineColor",13096683);
  245. _root.principal = false;
  246. _global.style.setStyle("fontFamily","Verdana");
  247. volta_inicio = function()
  248. {
  249.    _root.anula_btn._visible = false;
  250.    _root.descri.gotoAndStop(1);
  251.    _root.descri_games.gotoAndStop(1);
  252.    if(_root.principal == true)
  253.    {
  254.       _root.categoria_mc.gotoAndPlay("VOLTAR");
  255.    }
  256.    else
  257.    {
  258.       _root.categoria_mc.gotoAndStop(1);
  259.    }
  260. };
  261. onEnterFrame = function()
  262. {
  263.    if(categoria_mc._currentframe == 1)
  264.    {
  265.       anula_btn._visible = false;
  266.       anula_btn.useHandCursor = false;
  267.    }
  268.    else
  269.    {
  270.       anula_btn._visible = true;
  271.       anula_btn.useHandCursor = false;
  272.    }
  273. };
  274. _root.myDataGrid.columnNames = ["NUMERO","NOME","CATEGORIA","DESCRICAO","LICENCA","LIMITACAO","CAMINHO","IMAGEM","CONTROLES","COMANDOS","AVISO"];
  275. _root.myDataGrid.getColumnAt(0).headerText = "N┬║";
  276. _root.myDataGrid.getColumnAt(0).width = 32;
  277. _root.myDataGrid.getColumnAt(0).textAlign = "center";
  278. _root.myDataGrid.getColumnAt(1).width = 285;
  279. _root.myDataGrid.getColumnAt(2).textAlign = "center";
  280. _root.myDataGrid.getColumnAt(2).width = 185;
  281. _root.myDataGrid.getColumnAt(3).width = 190;
  282. _root.myDataGrid.getColumnAt(4).width = 190;
  283. _root.myDataGrid.selectable = true;
  284. _root.myDataGrid.refresh();
  285. carregarCat = function(a)
  286. {
  287.    _global.Categoria_xml = a;
  288.    Categoria(_global.Categoria_xml);
  289.    _root.categoria_mc.play();
  290. };
  291.