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

Answers


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.


This feature has just been added in Flash Player 10 / Flash CS4, so if you can use that you can do it.


Need Your Help

How do I load multiple XML files and read them?

c# .net xml directory

I've a problem. In my code I'm looking for all xml files in one directory. Finally it works but I don't know how to read them. A single one is loaded with the string xmlFile. I think I need to repl...

JRibbon - How to place the the minimize, maximize, close button and title bar on top of the JRibbon?

java look-and-feel flamingo

I'm starting to create a Java Swing project using JRibbonFrame and JRibbon from pushingpixels. I noticed in the tutorial that the sample app containing the JRibbon is undecorated and the title bar,

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.