Search code examples
apache-flexflashactionscript-3flash-builder

How to create a dress up game in Flash?


I am a newbie at Flash/Flex and Actionscript 3.

I would like to know how can I create a dress up game in Flash/Actionscript where users can click on (not drag and drop) the available accessories/clothing and the avatar will display with the new selection immediately, and I can save the settings and take snapshot of the avatar in the new clothing selection. It will be good if there is references/tutorials that I can follow.

And secondly, may I know how do I save the selection, is it via xml or json or database? It will be good to store the clothes/accessories dynamically.

Thank you very much.


Solution

  • You'll need to familiarize yourself with the basics first as PatrickS mentionned.

    Once you're ready to dive in the development of this, you'll have to consider a few options in the way you store the avatar's appearance to a remote file / database.

    A few options are: - Dynamically take a snapshot of your avatar (with a BitmapData.draw( ... ) call), and pass the byteArray of your snapshot to a URL where your server will expect and save your avatar to a file / database entry. - Dynamically take just the bare information needed (avatar skin color, clothing, accessories, positions maybe too), and pass this as a formatted string (can be XML, JSON, URL-Encoded even, whatever you're comfortable with) to a URL where your server will expect and save your avatar data to a file / database entry. To call this back though, you will need to develop also a writing mechanism for your Flash avatar to take this information back from the server and re-apply it.

    The 1st method is the simplest way. On your server, you can use PHP's GD library to do the image manipulation if you need to crop or resize too.

    And yes... I've done this before, too many times lol.