home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 2010 Software/Programs / PCGuia_programas.iso / Swf / linux.swf / scripts / __Packages / eMailer.as < prev    next >
Text File  |  2010-02-24  |  6KB  |  186 lines

  1. class eMailer extends mx.core.UIComponent
  2. {
  3.    var className = "eMailer";
  4.    static var symbolOwner = eMailer;
  5.    static var symbolName = "eMailer";
  6.    function eMailer()
  7.    {
  8.       super();
  9.    }
  10.    function set buttonLabel(label)
  11.    {
  12.       this.__buttonLabel = label;
  13.       this.invalidate();
  14.    }
  15.    function get buttonLabel()
  16.    {
  17.       return this.__buttonLabel;
  18.    }
  19.    function set scriptPath(path)
  20.    {
  21.       this.__scriptPath = path;
  22.    }
  23.    function get scriptPath()
  24.    {
  25.       return this.__scriptPath;
  26.    }
  27.    function set eMailerLabels(labels)
  28.    {
  29.       this.__eMailerLabels = labels;
  30.       this.invalidate();
  31.    }
  32.    function get eMailerLabels()
  33.    {
  34.       return this.__eMailerLabels;
  35.    }
  36.    function set eMailerErrors(errors)
  37.    {
  38.       this.__eMailerErrors = errors;
  39.       this.invalidate();
  40.    }
  41.    function get eMailerErrors()
  42.    {
  43.       return this.__eMailerErrors;
  44.    }
  45.    function draw(Void)
  46.    {
  47.       System.useCodepage = true;
  48.       var _loc9_ = this.__get__scriptPath();
  49.       var _loc8_ = this.__eMailerLabels[4];
  50.       var _loc14_ = this.__eMailerErrors[0];
  51.       var _loc15_ = this.__eMailerErrors[1];
  52.       var _loc20_ = this.__eMailerErrors[2];
  53.       var _loc21_ = this.createEmptyMovieClip("c001",0);
  54.       var _loc3_ = _loc21_.attachMovie("Button","itemUnique",0);
  55.       _loc3_.label = this.__buttonLabel;
  56.       _loc3_.fitContents();
  57.       _loc3_.addEventListener("click",this.handleEvent);
  58.       _loc3_.a = _loc9_;
  59.       _loc3_.b = _loc8_;
  60.       _loc3_.nameError = _loc14_;
  61.       _loc3_.eMailError = _loc15_;
  62.       _loc3_.commsError = _loc20_;
  63.       var _loc10_ = this.createEmptyMovieClip("nameInputClip",-1);
  64.       var _loc5_ = _loc10_.attachMovie("TextInput","nameInputAttach",1);
  65.       _loc3_.nameInputItem = _loc5_;
  66.       var _loc23_ = this.createEmptyMovieClip("nameLabelClip",1);
  67.       var _loc6_ = _loc23_.attachMovie("Label","nameLabelAttach",1);
  68.       _loc6_.text = this.__eMailerLabels[0];
  69.       var _loc17_ = this.createEmptyMovieClip("eMailInputClip",-2);
  70.       var _loc18_ = _loc17_.attachMovie("TextInput","eMailInputAttach",2);
  71.       _loc3_.eMailInputItem = _loc18_;
  72.       var _loc12_ = this.createEmptyMovieClip("eMailLabelClip",2);
  73.       var _loc19_ = _loc12_.attachMovie("Label","eMailLabelAttach",2);
  74.       _loc19_.text = this.__eMailerLabels[1];
  75.       var _loc11_ = this.createEmptyMovieClip("commsInputClip",-3);
  76.       var _loc16_ = _loc11_.attachMovie("TextArea","commsInputAttach",3);
  77.       _loc3_.commsInputItem = _loc16_;
  78.       var _loc22_ = this.createEmptyMovieClip("commsLabelClip",3);
  79.       var _loc7_ = _loc22_.attachMovie("Label","commsLabelAttach",3);
  80.       _loc7_.text = this.__eMailerLabels[2];
  81.       var _loc13_ = this.createEmptyMovieClip("statusLabelClip",4);
  82.       var _loc4_ = _loc13_.attachMovie("Label","statusLabelAttach",4);
  83.       _loc4_.text = this.__eMailerLabels[3];
  84.       _loc3_.statusLabelItem = _loc4_;
  85.       this.size();
  86.       super.draw();
  87.    }
  88.    function size(Void)
  89.    {
  90.       this.__width = this.width;
  91.       this.__height = this.height;
  92.       this._x = this.x;
  93.       this._y = this.y;
  94.       this.doLayout();
  95.       super.size();
  96.    }
  97.    function doLayout()
  98.    {
  99.       var _loc30_ = this.c001;
  100.       var _loc22_ = undefined;
  101.       _loc22_ = _loc30_.itemUnique;
  102.       var _loc9_ = 110;
  103.       var _loc7_ = 30;
  104.       _loc22_.move(this.__width - _loc9_,this.__height - _loc7_);
  105.       var _loc33_ = this.nameLabelClip;
  106.       var _loc6_ = undefined;
  107.       _loc6_ = _loc33_.nameLabelAttach;
  108.       var _loc16_ = 15;
  109.       var _loc14_ = 15;
  110.       _loc6_.move(_loc16_,_loc14_);
  111.       var _loc19_ = this.eMailLabelClip;
  112.       var _loc24_ = undefined;
  113.       _loc24_ = _loc19_.eMailLabelAttach;
  114.       var _loc10_ = 15;
  115.       var _loc11_ = 65;
  116.       _loc24_.move(_loc10_,_loc11_);
  117.       var _loc31_ = this.commsLabelClip;
  118.       var _loc3_ = undefined;
  119.       _loc3_ = _loc31_.commsLabelAttach;
  120.       var _loc17_ = 15;
  121.       var _loc15_ = 115;
  122.       _loc3_.move(_loc17_,_loc15_);
  123.       _loc3_.wordWrap = true;
  124.       var _loc21_ = this.statusLabelClip;
  125.       var _loc8_ = undefined;
  126.       _loc8_ = _loc21_.statusLabelAttach;
  127.       var _loc25_ = 15;
  128.       var _loc23_ = 55;
  129.       _loc8_.move(_loc25_,this.__height - _loc23_);
  130.       var _loc12_ = this.nameInputClip;
  131.       var _loc2_ = undefined;
  132.       _loc2_ = _loc12_.nameInputAttach;
  133.       var _loc28_ = 15;
  134.       var _loc32_ = 35;
  135.       _loc2_.setSize(this.__width - 30,22);
  136.       _loc2_.move(_loc28_,_loc32_);
  137.       _loc2_.restrict = "A-Z a-z├í├⌐├¡├│├║├ü├ë├ì├ô├Ü";
  138.       var _loc26_ = this.eMailInputClip;
  139.       var _loc5_ = undefined;
  140.       _loc5_ = _loc26_.eMailInputAttach;
  141.       var _loc29_ = 15;
  142.       var _loc27_ = 85;
  143.       _loc5_.setSize(this.__width - 30,22);
  144.       _loc5_.move(_loc29_,_loc27_);
  145.       var _loc13_ = this.commsInputClip;
  146.       var _loc4_ = undefined;
  147.       _loc4_ = _loc13_.commsInputAttach;
  148.       var _loc18_ = 15;
  149.       var _loc20_ = 135;
  150.       _loc4_.setSize(this.__width - 30,this.__height - 195);
  151.       _loc4_.move(_loc18_,_loc20_);
  152.    }
  153.    function handleEvent(evt)
  154.    {
  155.       var _loc1_ = evt.target.eMailInputItem.text;
  156.       if(!evt.target.nameInputItem.length)
  157.       {
  158.          evt.target.statusLabelItem.text = evt.target.nameError;
  159.       }
  160.       else if(!evt.target.eMailInputItem.length || _loc1_.indexOf("@") == -1 || _loc1_.indexOf(".") == -1)
  161.       {
  162.          evt.target.statusLabelItem.text = evt.target.eMailError;
  163.       }
  164.       else if(!evt.target.commsInputItem.length)
  165.       {
  166.          evt.target.statusLabelItem.text = evt.target.commsError;
  167.       }
  168.       else
  169.       {
  170.          var myLV = new LoadVars();
  171.          myLV.Name = evt.target.nameInputItem.text;
  172.          myLV.eMail = evt.target.eMailInputItem.text;
  173.          myLV.comms = evt.target.commsInputItem.text;
  174.          myLV.sendAndLoad(evt.target.a,myLV,"Post");
  175.          evt.target.statusLabelItem.text = evt.target.b;
  176.          myLV.onLoad = function()
  177.          {
  178.             evt.target.statusLabelItem.text = myLV.myStatus;
  179.             evt.target.nameInputItem.text = "";
  180.             evt.target.eMailInputItem.text = "";
  181.             evt.target.commsInputItem.text = "";
  182.          };
  183.       }
  184.    }
  185. }
  186.