Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8120593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T05:11:59+00:00 2026-06-06T05:11:59+00:00

Since my AS3 and Php/Java knowledge is not good I got stuck on this

  • 0

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.

    <?php
    if ( isset ( $GLOBALS["HTTP_RAW_POST_DATA"] )) {
    $uniqueStamp = date(U);
    //$filename = "temp_image.jpg";
    $filename = $uniqueStamp . ".jpg";
    $fp = fopen( $filename,"wb");
    $result = fwrite( $fp, $GLOBALS[ 'HTTP_RAW_POST_DATA' ] );
    fclose( $fp );

    }
    ?>
    <meta property="og:image" content="http://www.someurl.com/flash-test/src_server/<?php echo $filename ; ?>" /> 
 <SCRIPT LANGUAGE="JavaScript">
     function redirect () {
     window.location.href = "http://www.facebook.com/sharer.php?u=http://www.someurl/flash-test/Main3D.html?"+suffixUrl, '_self';
}
 </SCRIPT>
   <BODY onload="redirect()">

You will see “suffixUrl” in my javascript function. That’s where I’m trying to treace that value.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T05:11:59+00:00Added an answer on June 6, 2026 at 5:11 am

    You don’t want to send a variable to Javascript; you want to send a variable to PHP.

    Move the suffix generation code block above the Bitmap sending part, and then change this line.

    var jpgURLRequest:URLRequest = new URLRequest ("http://www.someurl.com/flash-test/saveimg.php?suffixUrl=" + suffixUrl);
    

    Then, in the PHP

    window.location.href = "http://www.facebook.com/sharer.php?u=http://www.someurl/flash-test/Main3D.html?" + <?php echo $_GET['suffixUrl'] ?>, '_self';
    

    This will work, but you will also have to sanitize the input for security.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since the advent of AS3 I have been working like this: private var loggy:String;
I have the following problem in AS3. I have a string like this one:
This is something that has been bugging me since I took up AS3 a
Since this function is implemented in IE8, I wanted to see exactly what I
I've downloaded the JAVA Eclipse IDE and started learning Java. I have a good
I am using AS3 to create a tween affect between multiple images that have
Since AS3 does not allow private constructors, it seems the only way to construct
I'm building an animation in flash and as3, I have a function in which
This may be obvious but it's been ages since I used flash. I have
Does AS3 have a way to output the physical name of a key that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.