Re: [Flashcoders] AS3 Call a function from an array

2008-09-06 Thread Gerry
Crap... My bad, I sent a code sample that didn't have the function calls I was getting from the XML. Your sample is exactly what I was looking for. I never included the functions that the array contains because I figured that was assumed. They are just two functions right now that look like

Re: [Flashcoders] AS3 Call a function from an array

2008-09-06 Thread jonathan howe
Mike asks an important question, but assuming for the moment the function is in the same class as playNextSection(): What you're retrieving from the XML is a String. So the line > stepArray[stepCount]["fnct"](val); isn't going to call a function. It's going to try to treat a string as a function..

Re: [Flashcoders] AS3 Call a function from an array

2008-09-06 Thread Mike Chambers
Where is the actual function? You cant store a function in XML, on the name. You can then use that name to construct a call to the function. Where is the function? mike chambers [EMAIL PROTECTED] mike chambers [EMAIL PROTECTED] On Sep 6, 2008, at 7:40 AM, Gerry wrote: Mike, Neither of t

Re: [Flashcoders] AS3 Call a function from an array

2008-09-06 Thread Gerry
Thanks Mike! -Gerry On Sep 6, 2008, at 12:47 AM, Mike Chambers wrote: if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0]["fnct"](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote:

Re: [Flashcoders] AS3 Call a function from an array

2008-09-05 Thread Mike Chambers
if fnct is a function: stepArray[0].fnct(); if it is a string: stepArray[0]["fnct"](); The 0 is the index from the array you want to retrieve. mike chambers [EMAIL PROTECTED] On Sep 5, 2008, at 8:30 PM, Gerry wrote: I have an array built from and XML file that I want to step through and o

[Flashcoders] AS3 Call a function from an array

2008-09-05 Thread Gerry
I have an array built from and XML file that I want to step through and one of the nodes will have a function to call. I thought I did this in AS2 before but can't find my code. I'm stuffing my array with the function string cast as an object but I can't seem to find any hints on how I shoul