Skip navigation
adii08
Currently Being Moderated

Server Side Coding query...

May 23, 2011 10:15 PM

Hi,

 

I am new in php coding. I want to get image data from php and also display in flash.

I want to know... how to read and display imagejpeg( $imgData ); from php.

 

I am able to get php data in flash through below method...

 

/* AS3 */------------------

 

var src:String = "pic.jpg";

var width:String = "250";

var height:String = "250";

 

var urlReq:URLRequest = new URLRequest(src);

var urlLoader:URLLoader = new URLLoader();

 

var urlVar:URLVariable = new URLVariable();

urlVar.src= src;

 

urlReq.mehtod = URLRequestMethod.POST;

urlReq.data = urlVar;

 

urlLoader.load ( urlReq );

urlLoader.addEventListener(Event.Complete, doneProcFnc)

 

function doneProcFnc(ev:Event):void{

      trace ( "data access from php done" );

}

 

------------/*   */

 

/* PHP */

 

$src = $_POST [ 'src' ];

$wd = $_POST [ ' width' ];

$ht = $_POST [ ' height' ];

 

/*  this function will create one black color area for croping refence */

$cropImg = imagecreatetruecolor ( cropImageWd, cropImageHt );

 

/* this function will reproduce particular image required width and height without reducing the image quality */

imagecopyresampled ( cropImage , sourceImage, destX , destY, sourX, sourY, ect... );

 

 

imagejpeg( $imgData ) ;

 

------------------/* */

 

Now, here the problem comes. I don't know how to display that imagejpeg data into flash.


I need help.

Thanks.

 

Message was edited by: adiiDv

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points