View Full Version : Menu In>Out
geekmanX
June 5th, 2002, 05:24 PM
Hmm, I have buttons that make a movie clip appear (table with the content flashing in), the problem is going from one table to another different one, ie when you click a different button the table flashes out, then another flashes in. This is probably very simple but I cant figure it out! :D
thanks,
john
BTW I use a lot of movie clips inside movie clips...
ilyaslamasse
June 5th, 2002, 05:40 PM
Hard to tell without looking at the fla...
pom 0]
oOEricOo
June 5th, 2002, 07:54 PM
I think i know where you're trying to get at. I have a similar movie where you click a button, and a lil branch stems off it, when you click it again, the branch goes away. I also used this with another movie inside my main movie. If this is similar to what your doing, read below.
All i did was make a variable called Menu_switch. very simple...in the beginning of the movie, the Menu_switch is set to -1 which is off so it won't show at first.
Now, for the actions of the actual button that will decide whether to show the branch or not...
Every time the button is clicked, the Menu_switch will be multiplied by -1. That way it keeps bouncing from 1 to -1 and so on every time u click the button. Now I added the following code with the button...
on (release) {
Media_switch = (Media_switch * -1); //switch media_switch
if (Media_switch == -1) { //if switch is turned off
        tellTarget ("MediaShow") { // hide switch
gotoAndPlay (9);
}
}
if (Media_switch == 1) { //if switch is turned on
        tellTarget ("MediaShow") { // show switch
gotoAndPlay (2);
}
}
}
This just determines if the button is on or off, and it will display the movie properly. There's alot more tho...but maybe this might help if u need more ask
geekmanX
June 5th, 2002, 09:27 PM
Thanks for the help, at first your code was completely new to me, since Im not really good at the actionscripting aspect of flash... but I think i get it now. So basically it acts like a switch with a -1 value meaning off, and 1 meaning on? But then whats the gotoandplay for? And do I put the code in the menu movie clip?
Thanks alot, im learnin alot here....
-john
oOEricOo
June 6th, 2002, 07:42 PM
No problem!
Yep that's basically all there is to it! Pretty simple. Alright but now to you're question...lemme start off by explaining the tellTarget feature. tellTarget is almost like a goto feature for actionscript. My movie that i wanted to display when the movie hit the button was called "MediaShow". so from: tellTarget("MediaShow"), that tells that I want to now go into that movie and target it for whatever reasons.
The gotoandplay command tells what frame i want to play in my tellTarget movie. They both work together. In my "MediaShow" movie, frames 2 - 9 displays the branch appearing, and frames 9 - 15 displays the branch disappearing.
Here's a simple way to look at it...
1) User pushes the button
2) tellTarget the movie that will be affected when the button is pressed
3) Determine if i should show, or hide the "MediaShow"
4) Goto the proper frame to display the movie appearing, or disappearing.
Now to your other question about where to put the codes. For the coding of the button that determines if the button is on or off, put a similar code i showed u into that button. (Right click button, then hit actions). However, when the movie starts right away you want to make the button turned off. In that case, make a new layer in ur main movie area and make an action to say something like... your_Variable = -1; that way ur switch is off to begin with. Otherwise ur variable will start at 0 and -1 * 0 will always be 0, and nothing will happen in the movie. Ok, last thing!!!!! When you click the button, u want a movie to show. That movie that you want to show, needs it's own coding too but it's tricky at first but very simple. On the first frame of the movie that u want to show, there should be an action of "STOP". That way, the movie won't play right away when u start the movie. Also, on the first frame, there should be no graphics at all. So basically, ur movie should start on frame 2, with frame 1 only being blank. From frame 2 on to whatever frame it takes, then you can place ur movie appearing whatever way you like. On the frame where the movie is to stop appearing, you want to have another STOP on that frame....im gonna stop here because there's alot of things i just went through. So if u have questions so far ask cause i know this can be confusing...if u don't have any questions i'll proceed.
Sorry so big!
-Eric
geekmanX
June 6th, 2002, 10:00 PM
Awesome i think i got it down with good'ol fiddlin around. :D I knew what gotoandplay was, I just didnt see what you were using it for. But another problem has arisen, I have the main content ("main") to play as soon as the movie starts, and its nested in another movie clip (along with all other movie clips that have content).
The navigation buttons is on the main timeline inside a movie clip, and the problem lies in the code I set for the buttons to tell the movie clips:
on (release) {
tellTarget ("_parent.menu.profile") {
gotoAndPlay(1);
}
}
The thing is when "main" is finished playing and is sitting there, the movie is in THAT timeline, thus making the navigation buttons useless!! See what I mean here:
johnmai.com/index2.htm (http://johnmai.com/index2.htm)
Again thanks for the help!
-john
geekmanX
June 6th, 2002, 11:12 PM
Urg I always end up solving my own problems after I post... :D
oOEricOo
June 7th, 2002, 06:32 PM
Awesome site, it's different, but different is great. I'm glad i helped you out with it, and if u still have more questions just post em up! It was no problem helping you out tho.
-Eric
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.