# Convert AS2 to AS3

**URL:** <https://forum.kirupa.com/t/convert-as2-to-as3/274130>\
**Category:** flash\
**Created:** [October 25, 2008, 1:15pm UTC](https://forum.kirupa.com/t/convert-as2-to-as3/274130 "2008-10-25T13:15:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vl390](https://avatars.discourse-cdn.com/v4/letter/v/e5b9ba/32.png) [@vl390](https://forum.kirupa.com/u/vl390)\
**Post date:** [October 25, 2008, 1:15pm UTC](https://forum.kirupa.com/t/convert-as2-to-as3/274130/1 "2008-10-25T13:15:46Z")

</div>

Can anyone help me with converting the following code from AS2 to AS3 ?

//Variables to handle PHP  
var dataOut:LoadVars = new LoadVars();  
var dataIn:LoadVars = new LoadVars();  
//Run this function when Flash receives something back from PHP  
dataIn.onLoad = function() {  
loginBtn.enabled = true;  
var responsetext = this.msgText;  
var email = this.email;  
status\_txt.text = responsetext;  
//If the username and password matches do the following  
if (responsetext == “Entrance Granted!”) {  
//Set global variables so these can be access across any frame  
\_global.emailadd = email;  
\_global.phoneNum = phone;  
//go to the secure area.  
\_parent.gotoAndStop(“protected”);  
}  
};

I would really appreciate it!

Thank you.
