Variable losing setting or not getting set...

Posted on 2004-08-14
Medium Priority
Last Modified: 2010-04-03
I have a button and within the button on the “over” frame there is a movie clip.
The movie clip has an animation of the home button moving down and back up to the original position and changing colour.

The problem is when the button is clicked. After the click the mouse is still over the button so the movie clip plays again. I tried to stop this by coding in my movieclip frame1:

if (played == "true")

and on scene 5:

played = "true";

it seems that when the “down” frame is activated the variable is cleared and then when it is “over is again” it replays.

I tried coding on the main button :
on (press)
played = “true”;

so that the variable would hopefully be set for the next time the “over” frame was active.


Question by:pete420
  • 5
  • 3

Expert Comment

ID: 11804889
can you post the fla somewhere?  That Way I can see what you are trying to do.


Expert Comment

ID: 11805051
here is your fla back


All I did was delete the buttons and just use the movie clips as the buttons and then for each movie clip I put a


Then deleted all of your AS for the movies and just put a stop at the begining of each MC.

Then on the main timeline gave each MC a instance name similar to its name and used that to control the on rollover.

All you have to do is add the on(release){ what ever};

Hope this helps

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.


Author Comment

ID: 11805246
thanks for the help, but its not quite what i wanted, much appreciated tho.

the problem with what u have done is that there is no "over" frame
as its not a button, i want an over frame so that the
font colour changes when the mouse is over it.

another problem is that with no "hit" frame on a button, it is harder to get
"locked" onto a button as u have to be hovering exactly over a letter instead
of a general area that can be specified on the hit frame.

i have tried a few things to fix it to the way i want but no luck yet.

ta again pete

Accepted Solution

fixitben earned 300 total points
ID: 11805683
Ok download the file above again

it is exactly the way you want it I think

This time I put the buttons back but made them blank buttons instead and assign the AS to them instead so if you move drag the blue box out of the way which is the button the movie clip is behind it Then you can Change the last frame to what ever text color you would like.  Then I add a on(rollout) {goto the first frame of the movie.  I also add a stop at the end of each movie to keep the color there while they are over it.



Expert Comment

ID: 11805691
Now the file is uploaded sorry


Expert Comment

ID: 11807233
The Soultion is posted here and it is exactaly what you were asking for.
I don't know way you are deleting it the fla is posted above with explination.


Author Comment

ID: 11813686
apoligies, the request was made last nite before i had ur reply. i will look over ur solution now.

sorry for misunderstanding!

thanks pete

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to how to record live broadcast.

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question