# Access of undefined property problem

**URL:** <https://forum.kirupa.com/t/access-of-undefined-property-problem/287566>\
**Category:** flash\
**Created:** [May 3, 2009, 8:49pm UTC](https://forum.kirupa.com/t/access-of-undefined-property-problem/287566 "2009-05-03T20:49:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![neas](https://avatars.discourse-cdn.com/v4/letter/n/dec6dc/32.png) [@neas](https://forum.kirupa.com/u/neas)\
**Post date:** [May 3, 2009, 8:49pm UTC](https://forum.kirupa.com/t/access-of-undefined-property-problem/287566/1 "2009-05-03T20:49:37Z")

</div>

I keep getting an error with his script that uses amf to write to a db, in a seperate fla it works perfect, but when I import it to my project I get this error.

The error  
1120: Access of undefined property insertBeer\_Result.  
var responder = new Responder(insertHotdog\_Result);

Here is the frame with the script.

```auto
var myService = new NetConnection();
myService.connect("http://localhost.com/amfphp/gateway.php");

hotdogButton.addEventListener("mouseDown", hotdog);
beerButton.addEventListener("mouseDown", beer);
liteButton.addEventListener("mouseDown", lite);
csButton.addEventListener("mouseDown", cs);
popcornButton.addEventListener("mouseDown", popcorn);
sodaButton.addEventListener("mouseDown", soda);

//Result handlers
function hotdog(evt:MouseEvent) {
    var responder = new Responder(insertHotdog_Result);
    //Call the insert titles function
    myService.call("Purchase.insertPurchase", responder, "", "Nick", "Letier", "101", "1", "1", "4", "Hot Dog");

}

insertHotdog_Result = function(msg){
  if(msg=="Ok") {
  //trace("hello")
  } else trace("nope")
};
stop();

```

Two other frames are calling this gateway, Ill add there code.  
Frame 1

```auto
stop();

//Imports
import flash.net.NetConnection;
import flash.net.Responder;
import com.lynda.xml.*;
import com.lynda.php.*;

var myServiceUser = new NetConnection();
myServiceUser.connect("http://localhost.com/amfphp/gateway.php");
var responderUser = new Responder(getUsers_Result, onFault);
myServiceUser.call("Users.getUsers", responderUser);

//Result handlers
function getUsers_Result(rs:Object) {
    //for(var i in rs.serverInfo) trace(i+":"+rs.serverInfo*)
    var cant:Number = rs.serverInfo.totalCount;//how many rows are in our recordset?
    for (var i=0; i<cant; i++) {
        userinfo.text = rs.serverInfo.initialData[0];
    }
}
function onFault(f:Object ) {
    //trace("There was a problem: " + f.description);
}

```

Frame 2

```auto

var myServiceAcc = new NetConnection();
myServiceAcc.connect("http://localhost.com/amfphp/gateway.php");
var responderAcc = new Responder(getAcc_Result, onFault);
myServiceAcc.call("Acc.getAcc", responderAcc);

//Result handlers
function getAcc_Result(rs:Object) {
    //for(var i in rs.serverInfo) trace(i+":"+rs.serverInfo*)
    var cant:Number = rs.serverInfo.totalCount;//how many rows are in our recordset?
    for (var i=0; i<cant; i++) {
        acctinfo.text = rs.serverInfo.initialData[0];
    }
}

```

Can anyone help me out?
