For daily doses of
geek stuff @joemaddalone

labs.insert-title.com

ActionScript Form Fields

A handy function for faster form input fields development in Swishmax and Swishscript

The Script

	
function makeField(fname,label,x,y,typ){
    n++;
    typSTR = New String;
    typSTR = typ;
    fieldTXT = new TextFormat();
    fieldTXT.bold = true;
    fieldTXT.size = 10;
    fieldTXT.font = "Verdana";
   _root.createTextField(label,n, x,y-18, 100, 18);
    ref=this[label];
    ref.Text = label;
    ref.border = false;
    ref.setTextFormat(fieldTXT);       
    n++;
    
   _root.createTextField(fname,n, x, y, 100, 18);
    ref=this[fname];
    ref.type = "input";
    ref.border = true;
    ref.setTextFormat(fieldTXT); 
    if (typSTR == "pass"){ref.password = true;}

  
}
OnLoad(){
//makefield(field name, label, x, y, pass?)    
makeField("input_fname","First Name",10,50);
makeField("input_lname","Last Name",150,50);
makeField("input_email","Email Address",10,100);
makeField("input_URL","URL",150,100);
makeField("input_username","Username",10,150);
makeField("input_password","Enter Password",150,150,"pass");
}


}

The Download

Download swish file