[Flashcoders] passing an array as a method = TypeError: Error #1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Rodrigo Augusto Guerra
Hi all, I'm creating a simple class that has an method that will receive an array as a parameter and store it inside the class in a property. This gives me the error below and I'm stuck. Also I would like to know why if I change the code inside the method setGabarito to just ( aRespGabarito =

RE: [Flashcoders] passing an array as a method = TypeError: Error #1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Cor
Data is an Array and p is a String -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Rodrigo Augusto Guerra Sent: donderdag 1 juli 2010 15:36 To: Flash Coders List Subject: [Flashcoders] passing an array as a

Re: [Flashcoders] passing an array as a method = TypeError: Error #1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Rodrigo Augusto Guerra
thanks for your reply cor, you are correct, p1 is a parameter for the constructor (as string) and for the method (as array). Still, if i change the datatype of data to string the error persists public function setGabarito(p1:Array) { var tamanho = p1.length - 1 // o indice comeca com zero

Re: [Flashcoders] passing an array as a method = TypeError: Error#1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Rodrigo Augusto Guerra
thanks david, that did the trick... I also realized that this MUST be done inside the method and not along with the declaration on the top of the class, sorry abt my ignorance but why ? thanks! - Original Message - From: David Hunter To: rodr...@alumni.org.br Sent:

RE: [Flashcoders] passing an array as a method = TypeError: Error#1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Merrill, Jason
From your loop, you're accessing an array element that doesn't exist. I would actually advise a different approach to the problem. Don't use pure arrays within pure arrays (called multidimensional arrays). I find it very hard to understand and maintain that code. It can get confusing easily and

Re: [Flashcoders] passing an array as a method = TypeError: Error#1009: Cannot access a property or method of a null object reference.

2010-07-01 Thread Rodrigo Augusto Guerra
Thanks for your insights Jason. At this moment I'm migrating some AS2 code to AS3 OOP, and as seen, I'm not that familiar with OOP, that´s why these directions are *VERY* helpfull welcome. thanks. - Original Message - From: Merrill, Jason jason.merr...@bankofamerica.com To: