3 Replies Latest reply on Aug 31, 2009 11:41 AM by Dustin Sparks

    How to replace a face/image in an animation like on elf yourself?

    yavyn

      I am making a simple Flash animation that I would like to put online and let people visiting my site upload a picture of their face so they can be the character, like on Elf Yourself. How do I do that? Is there a tutorial somewhere online or can someone explain it to me?

       

      I'm assuming I make the animation with a square image of a face that I mask out, and the image gets replaced when a new one is uploaded, but I don't know how to set that up dynamically, or if there's a better way.

       

      Please help!

        • 1. Re: How to replace a face/image in an animation like on elf yourself?
          Dustin Sparks

          I'm not sure how much Actionscript experience you have, but the process for doing something like that would go like...

           

          1) Do as you said, create the animation and setup an empty box with a mask.

          2) You'll need to give that box and the mask each an instance name and make sure it's available from the first frame of the SWF. (it can be hidden if you need it to be)
          3) In code on your first frame you'll write some code that uses a Loader to import the image, or if you're wanting to grab the image from a webcam or something you'll need to use the Camera object to grab the image of the camera.

          4) Once the image is imported or loaded, you'll want to add that image as a child of your empty movieclip that you created and gave an instance name.

          5) Lastly, you'll need to apply the mask to the empty movieclip, which is as simple as saying EmptyMovieClipInstanceName.mask = MaskMovieClipInstanceName

           

          It's a bit more complex than that, but some of those keywords should make it very easy for you to look up tutorials for each step.

          1 person found this helpful
          • 2. Re: How to replace a face/image in an animation like on elf yourself?
            yavyn Level 1

            Thanks! I'll look up some of those keywords on the steps you listed and see if I can figure it out.

             

            I've done some searching already on image replace and the biggest problem I'm having is trying to figure out how to get an image uploader set up so that the internet user can upload their own graphic without me doing anything. I've done some searching on that but with not much luck. Is that set up in Flash or does it use an external program?

            • 3. Re: How to replace a face/image in an animation like on elf yourself?
              Dustin Sparks Level 1

              You can temporarily store the image using just flash, but whenever the flash file is reloaded, the image will be lost.

               

              In order to keep it from being lost, you'll need to use PHP or some other kind of server-side script that can handle uploading that image to your server so you can load it back in to flash later.