RE: [Flashcoders] Accessing an Associative Array

2007-03-13 Thread Merrill, Jason
;; >> >> >>If you really want an associative array, look at Jason's >>answer Otherwise keep on using the Object notation, but you >>will lack all the Array object specific methods >> >> >>Alain >> >>-Original Message- >>F

RE: [Flashcoders] Accessing an Associative Array

2007-03-13 Thread Alain Rousseau
associative array, look at Jason's answer Otherwise keep on using the Object notation, but you will lack all the Array object specific methods Alain -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andy Herrman Sent: 12 mars 2007 16:47 To: flashcod

Re: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Bill Abel
uot; trace(this[myVar]["elem1"]) //traces "wassup" Jason Merrill Bank of America Global Technology & Operations Learning & Leadership Development eTools & Multimedia Team -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Bill Abel
Your right. I am passing a string. But I'm trying to use that string to access an array by the same name. someArray = { label: "my text" }; showPopup("someArray"); // send a string which is the name of my array in the function: myDynamicText.text = myArray["label"]; // try to use the passed

RE: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Merrill, Jason
mp; Leadership Development eTools & Multimedia Team >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PROTECTED] On Behalf >>Of Bill Abel >>Sent: Monday, March 12, 2007 5:02 PM >>To: flashcoders@chattyfig.figleaf.com >>Sub

Re: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Bill Abel
How do you do it where myVar is the array? Is this possible? Or do you always have to specify the array? arr = new Array() arr["elem1"] = "hello" arr["elem2"] = "hi" function testArray(myVar) { trace(myVar["elem2"]); }; testArray(arr); On Mar 12, 2007, at 3:17 PM, Merrill, Jason wrote: ar

Re: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Andy Herrman
I think this is your problem: showPopup("myarray"); You're passing showPopup a string with the value "myarray", not the array. Remove the quotes and you should be good. -Andy On 3/12/07, Bill Abel <[EMAIL PROTECTED]> wrote: How do you access an associate array using a variable? Inside my f

Re: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread R�kos Attila
Variable identifiers are not string constants, so: showPopup(myarray); However mainMap[popup].gotoAndPlay("on"); has no sense in this case, since the array notation excepts a string and not an object. Ans also you don't need to use array notation here at all, the simple dot syntax is enough: mya

RE: [Flashcoders] Accessing an Associative Array

2007-03-12 Thread Merrill, Jason
arr = new Array() myVar = "elem2" arr["elem1"] = "hello" arr["elem2"] = "hi" trace(arr[myVar]) Jason Merrill Bank of America Global Technology & Operations Learning & Leadership Development eTools & Multimedia Team >>-Original Message- >>From: [EMAIL PROTECTED] >>[mailto:[EMAIL PR