Flash Screen / Stage capture and email

I'm looking to email a screen capture of a movieclip / or just the flash stage. There will be
different images loaded as it's a slideshow. I would like the user to be able to right click and
have the option to send the file directly to their mail program. If I can't do this, then at the least be able to save it to the desktop.
I know you trace a bitmap, but I'm not real sure how to do that... any ideas?

I found this half page tutorial. I have all this code in, but still confused on how to make it function:
Who is Participating?
can't Slideshow pro load in SWF files as well?  if so, you can put modular code in each of those that can send a movieclip to print or screen capture or what every you want...

yeah, I am not sure what the last comment is in reference to in your application... and I believe it is against the rules to email the files directly to a person...  unfair advantage and all.

the screen capture can still work, if you are willing to go that route, but you need to be able to interpret the programming of the Actionscript and any server side code that is needed.

I would image the applicaiton works like this though...  

- You click a button
- you give the user a prompt to enter an email address or two to send the document to
- flash sends the image along with the email detail to the server
- server sends an email to the recipient with the location of the image on the web server for download.

depending on how large the image is, you might be able to use the getPixel method... but there are code optimizations that can be done to make it better.

let me know what you are wanting to do...

rp / ZA

Basicly, In flash you need to use BitmapData class and get pixel data. After that you need to send the data to a php which generates the images and sends as e-mail attachment.
Here is a great example for saving jpeg from swf:
Also a tutorial:
Briefly it's flash+actionscript+php (or aspx) work...
There is a problem with the bitmap solution, that may or may not be something that you are concerned about. The sephiroth version of this will allow you to do what you want with very small movieclips... like 100 x 200... anything larger than that is very processor intensive, and typically will make the user wait about 5 or more seconds before anything happens.
Because here is what needs to happen... a for loop is run for every pixel in the image, and you much combine TWO for loops to navigate across the image and then down to the next row of pixels... so this means the getPixel code is run 20,000 times for a smaller image... now you can see how increasing the isze of the image can make this code extremely processor intensive... for say a 500 x 500 movieclip... 250,000 iterations of a for loop is going to halt a system for about 20 seconds I would think.... which is not acceptable in my opinion... So this limits the size of the movieclip you want to turn into a screen grab. There are other .NET solutions and also AS 3.0 classes that you can look into to help with the processing time, but that may be a bit over your head (assuming your skill level is intermediate). If you are still interested in the AS 3 .NET solution, I can look around for it, but there might be a better way to do what you want...

One other option is to turn the movieClip into a PDF or possibly use Flash paper... this allows the user to do what ever they want with the document, and I believe the processing for this solution has less overhead than collecting pixel data and sending that hex value off to a PHP method somewhere... which brings about the issue of how much data can be sent over to your server in one chunk...

let me know what direction you would prefer to go...

rp / Zone Advisor

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

crittle1Author Commented:
Intermediate I am, lol. I think a pdf is great. My situation is that I'm using a component for the slideshow. When the image is rolled over, it enlarges. The client wants to be able to grab the large image and email it to potential buyers. I can't add code to the existing component, so I was trying to find a work around like a button that takes a screen capture. It's ok to have it a pdf / jpg or whatever. I just don't want to start over and code it from the ground up to add this function.

Thanks for your help!
well, you need to be able to isolate the image by movieclip name...  most likely you will need to do a for/in loop to find out what the items are in the object of the component...  like the below...

Obj is the name of the component...  I am assuming this will work for you.


rp / za

for(var i in obj) trace(i + " -- " + obj[i]);

Open in new window

btw...  by isolating and finding the large image instance name, you can then reference that as the item to be captured.

rp / za
crittle1Author Commented:
Thanks, I'll work on the flash paper one tonight and see how it goes.
If that doesn't work I personally use the http://www.quasimondo.com/archives/000645.php for my DYO Garment websites and it works well.  However it is for AS2 and it is difficult to configure, get running right and it is slow for slow internet connections (lots of uploading).

You can seen an example of it at  http://dyo.2009worldmasters.com/index.php?state=load&menu=undefined&tick=undefined&swf=Polo1.swf just click Finish Design->Request Information put in the comments that this is a test and submit.  It sets up the garment for exporting and then emails it.  The only problem is that it has to upload the BMP in the flash file to the php on the server which can take seconds on a fast connection and 5 minutes on dial up.

Like I said though if the other solutions don't work and you are using AS2 let me know and I will post some code for you.
crittle1Author Commented:
I looked into the flash paper but I don't think it's going to work. I will email the test link if you want it so you will see what I'm working on . (don't want to post for indexing reasons).
I'm using the thumbnail grid from slideshowpro.net  The component is suppose to work in conjunction with the slideshow pro component (SSP) also offered by the same company.

Background... slideshow pro is a slideshow component (duh) that you can add images, captions and links into. The 2nd component is a thumbnail grid which its' sole purpose it to provide a secondary option for displaying the slideshow pro's thumbnails in rows and columns verses just numbers or a single row of thumbs which the slideshow pro only offers.

With that said, I'm using just the grid because I need to display images that enlarge on rollover in 3 rows and 13 columns. (per the client).

The problem arises because the user needs to be able to grab the large image to mail to potential clients. The following are some things that are preventing me just adding a static button on the stage and linking to "current image" in the slideshow:

A. everything is loaded by the xml so it's pointless to add a link under each thumbnail.
The gallery number will change all the time.

B.  I could create the link via xml in the caption area and it would solve the problem. But....the user will be scrolling down the page so I can't have a static text field just sitting in one spot... it would be a pain to keep scrolling back up/down to find it.
Maybe I could have a movieclip that sticks to the bottom of the stage when the user scrolls??.... that's an idea.... thoughts???

Looks as though I'm going to dump the screen capture idea. I don't think this would be a good way to go seeing the stress it causes on ones computer.

Any other thoughts.. and thanks for the replies!!!!!!!!!
crittle1Author Commented:
I've come to the conclusion that I can fix my problem if I can just figure out how to center a movieclip in the middle of the stage at all times. This would include scrolling the page up and down while the movieclip stays centered and visible on the screen and all else moves behind it. (may not make sense, but I've got a plan, hee)

Those annoying myspace pages where their background is stationary but the tables scroll.... but I want the reverse.  :)
crittle1Author Commented:
I was referencing sending the url of the slideshow that's live, not the file. Just so one could see what I was talking about. I don't want the url indexed so it doesn't show in internet searches.

The swf is a good idea, and thanks for that. It will help me in future projects.
I failed to mention that the client will be the one uploading images to the server to populate the xml field and therefore doesn't have access to flash to create the swf's :(

I don't mind to do the screen capture option, I just felt like it was a little over my head and wasn't sure if I should just go ahead and just create a movieclip that loads the xml and make the images clickable which may be what I will ultimatly do.
crittle1Author Commented:
Thanks for all your help, I will be able to use the above suggestions on future projects!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.