Send Variable Data from Action Script 3 to JavaScript

Since my AS3 and Php/Java knowledge is not good I got stuck on this problem. I have a AS3 function that sends bitmap data to PHP file to save some image, and in this function I also added some other arguments and that new argument should give me a string value that i need. private function saveImageForFacebook(evt:MouseEvent) // Sends the Bitmap data to php { var bitmapData:BitmapData=new BitmapData(wheelCanvas.width, wheelCanvas.height); bitmapData.draw(wheelCanvas); var jpgEncoder:JPGEncoder = new JPGEncoder(80); var byteArray:ByteArray = jpgEncoder.encode(bitmapData); var header:URLRequestHeader = new URLRequestHeader ("Content-type", "application/octet-stream"); var jpgURLRequest:URLRequest = new URLRequest ("http://www.someurl.com/flash-test/saveimg.php"); jpgURLRequest.requestHeaders.push(header); jpgURLRequest.method = URLRequestMethod.POST; jpgURLRequest.data = byteArray; navigateToURL(jpgURLRequest, "_blank"); // Creates the string value that I need to use in saveimg.php var suffixUrl:String = ""; for(var i:int=0; i < customizedColorArr.length; i++) { if(customizedColorArr[i] != "") { suffixUrl += "&" + customizedPartValueArr[i] + "=" + customizedColorArr[i]; } } suffixUrl = wheelName + "&variant_name=" + variantName + suffixUrl; trace(suffixUrl); } Somehow I need to trace "suffixUrl" value in my saveimg.php file, but i don't know how. This is how my php file looks and where suffixUrl need to go. You will see "suffixUrl" in my javascript function. That's where I'm trying to treace that value.

以上就是Send Variable Data from Action Script 3 to JavaScript的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏