View Full Version : Problem opening multiple MC's
DaveL
01-02-2003, 08:11 AM
Hello,
I'm trying to set up some kind of interactive flashdesktop, using 'button-related' MC's.
The desktop contains several buttons, these should be linked to an individual MC.
What I'm trying to achieve - but not succeeding yet ;) - is that by clicking one of the buttons, the MC opens in the main design (main movie). If another button is clicked it should open in that same movie without closing the previous MC.
Each MC can be closed our minimized on it's own. So what I'm trying to create is some kind of desktop, where different subwindows can be opened, closed, minimized and dragged. This works quite nice, only thing I've not been able to figure out, is how to open the different mc's without closing the previously opened and how to stay in the main movie..
Hoped someone could help me out! Thanx!
Dave
TheDutch
01-02-2003, 08:34 AM
Hello Dave,
Welcome on FlashMove! :D
What i understand you are trying to create is some sort of Windows (tm) in Flash? Ive made this in Flash 5 a year ago orso but with a disk crash totaly lost everything. Even tho it was so complete :(.
Anyway i think i can help you with this but i dont really understand what your problem is. Are you talking about MC's that are already within 1 movie or are you talking about loading movies(swf files) in a main movie?
Yours,
Erwin
DaveL
01-02-2003, 08:42 AM
Indeed Erwin,
we're talking about the same 'Windows'-simulation ;). Thanks for the quick respons.
To clear out my problem; I'm indeed talking about MC's that are already within my main movie.
I thought it would be the easiest way, at least in this case. Or not???
???
So, hope it's al little bit cleared out..
Yours,
Dave
TheDutch
01-02-2003, 08:49 AM
Alright, but what is your problem with not hiding previous MC's?
DaveL
01-02-2003, 08:55 AM
Well, how the interface is build now, I 've put each MC in a different frame on the main movie. The buttons, that are linked to the MC, reffer to a frame number..
So, the MC's show one by one, as they are linked to a frame. Using this method it is impossible to show more than one MC at the time.
If a MC is opened, an you click another button to open another MC,.. the previously opened MC disappears..
What I'm now trying to do, is to make it that way, that by clicking a button when an MC is already opened, the new MC opens on top op the previous one, without making the previous one disappear..
TheDutch
01-02-2003, 09:05 AM
Well you can hide/show and swapdepth, you know how they work?
DaveL
01-02-2003, 09:07 AM
I'm afraid the answer to that question will be no... :o
TheDutch
01-02-2003, 09:22 AM
Here is a little guide:
1. let all your MC's on one frame in the root
2. give all MC's two frames, one frame that is blank, the other contains another MC with the real "window". This way you can check wheter or not it is active.
3. Use MovieClip.swapdepth(); to swap the level depth of each MC.
4. Use MovieClip.getDepth(); to check the depth of each movieclip.
MoveClip.swapDepths
myMovieClip.swapDepths(depth);
myMovieClip.swapDepths(target);
Where myMovieclip is a movieclip instance, depth is a level to be swapped with, and target is a movieclip to swap level with.
The MovieClip.swapDepths() method is used to swap depths with another movieclip/movie.
MoveClip.getDepth
myDepth = myMovieClip.getDepth();
I hope this will help you think of how to solve your issue :).
DaveL
01-02-2003, 01:24 PM
Thanks for your tip Erwin! So far so good. The swapDepth-thing works nice and smooth ;)
But I'm still wrestling with this one issue..
How can I make the movie that way that only the MC's (windows) that I select (by clicking on the linked button) are on the screen.
I'll try to explain (I know I'm not good at it ;) I'm sorry)..
Eg. I have 5 buttons, each one linked to a different window (each one in an individual MC)..
Now I already fixed it that way that I can open all the windows in one frame in my main window.
Which unfortunately also means, when I click button "1", not only window "1" opens, but all 5 windows open.
How can I fix it that way that by clicking button "1", I open window "1", without the other 4.
And when I for example click button "3", without closing window "1", window "3" opens up on top of "1"?
Hope it's a little bit clear?
Thank!
TheDutch
01-02-2003, 01:28 PM
Well Dave try this:
I told you on every MC to have two frames right?
Well on frame one there is nothing except for a stop(); on the frame itself. On frame 2 there is the real "window" MC with also the stop(); on the frame. Now when you push button 1 you tell this MC to mc1.gotoAndStop(2);. Than it will open only window 1 and not the others because the others will remain on frame 1 and are stopped with stop();.
Am i clear?
DaveL
01-02-2003, 01:31 PM
This time I won't miss! Thanks, think I should learn how to read before I try work with Flash MX!
Thanks!
TheDutch
01-02-2003, 01:32 PM
LOL :cool:
Please let me know when your done or when you need some extra help.
DaveL
01-02-2003, 02:17 PM
!party! It works! Great! Thanks for all the help, Erwin! Really appreciate it!
ps. talking 'bout learning to read.. I just noticed.. (sometimes I'm a little bit slow, but that.. I don't have to tell you anymore I guess ;) ) theDutch.. nederlandstalig? Just curious..
TheDutch
01-02-2003, 02:38 PM
I'm glad you got it all working now ;)
Yes, i'm dutch and speak the dutch language as well, haha.
Cheers,
Erwin
ps. Ik heb je graag geholpen, succes verder kerel! :D
vBulletin v3.5, Copyright ©2000-2010, Jelsoft Enterprises Ltd.