views:

437

answers:

3

Hello all

Is it possible to upload a MovieClip as an image to a image hoster such as imageshack or flickr?

If it is possible. Please give direction.

Thank you all

Update

Even if this is possible, would the hoster require the image to exist physically in a file location?

Update 2

I sort of know its possible now. But can someone please give me an outline of how to do this?

A: 

If the hosting service only allows image formats, then no you cannot. MovieClips, despite their identity as an ActionScript object, are still just videos. You can't host them as another format.

Tony k
Ah I see. Is there a way to cast a MovieClip as an Image? Please see update also.
Abs
Nope - MovieClip contains data that cannot be help in an image format. If you wanted to get really tricky, you could convert video data to an animated gif/png, but that's not a simple cast or anything of the sort.
Tony k
With regard to your update, no. An HTTP post is responsible for sending the image data to their server, so the data doesn't need exist in a 'physical' location to respond to that. However, it would pose a serious challenge to try and make your ActionScript send the file data in this manner.
Tony k
Thank you for your replies Anthony. I understand now. :)
Abs
A: 

Yes, it is posible. You can draw a movieclip to a bitmap, and then send the bitmap.

I'm assuming that you don't want to upload a swf file directly to the service, but have the flash aplication send an image.

EDIT:

I think you should find the information you need here: http://henryjones.us/articles/using-the-as3-jpeg-encoder

Lillemanden
Yes your assumptions are correct. Do you have links or tutorials I can have a look at? Many thanks.
Abs
A: 

If you want to upload a bitmap copy of a movieclip, you can do that as Lillemanden said, but if you want to upload a swf file, as Anthony Kanago said, it depends on the hosting service.

A really weird and long work around would be to a bitmap copy of a movieclip on a hosting service and a xml or sql entry on your server which will hold the details of the animation, if any( tweens, porperties, symbols, etc. ) and have that linked to the url of the uploaded image so you could offer a 'click here to view animation' link. When the user clicks the jpeg, you will redirect to a swf that will playback the right swf according to the image originally clicked.

A more 'realistic' answer would be encoding the swf animation as a gif using actionscript. There is a handy library here:

http://www.bytearray.org/?p=93

I tried it and it's pretty easy to use.

George Profenza