Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-31-2002, 07:24 PM   #1
charter
Registered User
 
Join Date: Dec 2002
Location: Manchester, UK
Posts: 22
Default controlling multiple movie clips

I wish to control multiple MOVIE CLIPS on i click of a button within another movie clip.

I know how to control 1 other mc. but I wish to make 1 mc start and another to return to it's original position

The code I have to control 2 MCs that I have is

on (release) {
play ();
}
on (release) {
_root.mc50.play();
}

I also wish to make another mc go back to it's original position.
This mc instance is mc60. Anyone any ideas how to do this?

I have zipped up a file to show what I mean

All help much appreciated

HAPPY NEW YEAR!!
Attached Files
File Type: zip fla.zip (10.4 KB, 227 views)
charter is offline   Reply With Quote
Old 12-31-2002, 07:41 PM   #2
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

i have some ideas....

but i'm not sure wat you want exactly....

ok...i d/l the

the MC at the top is m60

and the one on the left has no instance name...but I guess its
m50?

so.....
Which MC is doin' what when clicked and which MC is suppose to go back to original position?
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 12-31-2002, 07:50 PM   #3
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

here's what i did....

the mc60 when clicked plays itself and mc50

when clicked again it just plays....

the way you have your mcs set up is....

mc60 plays ---> then stops --->when play again....->it goes backwards.

same scenerio w/ mc50

.....

Not sure if your a newbie...but I ....

to view the code....click on mc60 and then view Action
and you;'lll see where i placed the script.

All i did was but this script on mc60
ActionScript Code:
onClipEvent(enterFrame) {     this.onRelease = function()     {         this.play();         _root.mc50.play();     } // End of onRelease }
Attached Files
File Type: zip test.zip (9.7 KB, 216 views)
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 12-31-2002, 07:51 PM   #4
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

i hope that gives you some ideas on how to go about w/ your project.

Good Luck.

And have a great NewYear
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 01-01-2003, 09:32 AM   #5
charter
Registered User
 
Join Date: Dec 2002
Location: Manchester, UK
Posts: 22
Default

Hi

The MC on the left has NAVIGATION as the instance and there are 2 MCs at the top which are MC50 and MC60.

As there is some confusion about the left MC instance is I have resent the .fla

Eventually there will be more MCs at the top named mc70, mc80 and so on.

What I am looking to do for example is that is from the naviation the 1960s button has been clicked and the mc60 has dropped down, and then another button on the navigation is clicked say 1950s then the mc60 would go back to its original position and the mc50 would drop down.

So that means that which ever button on the navigation is clicked the appropriate MC drops down and I wish to make it then that which ever of the other MCs is already down that it returns to it's original position.

Many Thanks!!!
Attached Files
File Type: zip sample.zip (11.1 KB, 200 views)
charter is offline   Reply With Quote
Old 01-01-2003, 03:10 PM   #6
boyzdynasty
Senior Member
 
boyzdynasty's Avatar
 
Join Date: Aug 2002
Location: Philly
Posts: 2,583
Default

ooo...ooo....
ok. I understand now.

I'll take a look at it later tonight. Gonna head out.
Its New Years!!

You shouldn't be workin' too hard.
__________________
I need a new signature!
boyzdynasty is offline   Reply With Quote
Old 01-01-2003, 05:39 PM   #7
bembino
Registered User
 
Join Date: Dec 2002
Location: NYC
Posts: 76
Send a message via AIM to bembino Send a message via Yahoo to bembino
Default

What you need is a function that tracks what era is open...or selected and then open and close them accordingly. Place the following code in frame one of the main timeline:
Code:
stop();

//variables used to track selected eras
curEra = null;
prevEra = null;

//function to change eras
_global.changeEra = function(eraToOpen) {
	
	//update era variables
	prevEra = curEra;
	curEra = eraToOpen;
	
	//don't do anything if the user 
	//clicked the same button twice
	if(prevEra != curEra) {
		prevEra.play();
		curEra.play();
	}
	
}
Also be sure to send your era mc's back to frame one for looping. Open your era mc's (mc50, mc60, etc...) and change the code on the last frame to:
Code:
gotoAndStop(1);
Then revise the code on your navigation buttons so that they call the changeEra function:
Code:
on (release) {
	play ();
	changeEra(_root.mc50);
}
So now you can just call the changeEra function and pass the path of the movieclip you want to open through the function and you should be all set.
bembino is offline   Reply With Quote
Old 01-02-2003, 10:16 AM   #8
charter
Registered User
 
Join Date: Dec 2002
Location: Manchester, UK
Posts: 22
Default

Hi Bembino

I have tried this putting all the code on the appropriate buttons and frames like you said.

Problem now is that when I click on one of the navigation buttons nothing at all happens. No MC drops down.

Also I do not understand the last paragraph in your reply.

(So now you can just call the changeEra function and pass the path of the movieclip you want to open through the function and you should be all set.)

I am a complete newbie at actionscripting.

Happy New Year.
charter is offline   Reply With Quote
Old 01-02-2003, 03:19 PM   #9
bembino
Registered User
 
Join Date: Dec 2002
Location: NYC
Posts: 76
Send a message via AIM to bembino Send a message via Yahoo to bembino
Default

I'm attaching a working FLA. Sorry I can't explain right now. I'm a little pressed for time.
Attached Files
File Type: zip uk1.zip (16.6 KB, 210 views)
bembino is offline   Reply With Quote
Old 01-02-2003, 05:01 PM   #10
charter
Registered User
 
Join Date: Dec 2002
Location: Manchester, UK
Posts: 22
Default

Sorry Bembino

I have just run your .fla file and when I click on 1950s or 1960s in the navigation mc nothing happens.
Neither of the mc (50 or 60) will drop down.

Could this be anything to do with the fact that i'm still using Flash 5.
charter is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:44 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.