[Flashcoders] adjusting postion of dynamically loaded images

2010-07-01 Thread Pankaj Singh
hello everyone i am trying to set x positions of different images which are being dynamically loaded depending upon their width i m writting this code in a for loop imageLoader[i].load (new URLRequest( xmlLettersList[i].attribute(img))); imageLoader[i].width =

Re: [Flashcoders] adjusting postion of dynamically loaded images

2010-07-01 Thread Glen Pike
You should listen for the INIT event, not the COMPLETE one - the images won't have a width until they are initialised. Glen On 01/07/2010 13:50, Pankaj Singh wrote: hello everyone i am trying to set x positions of different images which are being dynamically loaded depending upon their width

Re: [Flashcoders] adjusting postion of dynamically loaded images

2010-07-01 Thread Pankaj Singh
even after using INIT i m getting 0 width because event listener function is never called (trace statement is not working) for (var i:int=0; i lettersCount; i++) { imageLoader[i].load (new URLRequest( xmlLettersList[i].attribute(img))); imageLoader[i].width =

[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] adjusting postion of dynamically loaded images

2010-07-01 Thread Jared
Try it in the second trace you have; it's not loaded When you're first tracing Sent from my iPhone On Jul 1, 2010, at 6:32 AM, Pankaj Singh singh.pankaj.iitkg...@gmail.com wrote: even after using INIT i m getting 0 width because event listener function is never called (trace statement is not

Re: [Flashcoders] adjusting postion of dynamically loaded images

2010-07-01 Thread Glen Pike
Hi, Are you storing your loaders somewhere outside the function - e.g. is imageLoader an array outside the function? If not, your loaders may go out of scope... Also, your function imgInitialised may go out of scope because that is declared inside the loop - not 100% about this, but try

Re: [Flashcoders] adjusting postion of dynamically loaded images

2010-07-01 Thread Glen Pike
Hi, Oops, missed one - try calling load() after you added the listener... Glen On 01/07/2010 14:32, Pankaj Singh wrote: even after using INIT i m getting 0 width because event listener function is never called (trace statement is not working) for (var i:int=0; i lettersCount; i++)

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] adjusting postion of dynamically loaded images

2010-07-01 Thread Pankaj Singh
thanks to everyone my problem has been solved :D On Thu, Jul 1, 2010 at 7:14 PM, Glen Pike g...@engineeredarts.co.uk wrote: Hi, Oops, missed one - try calling load() after you added the listener... Glen On 01/07/2010 14:32, Pankaj Singh wrote: even after using INIT i m getting 0

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:

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
Sure. This is anAS3 example, but you can still do the same thing with VOs in AS2 as well. Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these