Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-02-2003, 05:37 PM   #1
skevill
Registered User
 
Join Date: Nov 2003
Posts: 24
Default Newbie Help

I am looking for a way to loop through all instances of a certain button in a movie. Does anyone know how to do this?

Thanks for your help.
skevill is offline   Reply With Quote
Old 12-02-2003, 05:43 PM   #2
binkyboo
Senior Member
 
binkyboo's Avatar
 
Join Date: Mar 2002
Location: Madison, Wisconsin
Posts: 1,312
Send a message via MSN to binkyboo
Default

ActionScript Code:
for (i=0; i<=numberOfButtonInstances; i++) {     _root.MovieClipName["but"+i]; }

In the example above your button instance names would be 'but1', but2', etc......
binkyboo is offline   Reply With Quote
Old 12-02-2003, 05:50 PM   #3
skevill
Registered User
 
Join Date: Nov 2003
Posts: 24
Default

Thanks for the reply. I should have given more info though. The instance names of the buttons can not be numbered in an ordered way. They will be named as numbers, but the sequence could jump from 3 to 7 to 23. Also, because there may anywhere from 5 to 500 buttons, I will not know the number of instances in the movie. I was hoping to hear that there is a buttons collection or something similar to loop through.
skevill is offline   Reply With Quote
Old 12-02-2003, 05:55 PM   #4
binkyboo
Senior Member
 
binkyboo's Avatar
 
Join Date: Mar 2002
Location: Madison, Wisconsin
Posts: 1,312
Send a message via MSN to binkyboo
Default

How are the button instance names generated? What you could do is push the instance names into an array which is essentially your "buttons collection." From there you can loop through the array and apply whatever functionality you need.
binkyboo is offline   Reply With Quote
Old 12-02-2003, 06:13 PM   #5
skevill
Registered User
 
Join Date: Nov 2003
Posts: 24
Default

The instance names are hardcoded by hand, as each button instance is placed on the movie manually. I do not want to count the number of buttons placed on the movie as I do this, because I will be running my loop from another container movie that will have to loop through however many buttons are on the movie that I load. The movies that I will be loading will have no set number of buttons that I need to loop through.
skevill 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:56 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.