Please help in converting the code to use LOAdVARS so that all code is located on the Main Timeline.Attached are the old file(Addressbok) and what I cureently have converted
(addressbook2)
The code uses on onClipEvent(data) and onClipEvent(Load) which is on the firstframe in:
onClipEvent(data)
{
strName = Name;
strTelephone = Telephone;
strCity = City;
strNotes = Notes;
strPosition = "Record " add String(CurrentRecord+1) add " of " add String(TotalRecords);
}
onClipEvent(load)
{
CurrentRecord = 0;
loadVariables ("getdetails.asp?Record=0", this);
}
The code on the button is
[[FONT=Arial][COLOR=#0000ff]on (release)[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff]{[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff] CurrentRecord++;[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff] if (CurrentRecord == TotalRecords)[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff] CurrentRecord = 0;[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff] loadVariables ("getdetails.asp?Record=" add String(CurrentRecord), this);[/COLOR][/FONT]
[FONT=Arial][COLOR=#0000ff]}[/COLOR][/FONT]
My Code so far as i would like it to be is :
var send_lv:LoadVars = new LoadVars();
send_lv.onLoad = function(success:Boolean):Void {
name_txt.text=send_lv.Name;
telephone_txt.text=send_lv.Telephone;
city_txt.text=send_lv.City;
notes_txt.text=send_lv.Notes;
}
send_lv.sendAndLoad("GetDetails.asp", send_lv, "GET");