Using animated movie clip as button

I am using animated movie clips as buttons in a site I am developing. You rollover the clip (button) and a fade builds, then upon rollout, the fade slowly dissapears. (simular to www.nike.com’s new menu system)

Now, how do I make this clip (acting as a button) go to different scence in my movie? Am I retarded because this really easy? I am sure I will feel that way once I find out how… I tried onClipEvent, tellTarget, goto… not having any luck.

Here is my code in the clip:

on (rollOver) {
if (Number(_currentframe) == 1) {
gotoAndPlay(2);
} else if (Number(_currentframe) == 20) {
stop();
} else {
gotoAndPlay(15-_currentframe);
}
}
on (rollOut) {
if (Number(_currentframe) == 5) {
gotoAndPlay(6);
} else {
gotoAndPlay(15-_currentframe);
}
}

Thanks for your help!!! -Scott

No your not reteraded, you need to refer to the main timeline, since our buttons are in movieclips.
[AS]
on (rollOver) {
if (Number(_currentframe) == 1) {
this.gotoAndPlay(2);
} else if (Number(_currentframe) == 20) {
stop();
} else {
this.gotoAndPlay(15-_currentframe);
}
}
on (rollOut) {
if (Number(_currentframe) == 5) {
this.gotoAndPlay(6);
} else {
this.gotoAndPlay(15-_currentframe);
}
}
[/AS]

that should work

Are they buttons within clips or clips as buttons ???

what you want to accomplish isn’t so confusing but what you say you allready have is, kindOf … best I can say is do something as this:

[AS]on (rollOver){
this.gotoAndPlay(2);
};

on (rollOut) {
this.gotoAndPlay(6);
};

on (release){
_root.gotoAndPlay(frameNumber);
}[/AS]
(replace “frameNumber” with a number only)

I am supposing it is only your _root timeline that you want to move … else if there is another clip involved to react to the “on-release” you’ll need to also get the path correct
( ie: _root.clipName.gotoAndPlay() )

BTW:Scenes are more for keeping things segregated within the authoring environment and not good for navigating thru the finished movie as they all get put together on the timeline at publish time … better to have clips, levels and external swfs invoked within the main movie than a lot of playhead travel on the main timeline

Does anyone know where I can find a step by step tutorial on how to make a movie clip a button?

Reland: They are clips as buttons.

All: I tried a couple of the above pieces and it still isnt working for me. It just randomly jumps to a scene instead of going to the intended. Do I attach code to the clip outside or inside the clip for the goto info?

BigBadWold: I’ll create a tutorial for this once I figure this out myself…

I do have buttons inside the clip that control the playhead. Invisible buttons for the rollover and rollout portions.

I then am placing these clips in a menu. I need to apply a click event somehow (in or outside the clip) to send it to a particular scene.

no apply the code to your button instance, so you will have to go into your mc clcik on the button instance and then apply your code

Understood. Using your code above, Digi, is there a “on (release)” to be added to send this to my scenes to make the button (clip) work in my menu?

Sorry to be a pain, I appreciate your help.

? i’m confused. your original script didn’t have an on(release).

sry for the confusion but if you want to make your button inside your movie clip go to a scene or frame it goes like this:
[AS]
on(release){
this.gotoAndPlay(“Scene 2”);
}
[/AS]
Is that what you meant? Oh and your not a pain, and your welcome :slight_smile:

with all the stuff you seem to have nested within this (navigationClip?) I would think it be easier to see the fla to fully understand what is what …

…gotZip ???

BigBadWolf:: look here,

http://www.macromedia.com/support/flash/action_scripts/event_methods/event_methods02.html

yea i agree if it still doesn’t work just post your fla. i’ll be around for the next hour or so

Great would like to see it scotterbomb… Thanks Relandr

Cool… I figured it out. Once I drag one of my clips (being used as a button) out onto the stage, I then need to attach the folowing code to it to make it work and send the playhead to different scenes:

onClipEvent (mouseUp) {
if (this.hitTest(_root._xmouse, _root._ymouse, 1)) {
_root.gotoAndPlay(“seller”, 1);
}
}

Thanks for all your time and replies all. ~ Scott