VideoHive

Can Flash Do This ?

607 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • India
  • Referred between 1 and 9 users
sanju1979 says

Upload Image

Auto Import Same Image on stage

Crop ( draw the crop area ..runtime ) n Resize ( save resized size )

Save .png temporary

Auto Import Same PNG on stage

Is it possible? Has anyone done this? Can anyone do this ?

1234 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Sold between 50 000 and 100 000 dollars
  • United States
MBMedia says

AS3 – BitmapData class and Adobe’s PNG writing class. To save the image you’ll need PHP to do the actual saving and for the uploading process though, but I’ve done similar things with Flash, yes.

690 posts
  • Bought between 10 and 49 items
  • Canada
  • Exclusive Author
  • Has been a member for 6-7 years
  • Sold between 1 000 and 5 000 dollars
geoken says

You can upload an image, then either wait for it to finish and read it off the server or, if flash 10 is an option, read it strait from disk.

You can then encode it to png using the png encoding class from as3corelib ( http://code.google.com/p/as3corelib/ ), save it to the server, then read it back.

607 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • India
  • Referred between 1 and 9 users
sanju1979 says

thanks so much guys..

i have done with flie reference as2 the upload and import..

problem is drawing crop region and save png ??? any assistance would be highly appreciated….

1234 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Sold between 50 000 and 100 000 dollars
  • United States
MBMedia says

drawing the crop region needs to use the BitmapData class.

saving the png means converting the BitmapData you end up with to a ByteArray in png format (using the class geoken was pointing to) and sending the ByteArray to a PHP file to save. I don’t know of any AS2 way to accomplish the saving PNG part unless you do most of it on the PHP side of things.

7322 posts
  • Attended a Community Meetup
  • Community Moderator
  • Has been a member for 5-6 years
  • United Kingdom
  • Contributed a Tutorial to a Tuts+ Site
  • Won a Competition
  • Contributed a Blog Post
  • Beta Tester
  • Bought between 50 and 99 items
+4 more
MSFX moderator says

yeah here’s where AS3 becomes a god :p I think I remember something like this on the actionscript.org forums a few years ago, some clever fool managed a work around, hard work though…

Why not use AS3 , porting what you’ve got wont be too hard…

607 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • India
  • Referred between 1 and 9 users
sanju1979 says

i am unable to find any tutorials using as3 and php ??? and whoever is spending time to pst in here..thanks a ton..u never know…which idea will click ;)

410 posts
  • Argentina
  • Beta Tester
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Sold between 10 000 and 50 000 dollars
Random says

you can do it with as2 and php I have done something simmilar before

1234 posts
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
  • Sold between 50 000 and 100 000 dollars
  • United States
MBMedia says

I’ve seen it too, the PHP does the majority of the work though, cuz AS2 is kinda lackluster for that kind of stuff, working with binary, ect.

2470 posts Nice Guy
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 5-6 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 200 and 499 users
+4 more
RubenBristian says
Yes you can do this. The cropping is real simple and that part can be done from as2. About the exporting of images ..
Sephirot has a cool tutorial on how to do that, and you can also download the whole script(php+fla+as). Link here : http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php

Another cool script that exists on the web(but free only for personal use) is Quasimodo’s BitmapExporter. This is the best app that exports image files from flash i think. I used it a while ago and it worked perfect. Download link : http://www.quasimondo.com/scrapyard/BitmapExporter_v22.zip

With any of those classes you simply have to define a rectangle box for the newly cropped image. So use the BitmapData class to crop your uploaded image, then export it to an image using on of those classes

by
by
by
by
by