home *** CD-ROM | disk | FTP | other *** search
- class eMailer extends mx.core.UIComponent
- {
- var __buttonLabel;
- var __scriptPath;
- var __eMailerLabels;
- var __eMailerErrors;
- var __width;
- var __height;
- var c001;
- var nameLabelClip;
- var eMailLabelClip;
- var commsLabelClip;
- var statusLabelClip;
- var nameInputClip;
- var eMailInputClip;
- var commsInputClip;
- var className = "eMailer";
- static var symbolOwner = eMailer;
- static var symbolName = "eMailer";
- function eMailer()
- {
- super();
- }
- function set buttonLabel(label)
- {
- this.__buttonLabel = label;
- this.invalidate();
- }
- function get buttonLabel()
- {
- return this.__buttonLabel;
- }
- function set scriptPath(path)
- {
- this.__scriptPath = path;
- }
- function get scriptPath()
- {
- return this.__scriptPath;
- }
- function set eMailerLabels(labels)
- {
- this.__eMailerLabels = labels;
- this.invalidate();
- }
- function get eMailerLabels()
- {
- return this.__eMailerLabels;
- }
- function set eMailerErrors(errors)
- {
- this.__eMailerErrors = errors;
- this.invalidate();
- }
- function get eMailerErrors()
- {
- return this.__eMailerErrors;
- }
- function draw(Void)
- {
- System.useCodepage = true;
- var _loc9_ = this.scriptPath;
- var _loc8_ = this.__eMailerLabels[4];
- var _loc14_ = this.__eMailerErrors[0];
- var _loc15_ = this.__eMailerErrors[1];
- var _loc20_ = this.__eMailerErrors[2];
- var _loc21_ = this.createEmptyMovieClip("c001",0);
- var _loc3_ = _loc21_.attachMovie("Button","itemUnique",0);
- _loc3_.label = this.__buttonLabel;
- _loc3_.fitContents();
- _loc3_.addEventListener("click",this.handleEvent);
- _loc3_.a = _loc9_;
- _loc3_.b = _loc8_;
- _loc3_.nameError = _loc14_;
- _loc3_.eMailError = _loc15_;
- _loc3_.commsError = _loc20_;
- var _loc10_ = this.createEmptyMovieClip("nameInputClip",-1);
- var _loc5_ = _loc10_.attachMovie("TextInput","nameInputAttach",1);
- _loc3_.nameInputItem = _loc5_;
- var _loc23_ = this.createEmptyMovieClip("nameLabelClip",1);
- var _loc6_ = _loc23_.attachMovie("Label","nameLabelAttach",1);
- _loc6_.text = this.__eMailerLabels[0];
- var _loc17_ = this.createEmptyMovieClip("eMailInputClip",-2);
- var _loc18_ = _loc17_.attachMovie("TextInput","eMailInputAttach",2);
- _loc3_.eMailInputItem = _loc18_;
- var _loc12_ = this.createEmptyMovieClip("eMailLabelClip",2);
- var _loc19_ = _loc12_.attachMovie("Label","eMailLabelAttach",2);
- _loc19_.text = this.__eMailerLabels[1];
- var _loc11_ = this.createEmptyMovieClip("commsInputClip",-3);
- var _loc16_ = _loc11_.attachMovie("TextArea","commsInputAttach",3);
- _loc3_.commsInputItem = _loc16_;
- var _loc22_ = this.createEmptyMovieClip("commsLabelClip",3);
- var _loc7_ = _loc22_.attachMovie("Label","commsLabelAttach",3);
- _loc7_.text = this.__eMailerLabels[2];
- var _loc13_ = this.createEmptyMovieClip("statusLabelClip",4);
- var _loc4_ = _loc13_.attachMovie("Label","statusLabelAttach",4);
- _loc4_.text = this.__eMailerLabels[3];
- _loc3_.statusLabelItem = _loc4_;
- this.size();
- super.draw();
- }
- function size(Void)
- {
- this.__width = this.width;
- this.__height = this.height;
- this._x = this.x;
- this._y = this.y;
- this.doLayout();
- super.size();
- }
- function doLayout()
- {
- var _loc30_ = this.c001;
- var _loc22_ = undefined;
- _loc22_ = _loc30_.itemUnique;
- var _loc9_ = 110;
- var _loc7_ = 30;
- _loc22_.move(this.__width - _loc9_,this.__height - _loc7_);
- var _loc33_ = this.nameLabelClip;
- var _loc6_ = undefined;
- _loc6_ = _loc33_.nameLabelAttach;
- var _loc16_ = 15;
- var _loc14_ = 15;
- _loc6_.move(_loc16_,_loc14_);
- var _loc19_ = this.eMailLabelClip;
- var _loc24_ = undefined;
- _loc24_ = _loc19_.eMailLabelAttach;
- var _loc10_ = 15;
- var _loc11_ = 65;
- _loc24_.move(_loc10_,_loc11_);
- var _loc31_ = this.commsLabelClip;
- var _loc3_ = undefined;
- _loc3_ = _loc31_.commsLabelAttach;
- var _loc17_ = 15;
- var _loc15_ = 115;
- _loc3_.move(_loc17_,_loc15_);
- _loc3_.wordWrap = true;
- var _loc21_ = this.statusLabelClip;
- var _loc8_ = undefined;
- _loc8_ = _loc21_.statusLabelAttach;
- var _loc25_ = 15;
- var _loc23_ = 55;
- _loc8_.move(_loc25_,this.__height - _loc23_);
- var _loc12_ = this.nameInputClip;
- var _loc2_ = undefined;
- _loc2_ = _loc12_.nameInputAttach;
- var _loc28_ = 15;
- var _loc32_ = 35;
- _loc2_.setSize(this.__width - 30,22);
- _loc2_.move(_loc28_,_loc32_);
- _loc2_.restrict = "A-Z a-záéíóúÁÉÍÓÚ";
- var _loc26_ = this.eMailInputClip;
- var _loc5_ = undefined;
- _loc5_ = _loc26_.eMailInputAttach;
- var _loc29_ = 15;
- var _loc27_ = 85;
- _loc5_.setSize(this.__width - 30,22);
- _loc5_.move(_loc29_,_loc27_);
- var _loc13_ = this.commsInputClip;
- var _loc4_ = undefined;
- _loc4_ = _loc13_.commsInputAttach;
- var _loc18_ = 15;
- var _loc20_ = 135;
- _loc4_.setSize(this.__width - 30,this.__height - 195);
- _loc4_.move(_loc18_,_loc20_);
- }
- function handleEvent(evt)
- {
- var _loc1_ = evt.target.eMailInputItem.text;
- if(!evt.target.nameInputItem.length)
- {
- evt.target.statusLabelItem.text = evt.target.nameError;
- }
- else if(!evt.target.eMailInputItem.length || _loc1_.indexOf("@") == -1 || _loc1_.indexOf(".") == -1)
- {
- evt.target.statusLabelItem.text = evt.target.eMailError;
- }
- else if(!evt.target.commsInputItem.length)
- {
- evt.target.statusLabelItem.text = evt.target.commsError;
- }
- else
- {
- var myLV = new LoadVars();
- myLV.Name = evt.target.nameInputItem.text;
- myLV.eMail = evt.target.eMailInputItem.text;
- myLV.comms = evt.target.commsInputItem.text;
- myLV.sendAndLoad(evt.target.a,myLV,"Post");
- evt.target.statusLabelItem.text = evt.target.b;
- myLV.onLoad = function()
- {
- evt.target.statusLabelItem.text = myLV.myStatus;
- evt.target.nameInputItem.text = "";
- evt.target.eMailInputItem.text = "";
- evt.target.commsInputItem.text = "";
- };
- }
- }
- }
-