Sprite Glitch/rollOver Sticking

Hi all,

I am new to Flash and still drowning in timelines. Here’s my problem… besides, you know, lacking a fundamental understanding of coding:

I’ve got five pictures of hospitals as movieclips. When a user rolls over each image, the name of each hospital drops down on the top-right of the movie. I’ve built the text animation inside each hospital clip.

If you move your cursor, quickly, from the images to the hospital names as they appear, it will cause the movieclip to glitch until you roll out of the facility name that becomes stuck. It looks terrible, and will make more sense when you try it.

I’m sure there’s a really easy solution for this, and I’m sure someone will tell me to START USING CODE, and I’m trying to get there, I swear! Please advise!

[Link removed by reprovisional May 9, 2008]

That’s because the rolldown text and the image is part of the same movie which you have turned into a rollover, so the text counts as mouse-accessible area.

Remove the actionscript from the movieclips, but keep the text animation there. Each image+text should exist as its own movie clip, as it does now. Give each one a different instance name. (ex. Animation1, Animation2, etc.)

Create five new buttons on a new layer above the images, and simply make them boxes that cover the area you want to be moused-over. It doesn’t matter what color they are, but make their transparency 0% so they are hidden.

Next, convert each one of these boxes (separately) to a movieclip. We’re going to turn it into a button with actionscript, but do not set its type to “button.”

On the main timeline, click on the first box, and in the actionscript for that movieclip (not the frame’s actionscript), do something like this:

on(rollOver) { _root.animation1.gotoAndPlay(2); }
on(rollOut) { _root.animation1.gotoAndPlay(11); }

_root refers to the main timeline. animation1 should be the name of the instance you want to reference. This will create the animation within the movie clip you’re referencing, but not the button that the script exists on. This way, you can have the button area be only over the image, and not the entire text+image movieclip.

Set up the animation in your text+image movieclips to have a stop(); on the first frame, so that it’s hidden, and a stop on the frame where it’s fully rolled-in. Then a gotoAndStop(1); on the final frame, to be sure that it automatically goes back to the start and stays hidden. Your roll-in script will tell it to start animating in, and then it will stop after it’s fully rolled-in. Your roll-out script will tell it to start playing one frame after it stopped in the middle, and roll it out again.

This is somewhat dirty script, and you could have if statements that check what frame it’s on, and based upon that, roll in or out cleanly and whatnot, but this should get you started. Hopefully I was clear enough in my explanation. :slight_smile:

Very cool! Thanks a lot for your help! But - I’ve still got a questioin.

Let’s suppose I leave everything where it is now; is it possible to instruct just the text to be removed from a mouse command? Is it ultimately considered a child of the animation? And can you simply ignore this child somehow?

I know I’ll end up doing it your way, but I gotta ask. Thanks again for yr answer, it was very clear :slight_smile:

Yep. You can do that too. Just make the text parts of your movies into separate movie clips, and have an empty movieclip that you will use as a placeholder. Put the placeholder mc down where you want the text to come in, and use attachMovie to swap them out when you mouseover. Be sure you give your placeholder an instance name so that you can refer to it.

This page should explain it nicely for you.

Awesome!