0 Replies Latest reply: May 23, 2011 10:15 PM by adii08 RSS

    Server Side Coding query...

    adii08 Community Member

      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