home *** CD-ROM | disk | FTP | other *** search
/ Adephia Powerlink / AdephiaPowerlink-030102.iso / pc / Install / WorkFlow / Gui / UsrInput.swf / scripts / frame_3 / DoAction.as
Encoding:
Text File  |  2002-04-02  |  13.1 KB  |  136 lines

  1. function LayoutFrame()
  2. {
  3.    _root.ListBoxSelected = true;
  4.    _root.InputsComplete = false;
  5.    _level0.SetText("Title0",_root.UserAccountInfo1_main_title,_root.UserAccountInfo1_Identifier);
  6.    _level0.SetText("Text10",_root.UserAccountInfo1_main_textinput_username_autofill_append,_root.UserAccountInfo1_Identifier);
  7.    this.nFNameID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_firstname,_root.first_name,_root.UserAccountInfo1_hint_p_firstname,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_firstname_regexp_value,true,_root.UserAccountInfo1_Identifier);
  8.    this.nLNameID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_lastname,_root.last_name,_root.UserAccountInfo1_hint_p_lastname,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_lastname_regexp_value,true,_root.UserAccountInfo1_Identifier);
  9.    this.nPhoneNumID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_phonenumber,_root.phone_number,_root.UserAccountInfo1_hint_p_phonenumber,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_phonenumber_regexp_value,true,_root.UserAccountInfo1_Identifier);
  10.    this.nAddressID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_address,_root.address,_root.UserAccountInfo1_hint_p_address,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_address_regexp_value,true,_root.UserAccountInfo1_Identifier);
  11.    this.nCityID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_city,_root.city,_root.UserAccountInfo1_hint_p_city,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_city_regexp_value,true,_root.UserAccountInfo1_Identifier);
  12.    this.nStateID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_state,_root.state,_root.UserAccountInfo1_hint_p_state,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_state_regexp_value,true,_root.UserAccountInfo1_Identifier);
  13.    this.nZipCodeID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_zipcode,_root.zip_code,_root.UserAccountInfo1_hint_p_zipcode,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_zipcode_regexp_value,true,_root.UserAccountInfo1_Identifier);
  14.    this.nUserNameID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_username,_root.user_name,_root.UserAccountInfo1_hint_p_username,_root.UserAccountInfo1_hint_p_default,false,_root.UserAccountInfo1_main_textinput_username_regexp_value,true,_root.UserAccountInfo1_Identifier,true);
  15.    this.nPasswordID = _level0.ShowInputBox(_root.UserAccountInfo1_main_p_password,_root.password,_root.UserAccountInfo1_hint_p_password,_root.UserAccountInfo1_hint_p_default,true,_root.UserAccountInfo1_main_textinput_password_regexp_value,true,_root.UserAccountInfo1_Identifier);
  16.    _level0.SetHintText(_root.UserAccountInfo1_hint_p_default,_root.UserAccountInfo1_Identifier);
  17.    _level0.SetHelpText(_root.UserAccountInfo1_help_p_default,_root.UserAccountInfo1_Identifier);
  18.    var CancelButton = _level0.RequestButton("CancelBtn","CancelButtonPlacement",_root.UserAccountInfo1_Identifier);
  19.    var MoreButton = _level0.RequestButton("MoreBtn","MoreButtonPlacement",_root.UserAccountInfo1_Identifier);
  20.    _root.NextBtn = _level0.RequestButton("NextBtn","NextButtonPlacement",_root.UserAccountInfo1_Identifier);
  21.    CancelButton.TextBox.Text = _root.UserAccountInfo1_nav_button_cancel;
  22.    MoreButton.TextBox.Text = _root.UserAccountInfo1_nav_button_more;
  23.    _root.NextBtn.TextBox.Text = _root.UserAccountInfo1_nav_button_next;
  24.    CancelButton.OnRelease = function()
  25.    {
  26.       CancelButtonAction();
  27.    };
  28.    MoreButton.OnRelease = function()
  29.    {
  30.       _level0.ToggleHelp(_root.UserAccountInfo1_Identifier);
  31.    };
  32.    _root.NextBtn.OnRelease = function()
  33.    {
  34.       NextButtonAction();
  35.    };
  36.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nFNameID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  37.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nLNameID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  38.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nPhoneNumID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  39.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nAddressID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  40.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nCityID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  41.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nStateID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  42.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nZipCodeID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  43.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nUserNameID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  44.    _level0.AddTabOrder(_level0.GetInputFieldPath(this.nPasswordID,_root.UserAccountInfo1_Identifier),_root.UserAccountInfo1_Identifier);
  45.    _level0.AddTabOrder("NextBtn",_root.UserAccountInfo1_Identifier);
  46.    _level0.AddTabOrder("CancelBtn",_root.UserAccountInfo1_Identifier);
  47.    _root.NextBtn.DefaultDisabled = 1;
  48. }
  49. function LoadUserAccountInfo1Vars()
  50. {
  51.    _root.UserAccountInfo1_Identifier = _level0.SetLayoutObject("Usi",_target,"LayoutFrame",_root.UserAccountInfo1_Identifier);
  52. }
  53. function OnSelectionChange(pSelection)
  54. {
  55.    _level0.SetText("Text0",_root.UserAccountInfo1_main_p_default add " " add pSelection.Item,_root.UserAccountInfo1_Identifier);
  56.    _root.state_selection = pSelection.Item;
  57.    if(pSelection)
  58.    {
  59.       _root.ListBoxSelected = true;
  60.    }
  61.    if(_root.InputsComplete)
  62.    {
  63.       _root.NextBtn.SetDisabled(false);
  64.    }
  65. }
  66. function OnValidInputs(bValid)
  67. {
  68.    if(bValid)
  69.    {
  70.       _root.InputsComplete = true;
  71.       if(_root.ListBoxSelected)
  72.       {
  73.          _root.NextBtn.SetDisabled(false);
  74.       }
  75.    }
  76.    else
  77.    {
  78.       _root.InputsComplete = false;
  79.       _root.NextBtn.SetDisabled(true);
  80.    }
  81. }
  82. function InputsValid()
  83. {
  84.    _root.first_name = _level0.GetInputReference(this.nFNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  85.    _root.last_name = _level0.GetInputReference(this.nLNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  86.    _root.full_name = _root.first_name add " " add _root.last_name;
  87.    _root.phone_number = _level0.GetInputReference(this.nPhoneNumID,_root.UserAccountInfo1_Identifier).GetInputText();
  88.    _root.address = _level0.GetInputReference(this.nAddressID,_root.UserAccountInfo1_Identifier).GetInputText();
  89.    _root.city = _level0.GetInputReference(this.nCityID,_root.UserAccountInfo1_Identifier).GetInputText();
  90.    _root.state = _level0.GetInputReference(this.nStateID,_root.UserAccountInfo1_Identifier).GetInputText();
  91.    _root.zip_code = _level0.GetInputReference(this.nZipCodeID,_root.UserAccountInfo1_Identifier).GetInputText();
  92.    _root.user_name = tempCheckName;
  93.    _root.password = _level0.GetInputReference(this.nPasswordID,_root.UserAccountInfo1_Identifier).GetInputText();
  94.    _level0.FireSignal(_root.UserAccountInfo1_Identifier,"next");
  95. }
  96. function CancelButtonAction()
  97. {
  98.    _root.first_name = _level0.GetInputReference(this.nFNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  99.    _root.last_name = _level0.GetInputReference(this.nLNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  100.    _root.full_name = _root.first_name add " " add _root.last_name;
  101.    _root.phone_number = _level0.GetInputReference(this.nPhoneNumID,_root.UserAccountInfo1_Identifier).GetInputText();
  102.    _root.address = _level0.GetInputReference(this.nAddressID,_root.UserAccountInfo1_Identifier).GetInputText();
  103.    _root.city = _level0.GetInputReference(this.nCityID,_root.UserAccountInfo1_Identifier).GetInputText();
  104.    _root.state = _level0.GetInputReference(this.nStateID,_root.UserAccountInfo1_Identifier).GetInputText();
  105.    _root.zip_code = _level0.GetInputReference(this.nZipCodeID,_root.UserAccountInfo1_Identifier).GetInputText();
  106.    _root.user_name = _level0.GetInputReference(this.nUserNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  107.    _root.password = _level0.GetInputReference(this.nPasswordID,_root.UserAccountInfo1_Identifier).GetInputText();
  108.    _level0.FireSignal(_root.UserAccountInfo1_Identifier,"exit");
  109. }
  110. function NextButtonAction()
  111. {
  112.    appendVar = _root.UserAccountInfo1_main_textinput_username_autofill_append;
  113.    appendLength = -1 * appendVar.length;
  114.    tempUserName = _level0.GetInputReference(this.nUserNameID,_root.UserAccountInfo1_Identifier).GetInputText();
  115.    if(tempUserName.slice(appendLength) == appendVar)
  116.    {
  117.       tempCheckName = tempUserName.slice(0,appendLength);
  118.    }
  119.    else
  120.    {
  121.       tempCheckName = tempUserName;
  122.    }
  123.    var arRegExpArray = new Array();
  124.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nFNameID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nFNameID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_firstname_regexp_errorhint,_root.UserAccountInfo1_main_textinput_firstname_regexp_errorhelp,_level0.GetInputFieldPath(this.nFNameID,_root.UserAccountInfo1_Identifier)));
  125.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nLNameID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nLNameID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_lastname_regexp_errorhint,_root.UserAccountInfo1_main_textinput_lastname_regexp_errorhelp,_level0.GetInputFieldPath(this.nLNameID,_root.UserAccountInfo1_Identifier)));
  126.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nPhoneNumID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nPhoneNumID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_phonenumber_regexp_errorhint,_root.UserAccountInfo1_main_textinput_phonenumber_regexp_errorhelp,_level0.GetInputFieldPath(this.nPhoneNumID,_root.UserAccountInfo1_Identifier)));
  127.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nAddressID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nAddressID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_address_regexp_errorhint,_root.UserAccountInfo1_main_textinput_address_regexp_errorhelp,_level0.GetInputFieldPath(this.nAddressID,_root.UserAccountInfo1_Identifier)));
  128.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nCityID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nCityID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_city_regexp_errorhint,_root.UserAccountInfo1_main_textinput_city_regexp_errorhelp,_level0.GetInputFieldPath(this.nCityID,_root.UserAccountInfo1_Identifier)));
  129.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nStateID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nStateID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_state_regexp_errorhint,_root.UserAccountInfo1_main_textinput_state_regexp_errorhelp,_level0.GetInputFieldPath(this.nStateID,_root.UserAccountInfo1_Identifier)));
  130.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nZipCodeID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nZipCodeID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_zipcode_regexp_errorhint,_root.UserAccountInfo1_main_textinput_zipcode_regexp_errorhelp,_level0.GetInputFieldPath(this.nZipCodeID,_root.UserAccountInfo1_Identifier)));
  131.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nPasswordID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nPasswordID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_password_regexp_errorhint,_root.UserAccountInfo1_main_textinput_password_regexp_errorhelp,_level0.GetInputFieldPath(this.nPasswordID,_root.UserAccountInfo1_Identifier)));
  132.    arRegExpArray.push(_level0.CreateRegularExpressionObject(tempCheckName,_level0.GetInputReference(this.nUserNameID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_username_regexp_errorhint,_root.UserAccountInfo1_main_textinput_username_regexp_errorhelp,_level0.GetInputFieldPath(this.nUserNameID,_root.UserAccountInfo1_Identifier)));
  133.    arRegExpArray.push(_level0.CreateRegularExpressionObject(_level0.GetInputReference(this.nEmailAddressID,_root.UserAccountInfo1_Identifier).GetInputText(),_level0.GetInputReference(this.nEmailAddressID,_root.UserAccountInfo1_Identifier).GetRegExp(),_root.UserAccountInfo1_main_textinput_emailaddress_regexp_errorhint,_root.UserAccountInfo1_main_textinput_emailaddress_regexp_errorhelp,_level0.GetInputFieldPath(this.nEmailAddressID,_root.UserAccountInfo1_Identifier)));
  134.    _level0.CheckRegularExpressions(arRegExpArray,this,"InputsValid",_root.UserAccountInfo1_Identifier);
  135. }
  136.