Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

for .. in loop, can it give more details?

Status
Not open for further replies.

25884

Programmer
Mar 12, 2001
46
0
0
AP
Hello,
I have a query,
I am using the for..in loop to list down the elements in any component.
Is there a way to list down the whole signature of these elements in the component?
I basically need a way to segregate the listing provided by the for..in loop into movie clip, method.. etc
Rgds,
Sonali.
 
what do you mean "the whole signature" ? Diana.
icq: 111872918
 
an example of what you can do with
Code:
 for ... in
suppose you have a movieclip called table and inside it you have many buttons. the actions you want each button to do on
Code:
rollOver, rollOut, relase
and any other event you can put in a single frame, instead of putting them on any button.

suppose again that some of my buttons are called
Code:
bn1, .. bn15.
and you only want those buttons to do that action:

Code:
for (name in _root.table) {
	if (typeof (_root.table[name]) == "object") {
		cntr++;
		if (name.charAt(1) == "n") {
			_root.table[name].onRollOver = function() {
				_root.action1(this._name.substring(2, this._name.length));
			};
			_root.table[name].onRollOut = function() {
				_root.action2(this._name.substring(2, this._name.length));
			};

[red]
Code:
this._name.substring(2, this._name.length));
[/red] will only take the numbers at the end of the name.

This was just an example so you'll see how i refer to the names of the buttons inside the movieclip.

Hope it helps. Diana.
icq: 111872918
 
might be better to get at the buttons through the label property

 
Hi All,
Thanks a lot for the prompt reply.It helped me a lot.What i mean by the whole signature is--If i have a method called addItemAt(index,value) - Which takes in a number for index , a string as value to be added ,then is there a way to get something like - getItemAt - Is a function - Takes a number as parameter1 and a string as parameter2.Or just that it takes in two parameters.
Hope i was clear enuf.
thnx,
Sonali.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top