Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Action scrips within a dropdown menu

Posted on 2003-11-03
3
Medium Priority
?
182 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
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): …
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…

715 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