Button swaps part of image

Hi,

Newbie question. It’s for an art project.

I have a head graphic and seven hairstyles.

I’d like the user to be able to push one button and cycle through the hairstyles as they swap on the head graphic, choosing the one they prefer.

I’d be grateful if you could help me with the simplest solution in Flash MX.

Thank you.

Jan Watson

Hi…

That part is somewhat easy… But it ALL depends on what you are trying to do with that… Let’s just assume that you have one movieclip that contains seven hairstyles from frame 1 to frame 7 in that timeline…

In the button of the main timeline, you will have a button with this script…

Btn_Select.onPress = function ()
{
	i++;
	goFrame = i % 7;
	if (goFrame == 0)
		goFrame = 7;
	_level0.hair.gotoAndStop(goFrame);
}

See if this helps you… =)

Thank you Cyan Blue,

I got myself into a different corner in the mean time.

i have the seven hairstyles in seven consecutive frames of a movie clip.

A botton with the attached action “go to next frame and stop”.

This works fine development but when published the frames run through.

Jan Watson

Well… One thing you can try is to put the stop() function on all frames… Try that and if that doesn’t work, why don’t you create a little sample so that I can check it??? C:-)