You are currently browsing the category archive for the ‘AS3’ category.

Interesting game tutorials here

http://www.gotoandplay.it/_articles/

Interesting example here

http://flashscript.ca/set-registration-as3.php

A quite good open source flash video player

http://flowplayer.org/index.html

Doing this, you need as3 core library and specify the library path in  flash preference.
as3 code:
var jpgEncoder:JPGEncoder = new JPGEncoder(85);
var jpgStream:ByteArray = jpgEncoder.encode(bitmapData);
var header:URLRequestHeader = new URLRequestHeader(“Content-type”, “application/octet-stream”); //use binary mode
var jpgURLRequest:URLRequest = new URLRequest(“url.php?parameters…”);
jpgURLRequest.requestHeaders.push(header);
jpgURLRequest.method = URLRequestMethod.POST;
jpgURLRequest.data = jpgStream;
navigateToURL(jpgURLRequest, “_blank”);

var header:URLRequestHeader = new URLRequestHeader(“Content-type”, “application/octet-stream”); var jpgURLRequest:URLRequest = new URLRequest(“http://kurisi3.no-ip.org/test/storejpg/save_jpg.php?name=sketch.jpg”); jpgURLRequest.requestHeaders.push(header); jpgURLRequest.method = URLRequestMethod.POST; jpgURLRequest.data = jpgStream; navigateToURL(jpgURLRequest, “_blank”);

PHP code here

if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))

{

$fname = $_GET["name"];

// get bytearray

$jpgData = $GLOBALS["HTTP_RAW_POST_DATA"];

//save jpg file

$fp = fopen($fname,”w+”);

fwrite($fp, $jpgData);

fclose($fp);

// add headers for download dialog-box

header(‘Content-Type: image/jpeg’);

header(“Content-Disposition: attachment; filename=$fname”);

print $fname;

}

else print “no raw data received”;

Categories

Blog Stats

  • 14,422 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other followers

Follow

Get every new post delivered to your Inbox.