send and load

_global.relRT = this;
relRT.errorMsg.text = “”;
//Trim Function – Right and Left Trim
function ltrim(matter) {
if ((matter.length>1) || (matter.length == 1 && matter.charCodeAt(0)>32 && matter.charCodeAt(0)<255)) {
i = 0;
while (i<matter.length && (matter.charCodeAt(i)<=32 || matter.charCodeAt(i)>=255)) {
i++;
}
matter = matter.substring(i);
} else {
matter = “”;
}
return matter;
}
function rtrim(matter) {
if ((matter.length>1) || (matter.length == 1 && matter.charCodeAt(0)>32 && matter.charCodeAt(0)<255)) {
i = matter.length-1;
while (i>=0 && (matter.charCodeAt(i)<=32 || matter.charCodeAt(i)>=255)) {
i–;
}
matter = matter.substring(0, i+1);
} else {
matter = “”;
}
return matter;
}
function trim(matter) {
return ltrim(rtrim(matter));
}
//Submit function
btn_Submit.onRelease = function() {
//customer info
var fname = trim(relRT.fname.text);
var lname = trim(relRT.lname.text);
var mname = trim(relRT.mname.text);
var address1 = trim(relRT.address1.text);
var address2 = trim(relRT.address2.text);
var telno = trim(relRT.telno.text);
//login information
var username = trim(relRT.username.text);
var password1 = trim(relRT.password1.text);
var confirmpassword = trim(relRT.confirmpassword.text);
if (fname eq “”) {
message = “Please input required field, enter first name.”;
} else if (lname eq “”) {
message = “Please input required field, enter last name.”;
} else if (address1 eq “”) {
message = “Please input required field, enter address1.”;
} else if (username eq “”) {
message = “Please input required field, enter username.”;
} else if (password1 eq “”) {
message = “Please input required field, enter password.”;
} else {
if (password1 eq confirmpassword) {
dat = new LoadVars();
dat.fname = fname;
dat.lname = lname;
dat.mname = mname;
dat.address1 = address1;
dat.address2 = address2;
dat.telno = telno;
dat.username = username;
dat.password1 = password1;

dat.sendAndLoad(“http://localhost/flash/insertdata.php&#8221;, dat, “POST”);
dat.onLoad = function(success:Boolean) {
if (success) {
//_root.gotoAndPlay(1);
} else {
_root.gotoAndPlay(2);
_root.clip2._visible = true;
}
};

} else {
message = “Password does not match.”;
}
}
relRT.errorMsg.text = message;
};

Scrollbar with intertia Actionscript 2.0

var item_title:Array = new Array();
var item_url:Array = new Array();
var item_description:Array = new Array();
var total:Number;
var i:Number = 0;
var p:Number = 0;
var item_spacing:Number = 10;
var scrolling_speed:Number = 0.30; // 0.00 to 1.00
var cv:Number = 0;
var cv_old:Number = 0;
var on_drag:Boolean;
var xml:XML = new XML();
item_list_area._visible = false;
item_list.setMask(item_mask);
stop();

xml.onLoad = function()
{
item_list.fm_item._visible = false;
var nodes = this.firstChild.childNodes;
total = nodes.length;

for( i = 0; i < total; i++)
{
item_title[i] = nodes[i].attributes.title;
item_url[i] = nodes[i].attributes.url;
item_description[i] = nodes[i].attributes.description;
}
create_item_list();
scroller();
}
xml.load( “flashmo_077_news.xml” );
xml.ignoreWhite = true;
function create_item_list():Void
{
for( i = 0; i < total; i++)
{
var item = item_list.fm_item.duplicateMovieClip(“fm_item”+i, i);
item._y = i * (item_list.fm_item._height + item_spacing);
item.item_title.text = item_title[i];
item.item_description.text = item_description[i];
item.no = i;

item.item_button.onRelease = function()
{
getURL(item_url[this._parent.no]);
}
}
}
function scroller():Void
{
scroller_mc._y = scrollable_area_mc._y;
item_list._y = item_list_area._y;
sr = item_list_area._height/item_list._height;
scroller_mc._height = scrollable_area_mc._height * sr;
sd = scrollable_area_mc._height – scroller_mc._height;
cd = item_list._height – item_list_area._height;
cr = cd / sd;

if( item_list._height <= item_list_area._height )
{
scroller_mc._visible = scrollable_area_mc._visible = false;
}
else
{
scroller_mc._visible = scrollable_area_mc._visible = true;
}
scroller_mc.onPress = function()
{
this.startDrag(false, this._x, scrollable_area_mc._y, this._x,
scrollable_area_mc._y + scrollable_area_mc._height – this._height);
on_drag = true;
this.onEnterFrame = function()
{
new_y = item_list_area._y + scrollable_area_mc._y*cr – this._y*cr;
cv = (new_y – item_list._y) * scrolling_speed;
item_list._y += cv;
if( on_drag == false && cv_old == cv )
delete this.onEnterFrame;
cv_old = cv;
}
}
scroller_mc.onRelease = scroller_mc.onReleaseOutside = function()
{
this.stopDrag();
on_drag = false;
}
}