Script self contained in movie

Hi i am not an experienced flash user, but i’ve been using it for a little bit now.

I have a rectanglular fill as a movie clip and all i want to have it do is flash (by changing colors) when i rollover it with the mouse.
I figured out how to do it by putting code in the same timeline that i put the movie in, but i have many different instances of this movie and i would like to create a self contained movie clip, where i can stick it anywhere and it will flash when i roll over it. (I have it flash with 2 separate frames of different colors.)

any suggestions?

The code I wrote is on the movie clip itself to to duplicate it, just copy and paste the movie clip multiple times. If you need help understanding what I did, feel free to ask

thanks

i tried something similar to get the effect i wanted. I want a continuous flash.

this is what i tried but i cant get it to work.
http://www.dti-us.com/rollover2.fla

thanksagain

can you explain a little more? Have it constantly flash while they hold their mouse over it?

Like this?

yes thats exactly what i wanted

can you help me out with 2 questions please.

  1. Why doesnt mine work? It seems sensible that it would.

  2. Why does yours work over mine? And how come it doesnt blink white since you have the gotoAndPlay(2) command on the 4th frame and that frame is blank?

Thanks a lot for your help

omer

It doesnt blink white because frame commands execute before the content of the frame is displayed or the contents commands execute. What this translates to is that it goes straight to frame 2 before it displayes frame 4.

[edit] I found where you put it [/edit]

Ok yours didnt work because you forgot to capitalize a letter. its on RollOver not on Rollover :slight_smile:

the fact that commands execute before the content means everything. thanks a lot.

wait how come then if i have a stop() command it still shows the content of that frame?

ok thanks everyone that has helped me get this simple problem to work correctly. I have now run into a new problem. My intention for this movieclip was to have it rest behind thumbnails so that it has a nice effect when you rollover it with the mouse. when you click on it opens an image in a new window. All this i have working fine, including the javascript. But when i add any code to the movie clip it stops blinking.

you can visit my website at http://www.dti-us.com

and you can see the problem i’m having here:

http://www.dti-us.com/rollout3.fla

in the file you can see one is blinking and one is not, and the only difference is the code on the movieclip, which should have no effect.

Thanks again
omer

Why don’t you just use a button? This saves you retyping script for every instance of the movieclip you want (on a button, the script on every instance can be identical except for the goto / getURL action).

Just make a flashing movie clip and put it on the over state of your button. Make the Up state empty and place your button on top of your thumbnail.

As for the stop(); action, this only stops the playhead, it doesn’t stop Flash from reading the rest of your script. The script is then executed in the order you wrote it.

alright. i can do that. i guess it was more about the frustration of understanding why it wouldnt work. thanks