Wednesday, March 16, 2011

Possible to import an image into AS3 without PHP?

In actionscript 3 is it possible to allow a user to upload an image into a flash movie at runtime without POSTing to a PHP script? I dont want to export the image or save it anywhere I just want to be able to display the image in the flash movie

fingers crossed

From stackoverflow
  • The flash developer at work, seems to believe that it is not possible. That said you don't have to use PHP, you could use any server side technology that allows uploading (ASP.NET, Python, etc)

    John Burton : It is possible in flash player 10 which is newly released
  • This feature has just been added in Flash Player 10 / Flash CS4, so if you can use that you can do it.

  • Yes, you can if you are targeting Flash Player 10. Use the FileReference.load() method. Once the file is loaded, you can access to the raw data as a ByteArray, using the data property. In flex you can pass that to an Image component. In plain Actionscript, you can use the Loader.loadBytes() method to the display the loaded image.

0 comments:

Post a Comment