[Resloved]
OK I set up a simple command to send a 1 to my server. I call the function change() to send the information. If I call this prior to the loop it works fine. If I call the function after I click a pic I get this error: Failed to send HTTP async request, HTTP ID 10001 does not exist at line 77 in root. I can't figure out why it works when I just call it but not when I call it from a touch.
global httpconn
global HTTPRequestPending = 0
httpconn = createHttpConnection()
connect = setHTTPHost(httpconn,"www.kobaltic.com",0)
change()
rem A Wizard Did It!
do
if GetPointerPressed ( ) = 1
hit = GetSpriteHit ( GetPointerX ( ), GetPointerY ( ) )
endif
if ( hit = fireballcard )
change()
endif
Print("hello world")
print (httpconn)
If HTTPRequestPending = 1
If GetHTTPResponseReady(httpconn) = 1
// If the response includes data, you can store it
data$ = GetHTTPResponse(httpconn)
// Close HTTP Connection
HTTPRequestPending = 0
CloseHTTPConnection(httpconn)
DeleteHTTPConnection(httpconn)
Endif
Endif
print(data$)
Sync()
loop
function change()
site$ = "agk/transfer.php"
var$ = "update=" + str(1) <--- error here
sendHTTPRequestASync(httpconn, site$, var$)
HTTPRequestPending = 1
endfunction