views:

27

answers:

2

Hi guys,

I would like to know if it is at all possible for AS3 to grab header information and process it?

I am trying to avoid having to use PHP to get the information, then store it in a DB, give it to flash, then go and delete it again, or something alike.

Basically the flash is waiting for three variables that get sent through the URL, right when it gets initialized, then once it gets those variables, it can determine where to go next.

This is for a Facebook application, and I am using FBML to embed the flash.

Thanx in advance!

A: 

Your question is a bit misleading, you ask if Flash can retrieve header info , but you actually mention sending variables via the URL.

As far as the URL vars are concerned, Flash can retrieve these values , check this article:
http://www.permadi.com/tutorial/flashQueryString/

This being said, were you to use PHP, you wouldn't need to store the data in a database unless you wished to access it again at a later date.

Try googling Flash PHP communication , there should be a lot of info out there!

PatrickS
+2  A: 

For AIR Only you can use the httpResponseStatus. Otherwise in Flash/Flex without AIR you cannot.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html#event:httpResponseStatus

httpResponseStatus Event
Event Object Type: flash.events.HTTPStatusEvent HTTPStatusEvent.type property = flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS

Language Version : ActionScript 3.0 Runtime Versions : AIR 1.0 AIR 1.0

Dispatched if a call to the load() method attempts to access data over HTTP, and Adobe AIR is able to detect and return the status code for the request. Unlike the httpStatus event, the httpResponseStatus event is delivered before any response data. Also, the httpResponseStatus event includes values for the responseHeaders and responseURL properties (which are undefined for an httpStatus event. Note that the httpResponseStatus event (if any) will be sent before (and in addition to) any complete or error event.

Found at :

http://stackoverflow.com/questions/2277650/unable-to-get-http-response-code-headers-in-actionscript-3

Michael Eakins