Solved

Action scrips within a dropdown menu

Posted on 2003-11-03
3
180 Views
Last Modified: 2010-04-03
Hi there

I have created a website with a dropdown menu. However, I can't seam to get it to work properly. All my buttons activate a movie, so when I press a new button I need to tell it not only to go and play a new movie, but also to finish the movie I'm on.

This is what worked between two buttons

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

Unfortunately that doesn't work when I start adding other movies - how do I specify what movie is playing now - and in that case - need to fade out from frame 31 - because a new movie is starting to fade in. When I use the command above for several movies, they all come in and do the fading out. But I only want the movie which is playing to leave.

Can anyone help?

Thanks
Freja_UK
0
Comment
Question by:Freja_UK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Expert Comment

by:amotaz
ID: 9676053
I am not sure I quite get the problem, but as far as you can simply keep track of the currently playing movie.

Create like a variable and on playing any movie, just set that variable to the movie's name. And when you want to stop the currently playing movie, just eval(your variable) and stop it.
0
 

Author Comment

by:Freja_UK
ID: 9677733
I'll explain some more. Cause I know in my head what I want it to do - but the different commands I have tried doesn't work, and I know that is due to lack of knowledge from my side.

Let's say that there is three buttons in my drop down, each need to activate a movie - each one starting on frame 2 in the movie. At the same time, the movie playing when I press another button, needs to leave the scene at the same time as the other one come in. All they do is fade out, and the new one fade in.

When I enter the site, the first movie to be played is Home, so the first time I press a button - I need it to say play new movie frame 2 and to say leave the movie I'm playing from frame 31 (where it fades out).

As you can see above, can I get it to work between only two buttons. However, since that worked, I thought that I could add

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

But when I did that - both Home and About appeared on the screen and played from scene 31 and out. How can I write my variables, so that when I press a new button, it knows which movie to fade out?

Did that make more sense? If not, please tell me what you need to know. It is urgent that this problem gets solved.

Thanks
Freja_UK
0
 
LVL 5

Accepted Solution

by:
Calron earned 500 total points
ID: 9685027
What you can do is maintain variables that contain the current movie and the new movie. Something like this:

_global.currentMC = _root.Home; // this is to initialize variables at the beginning


then in you button add this code:

// the about button
on (release) {
  //fade out the current movie
  _global.currentMC.gotoAndPlay(31);
 
  // fade in the About movie
  _root.About.gotoAndPlay(2);

  // make sure that now the About movie is the current movie
  _global.currentMC = _root.About;
}
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Accessing Live Dynamic Stream 6 213
how can flash builder 4.X version make use of java 8 5 434
Windows 7, Adobe Flash Player and Internet Explorer 11 15 113
Flash ActionScript 6 82
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. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

752 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