This seems to work great on the right hand side and comes back with the correct data when traced but I need to use that value as my target. I may be missing something completely obvious as I'm a total newbie on the coding so forgive me if I'm overlooking something simple.

I have uploaded my fla and the xml I'm using here if anyone wants to check it out. I have commented out the section I'm having trouble with.

http://www.billpelon.com/mainFeature.zip


The code I'm stuck on is  ClipEvent(load) of the MC on layer 2.

Thanks again,
Bill


----- Original Message ----- From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Thursday, October 19, 2006 3:40 PM
Subject: Re: [Flashcoders] incrementing a target?


Hi,

   There maybe a typo in your code?

   it should say subMC["textField" + i]
There should be no (dot) "." before the (square bracket) [

Basically you treat the movieclip subMC like an array. It contains some text fields "textField0", "textField1", etc. so you can index the array with to get the contents of it.

You can do the same with your other bit of code rather than using eval:

//instead of
but = eval("but"+i);

//Try this - not sure if you need to use the "this" operator, but it makes things clearer.
but = this["but" + i]



Bill Pelon wrote:
Seems to jumble me up a bit, I get this error.

Expected a field name after '.' operator.
_root.mainMC.auto.subMC.["textField"+i].text = turbo.attributes.name;

thanks though...



----- Original Message ----- From: "Glen Pike" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Thursday, October 19, 2006 3:16 PM
Subject: Re: [Flashcoders] incrementing a target?


Erm, I think you might want to try

_root.mainMC.auto.subMC["textField" + i].text

Not sure.

Bill Pelon wrote:
Hello,

I'm having problems figuring out how to grab an array value and use that when targeting.

This is my fucntion below. What I am wanting to do is take the [i]value and be able to use that when trying to write to my textfields

////////////////////////////////////////////////////////////////////////////////////////////
function ExpandData(turbo){

var turboItem = turbo.firstChild.childNodes;
for (var i = 0; i < turboItem.length; i++){
 but = eval("but"+i);
 var turbo = turboItem[i];

 _root.mainMC.auto.subMC.txtField+i.text = turbo.attributes.name;

 }

}
///////////////////////////////////////////////////////////////////////////////////////

Thanks,
Bill


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to