Solved

Action scrips within a dropdown menu

Posted on 2003-11-03
3
175 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
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
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,…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
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.

747 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