Solved

Variable losing setting or not getting set...

Posted on 2004-08-14
9
141 Views
Last Modified: 2010-04-03
Hi,
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")
      gotoAndStop(5);
else
      play();

and on scene 5:

played = "true";
stop();

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.

Thanks
pete

0
Comment
Question by:pete420
  • 5
  • 3
9 Comments
 
LVL 7

Expert Comment

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


Fixitben
0
 

Author Comment

by:pete420
ID: 11804956
0
 
LVL 7

Expert Comment

by:fixitben
ID: 11805051
here is your fla back

http://theyac.org/nav.fla

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

on(rollOver){_root.InstanceNameOfMC.gotoAndPlay(1);}

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
Fixitben

0
 

Author Comment

by:pete420
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
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 7

Accepted Solution

by:
fixitben earned 100 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.


http://theyac.org/nav.fla

Fixitben
0
 
LVL 7

Expert Comment

by:fixitben
ID: 11805691
Now the file is uploaded sorry

fixitben
0
 
LVL 7

Expert Comment

by:fixitben
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.

Fixitben
0
 

Author Comment

by:pete420
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
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Pushing Adobe Flash Player Fails with Error %%2 1 476
SWFObject in temporary internet files - constant file transfer from web server 3 388
flash cs6 4 344
bandwidth 5 67
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now