To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-06-2009, 01:26 PM   #1
nicole_p
lost in AS
 
Join Date: Nov 2009
Posts: 4
Control 3 movie clip with one button [ as2,cs4 ]

hello
i have 1 button and 3 Movieclip
there is 2 frame in each move clip .
i want to control all mc with my button.
when i press it all mc go to frame 2 .

i use this action for button :

Code:
on (release) {
	_root.f1 = true;
}

and use this action on first frame of each movie clip :


Code:
stop();
if (_root.f1 == true) {
	gotoAndStop(2);

}
but don't work , please help .

i attach the fla file .
Attached Files
File Type: zip test.zip (8.6 KB, 4 views)
nicole_p is offline   Reply With Quote
Old 11-06-2009, 02:11 PM   #2
jamesloacher
Senior Member
 
Join Date: Jan 2006
Posts: 234
PHP Code:

on
(release){
_root.movieClip1name.gotoAndStop(2);
_root.movieClip2name.gotoAndStop(2);
_root.movieClip3name.gotoAndStop(2);





}
jamesloacher is offline   Reply With Quote
Old 11-06-2009, 05:39 PM   #3
nicole_p
lost in AS
 
Join Date: Nov 2009
Posts: 4
tanx for reply jamesloacher .
but think if the movie clip number increase ( ex : 200 move clip ) your code is not logical anymore.
i want to do something that could be control any number of movieclip .

tanx again .
nicole_p is offline   Reply With Quote
Old 11-06-2009, 06:32 PM   #4
jamesloacher
Senior Member
 
Join Date: Jan 2006
Posts: 234
One wway would be to store the movieClips in an array;


PHP Code:
var myMovieClips = [mc1,mc2,mc3,mc4,mc5,mc5,mcn]

on (release){
for(
i=0;i < _root.myMovieClips.length;i++){
myMovieClips[i].gotoAndStop(2);

}



}
jamesloacher is offline   Reply With Quote
Old 11-07-2009, 10:12 AM   #5
nicole_p
lost in AS
 
Join Date: Nov 2009
Posts: 4
tanx for your great script's .
code work fine in frame 1 , but if movie clip separate in other frame they don't change .
take look at attachment .(test3)

i think could do this with ( if ) script but i don't know why my code don't work fine ?
in my attachment ( test_myway) if you click on ( 1 change ) and then click to next frame , it's work , but i want to do it on same frame .
help .
Attached Files
File Type: zip test3.zip (8.3 KB, 1 views)
File Type: zip test_myway.zip (9.7 KB, 2 views)
nicole_p is offline   Reply With Quote
Old 11-07-2009, 05:28 PM   #6
jamesloacher
Senior Member
 
Join Date: Jan 2006
Posts: 234
Can't open the files here in flashCS3.Could you save them in an older format?
jamesloacher is offline   Reply With Quote
Old 11-08-2009, 03:40 AM   #7
nicole_p
lost in AS
 
Join Date: Nov 2009
Posts: 4
i attached the cs3 version now .
Attached Files
File Type: zip test_myway_cs3.zip (8.4 KB, 7 views)
File Type: zip test3_cs3.zip (7.2 KB, 1 views)
nicole_p is offline   Reply With Quote
Old 11-09-2009, 01:24 AM   #8
jamesloacher
Senior Member
 
Join Date: Jan 2006
Posts: 234
The reason my way won't work is they go out of scope on the 2nd frame.

It is best to try to keep everything in one frame if possible.

I did not understand your way, maybe someone here can be of some assistance.
jamesloacher is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:56 AM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.