Groups | Blog | Home
all groups > flash actionscript > december 2005 >

flash actionscript : Swap Image Action Script Needed


astro_girl
12/4/2005 2:35:05 PM
I am quite familiar with Flash MX and I cannot stand using swap images in
Fireworks or Dreamweaver, because each slice and hotspot is treated on
different layers than the actual jpg/gif layer itself. I am attempting to
create an online avatar program, Not the simple type, such as in yahoo!
messenger, but a more complex type that is very realistic to the human form.
Here is what i want to do:

My user clicks on a button, eg, "face shape one" and the main area will change
to the "face shape one"
I know how to do this with colours, but not images. Here is the difficult
part, I also want to layer my swap images. Lets say, after my user chooses
"face one", they go to another button and chooses "mouth seven" So that mouth
seven will go over face one, etc. I want all images to swap over successfully,
without disrupting one another. Please, if anyone could give me a simple
actionscript for this, i will be very greateful.

Thanx in Advance,
TMField.
Visit me at: http://yummi-tummi.tripod.com
kglad
12/4/2005 3:24:52 PM
there's no easy script to do that: you'll need to create that application.

if you create your face parts wisely, that shouldn't be difficult. to create
your face parts wisely, you could create a complete face (with all parts) on
the _root timeline (where you want a face to appear "in the main area") and
convert each part to a movieclip and give each an instance name. for example,
you could name the nose you created nose1.

now, in the actions panel attach _root.nose1._visible=0;

you are now ready to create another nose, convert to a movieclip, give an
instance name and use that to make it not visible with the appropriate code in
the actions panel. do the same for all face parts.

when you finish that, you're avatar creation project is almost finished. you
need only decide how users will designate nose1 vs nose2 etc and you'll use
_root.nose1._visible=1 etc if they choose nose1.
astro_girl
12/5/2005 2:29:23 AM
Thanks. I never thought about it that way. I was so concerned about making
objects appear than making them visible in a resticted area. I will give it a
try and let you know how it went.

TMField.
:)
kglad
12/5/2005 5:02:15 AM
AddThis Social Bookmark Button