Interactive Multimedia Coding Assignment – Post (Prototyping)

stackoverflow.comWinter Mini Game

This is my favourite game. The user is able to dress a snowman from an option of items on the left hand side. When the user is finsihed they select done and this takes a screenshot of the snowman and opens on a new page. Along the left hand side is written happy christmas and the lyrics for frosty the snowman.

So far I have made all of the items drag-able using the startDrag and stopDrag function.

Screen Shot 2013-12-12 at 13.01.02

Screen Shot 2013-12-12 at 13.54.57

 

 

 

 

 

 

I have been researching how to do the screenshot. I found code on stackoverflow.com called “AS3 stage screen shot to hard drive save“. It has been really helpful for the code aspect but has opened a lot of problems for me at the same time. You need to have a JPGEncoder in your AS library, this has to be downloaded. I have still not been able to get this working. I have looked at the following forum The class or interface com.adobe.images.JPGEncoder could not be loaded as this was the same error i was getting. Basically you have to have the .as file within your core folder. I have done this and it still does not work.

My second problem is that the screen shot is of the whole screen. I only want it to crop a certain area of the screen. I research this a bit and I am still confused about it. I found this code on stackoverflow.com called “take snapshot of display object visible area in flash“. I looked at some code that Sean McDoonnell and this really cleared it up for me, I also got a copy of Sean’s code to look at further for cropping the area wanted. I had to create a an area using a rectangle and then set the constraints of the screenshot to the area of that rectangle.

Screen Shot 2013-12-12 at 13.59.15

Screen Shot 2013-12-12 at 13.55.11

I have this working now so I am really happy with that. I will keep trying to get the JPG to save and ask Ken on Monday if there is anything he can suggest.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s