开发者

How can I import raw binary data into an image in Actionscript 2.0/Flash 8?

开发者 https://www.devze.com 2022-12-16 23:29 出处:网络
Let me preface this by saying that I am something of an actionscript newbie. We have a system that allows a user to upload any image, which we store on the server.Of course, it is simple to load an i

Let me preface this by saying that I am something of an actionscript newbie.

We have a system that allows a user to upload any image, which we store on the server. Of course, it is simple to load an image (that you know the path to) using loadMovie, but I also want to load certain pieces of meta data about the image that is precalculated and stored on the server; we may one day want to retrieve things completely unrelated to the image as well, so consider the non-image data to be arbitrary.

So, that said, is there a way to simply return the image as a variable (urlencoded and returned in a loadVars request, perhaps) and then load that data into a movie clip?

Bonus Lightning Round Question: Is there a way to check the output of a PHP script which processes uploads when the request is sent via FileReference.upload(url:String)? Should I load/escape the binary data and then send 开发者_如何学JAVAit using a loadVars() request if I want to see the output?


I don't think you need to import the image as 'raw binary data' - you can just store a URL (ie a string) of the path and filename of your image file. Then use the string as an argument to loadMovie (or better still MovieClipLoader.loadClip()) to display the image in your movieClip.

You could call loadVars to get the URL (and your metadata) from a database.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号