_global.style.setStyle("fontFamily","Tahoma");
_global.style.setStyle("fontSize",11);
import mx.controls.Alert;
import mx.controls.*;
import mx.containers.*;
import upload;
this.createClassObject(Accordion,"main_form",3,{_x:27, _y:150});//165
main_form.setSize(430,270);
code = 1;
_root["f"+code] = main_form.createChild(mx.core.View, "library_tree", {label:"1."});
_root["f"+code].createClassObject(Button,"browse_btn",300,{_x:350, _y:10, _width:65, _height:20, label:"Browse"});
_root["f"+code].createClassObject(TextInput,"tx_input_1",301,{_x:10, _y:10, _width:330, _height:20});
_root["f"+code].createClassObject(Button,"upload_btn",302,{_x:350, _y:35, _width:65, _height:20, label:"Upload"});
_root["f"+code].createClassObject(ProgressBar,"pb_",333,{_x:10, _y:35, _width:330});
_root["f"+code].pb_.mode = "manual";
_root["f"+code].pb_.label = "%1 out of %2 Uploaded";
_root["f"+code].createClassObject(Label,"label_1",303,{_x:365, _y:65, text:"نوع قالب"});
_root["f"+code].createClassObject(ComboBox,"com_1",304,{_x:270, _y:65, _width:70});
_root["f"+code].com_1.addItem({label:"معمولي", fs:"mamoli"});
_root["f"+code].com_1.addItem({label:"چندتکه", fs:"chandTekE"});
_root["f"+code].createClassObject(Label,"label_2",305,{_x:215, _y:65, text:"سايز چاپ"});
_root["f"+code].createClassObject(ComboBox,"com_2",306,{_x:150, _y:65, _width:65});
_root["f"+code].com_2.addItem({label:"13*18"});
_root["f"+code].createClassObject(Label,"label_3",307,{_x:110, _y:65, text:"تعداد"});
_root["f"+code].createClassObject(NumericStepper,"num_1",308,{_x:40, _y:65, _width:65});
_root["f"+code].num_1.maximum = 100;
_root["f"+code].createClassObject(Label,"label_4",309,{_x:365, _y:95, text:"برش"});
_root["f"+code].createClassObject(ComboBox,"com_4",310,{_x:210, _y:95, _width:130});
_root["f"+code].createClassObject(Label,"label_5",311,{_x:170, _y:95, text:"رنگ"});
_root["f"+code].com_4.addItem({label:"13*18"});
_root["f"+code].createClassObject(ComboBox,"com_5",312,{_x:100, _y:95, _width:65});
_root["f"+code].com_5.addItem({label:"13*18" , data:"sefid"});
_root["f"+code].com_5.addItem({label:"13*18" , data:"siah"});
_root["f"+code].createClassObject(TextArea,"deatile_1",313,{_x:10, _y:125, _width:265, _height:110, html:true});
_root["f"+code].createClassObject(Loader,"loader_1",314,{_x:280, _y:125, _width:130, _height:105, scaleContent:true, contentPath:"uploadPRV.jpg"});
_root["f"+code].upload_btn_1.enabled = false;
var setAS_1 = new upload();
setAS_1.setAction(1);
//********************************************************
System.security.allowDomain("http://localhost/");//*******
//********************************************************
this.generate_btn.onRelease = function() {
this.enabled = false;
for (ci=300, i=0; i<(NM_.value-1); i++, ci += 10) {
var code:Number = Number(i+2);
_root["f"+code] = main_form.createChild(mx.core.View, "library_tree"+code, {label:code+"."});
_root["f"+code].createClassObject(Button,"browse_btn",300,{_x:350, _y:10, _width:65, _height:20, label:"Browse"});
_root["f"+code].createClassObject(TextInput,"tx_input_1",301,{_x:10, _y:10, _width:330, _height:20});
_root["f"+code].createClassObject(Button,"upload_btn",302,{_x:350, _y:35, _width:65, _height:20, label:"Upload"});
_root["f"+code].createClassObject(ProgressBar,"pb_",333,{_x:10, _y:35, _width:330});
_root["f"+code].pb_.mode = "manual";
_root["f"+code].pb_.label = "%1 out of %2 Uploaded";
_root["f"+code].createClassObject(Label,"label_1",303,{_x:365, _y:65, text:"نوع قالب"});
_root["f"+code].createClassObject(ComboBox,"com_1",304,{_x:270, _y:65, _width:70});
_root["f"+code].com_1.addItem({label:"معمولي", fs:"mamoli"});
_root["f"+code].com_1.addItem({label:"چندتکه", fs:"chandTekE"});
_root["f"+code].createClassObject(Label,"label_2",305,{_x:215, _y:65, text:"سايز چاپ"});
_root["f"+code].createClassObject(ComboBox,"com_2",306,{_x:150, _y:65, _width:65});
_root["f"+code].com_2.addItem({label:"13*18"});
_root["f"+code].createClassObject(Label,"label_3",307,{_x:110, _y:65, text:"تعداد"});
_root["f"+code].createClassObject(NumericStepper,"num_1",308,{_x:40, _y:65, _width:65});
_root["f"+code].num_1.maximum = 100;
_root["f"+code].createClassObject(Label,"label_4",309,{_x:365, _y:95, text:"برش"});
_root["f"+code].createClassObject(ComboBox,"com_4",310,{_x:210, _y:95, _width:130});
_root["f"+code].createClassObject(Label,"label_5",311,{_x:170, _y:95, text:"رنگ"});
_root["f"+code].com_4.addItem({label:"13*18"});
_root["f"+code].createClassObject(ComboBox,"com_5",312,{_x:100, _y:95, _width:65});
_root["f"+code].com_5.addItem({label:"سفيد", data:"sefid"});
_root["f"+code].com_5.addItem({label:"سياه", data:"siah"});
_root["f"+code].createClassObject(TextArea,"deatile_1",313,{_x:10, _y:125, _width:265, _height:110, html:true});
_root["f"+code].createClassObject(Loader,"loader_1",314,{_x:280, _y:125, _width:130, _height:105, scaleContent:true, contentPath:"uploadPRV.jpg"});
_root["f"+code]["browse_btn_"+code].enabled = false;
_root["f"+code]["upload_btn_"+code].enabled = false;
_root["setAS_"+code] = new upload();
_root["setAS_"+code].setAction(code);
}
trace(Number(NM_.value));
main_form.setSize(430,265+Number(NM_.value)*20);
sep_1._y = main_form._y+main_form.height+15;
catch_1._y = main_form._y+main_form.height+35;
};
var rbListener:Object = new Object();
rbListener.click = function(evt_obj:Object) {
if (evt_obj.target.selection.data == 1) {
_root.catch_1.tx_1.enabled = false;
_root.catch_1.tx_2.enabled = true;
} else {
_root.catch_1.tx_2.enabled = false;
_root.catch_1.tx_1.enabled = true;
}
};
// Add listener.
catch_1.radioGroup.addEventListener("click",rbListener);
var lvSend:LoadVars = new LoadVars();
var lvReceive:LoadVars = new LoadVars();
_root.catch_1.submite_btn.onRelease = function() {
lvSend.address = _root.address.text;
lvSend.tell = _root.tell.text;
lvSend.name = _root.name.text;
lvSend.mail = _root.mail.text;
lvSend.type = "";
lvSend.size = "";
lvSend.cut = "";
lvSend.color = "";
lvSend.num = ""
for (i=0; i<(NM_.value); i++) {
code = i+1;
lvSend.type += "/"+_root["f"+code].com_1.selectedItem.fs;
lvSend.size += "/"+_root["f"+code].com_2.value;
lvSend.num = "/"+_root["f"+code].num_1.value;
lvSend.cut += "/"+_root["f"+code].com_4.value;
lvSend.color += "/"+_root["f"+code].com_5.selectedItem.data;
}
lvSend.date = _root.catch_1._3.value+"/"+_root.catch_1._2.value+"/"+_root.catch_1._1.value;
if (catch_1.radioGroup.selection.data == 1) {
lvSend.cost = "fishNUM::"+_root.catch_1.tx_2.text;
} else {
lvSend.cost = "erJaNUM::"+_root.catch_1.tx_1.text;
}
lvSend.links = ssl.text;
lvSend.sendAndLoad("send.php",lvReceive,"POST");
};
lvReceive.onLoad = function(success:Boolean) {
if (success) {
_root.catch_1.tx_1.text = this.result;
if (this.result == "success") {
getURL("success.php");
} else {
///WINK:D
}
}
};
function validateForm():Boolean {
if (mcName.tInput.text == "" || mcSurname.tInput.text == "" || mcAge.tInput.text == "" || mcEmail.tInput.text == "") {
return false;
}
return true;
}
function clearTextFields():Void {
mcName.tInput.text = "";
mcSurname.tInput.text = "";
mcAge.tInput.text = "";
mcEmail.tInput.text = "";
}
function alert(message:String):Void {
getURL("javascript:alert('"+message+"');");
}