Link to home
Start Free TrialLog in
Avatar of Freja_UK
Freja_UK

asked on

Action scrips variables within a button

Hi there

I'm desperate for help. On my main timeline each subject is presented as a movieclip. They all have a alpha 0 in the first frame. My movie "home" is my intro movie which starts directly. My navigation is a drop down menu.

All movies starts with a fade in - there is a stop on frame 30. On frame 31 the movie fades out again.

To make it simple - let's say there is 2 buttons in my drop dowm menu. Who and Clients. When I press Who button, I have following action script:

on (release) {
if (Who._currentframe != 30) {
_root.Who.gotoAndPlay(2);
}

_root.Home.gotoAndPlay(31);

This works perfect - however it gets more complicated when I ad more scrips to my button. Since when pressing a button, I can always start with the the action script:
on (release) {

if (Who._currentframe != 30) {
_root.Who.gotoAndPlay(2);
}

But how do I set my variables to say that the current playing movie, needs to go to frame 31 (which will make it fade out). Cause if I write

on (release) {
if (Who._currentframe != 30) {
_root.Wht.gotoAndPlay(2);
}
_root.Home.gotoAndPlay(31);
_root.Clients.gotoAndPlay(31);
}

It plays both movies from frame 31 - and that is not what I want.

If someone can please help me - or tell me where to look for the answers I would be most greatful, cause I need to solve this by tomorrow. I will be happy to send the fla, if that might help.

Look forward to hear some comments.

Thanks
Freja_UK
Avatar of negatyve
negatyve

I'm not sure I understand your question, but maybe you mean:

on (release) {
      if (Who._currentframe != 30) {
            _root.Wht.gotoAndPlay(2);
      } else {
      this.gotoAndPlay(31); // ?
      _root.Clients.gotoAndPlay(31);
}
Avatar of Freja_UK

ASKER

I have now tried that - and it doesn't work.

It does start my movie Who - but my movie Home does doesn't fade out, which is should do.

Issue one - the first button I press I need the movie Home to fade out, after that I need to have in each button something to say - go to and play the movie related to the pressed button, and to go and fade out the movie which is already playing.

All movies are builded the same - stop on frame 1 - which is why I always tell it to go to frame 2. Then there is a stop on frame 30, so the fade our happens from frame 31.

But at the moment I´m missing a script, that helps looking for the movie playing. So it knows which movie to fade out. I have managed to get all movies to suddenly come in and fade out, but that looks a bit messy :-)

Did that help?
ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial