Re: [Flashcoders] How to make flash more strict with errors ?

2006-05-10 Thread Paul BH

thats a very open question, even though it may not feel like it.

here are some of the things you can do to try and reduce things
happening unexpectedly:

1: In your classes make your variables / methods private unless they
absolutely must be public.
2: Strictly type *everything* - this may seem like a pain at first,
but it will save you heavy pain later.
3: This includes dispatched event Objects
4: And elements of an array if you know (or expect) that they are all
of the same type. By this I mean, if you are iterating through the
elements of an array, do soemthing like this:

var arrayItem:SomeItem
var max:Number = arr.length
for (var i:Number=0;imax;++i){
arrayItem = SomeItem(arr[i])
}
5: Use Exceptions
6: Unit test your apps.


On 5/10/06, Nik Derewianka [EMAIL PROTECTED] wrote:

Hi,

Is there anyway to make flash actually throw errors when things go wrong.
instead of just silently failing and pretending that everything is all okay
?

Cheers,
:: Nik Derewianka ::
___
Flashcoders@chattyfig.figleaf.com
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


___
Flashcoders@chattyfig.figleaf.com
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


Re: Re: [Flashcoders] How to make flash more strict with errors ?

2006-05-10 Thread John Mark Hawley
If you're writing something quick and dirty with a lot of code thrown all over 
the timeline (like an ad prototypeyou have two hours to put together), coding 
in a __resolve function on the _root (or right on the Object prototype) that 
throws errors when called can be a typo-finding lifesaver.

 
 From: Paul BH [EMAIL PROTECTED]
 Date: 2006/05/10 Wed AM 09:34:33 CDT
 To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com
 Subject: Re: [Flashcoders] How to make flash more strict with errors ?
 
 thats a very open question, even though it may not feel like it.
 
 here are some of the things you can do to try and reduce things
 happening unexpectedly:
 
 1: In your classes make your variables / methods private unless they
 absolutely must be public.
 2: Strictly type *everything* - this may seem like a pain at first,
 but it will save you heavy pain later.
 3: This includes dispatched event Objects
 4: And elements of an array if you know (or expect) that they are all
 of the same type. By this I mean, if you are iterating through the
 elements of an array, do soemthing like this:
 
 var arrayItem:SomeItem
 var max:Number = arr.length
 for (var i:Number=0;imax;++i){
  arrayItem = SomeItem(arr[i])
 }
 5: Use Exceptions
 6: Unit test your apps.
 
 
 On 5/10/06, Nik Derewianka [EMAIL PROTECTED] wrote:
  Hi,
 
  Is there anyway to make flash actually throw errors when things go wrong.
  instead of just silently failing and pretending that everything is all okay
  ?
 
  Cheers,
  :: Nik Derewianka ::
  ___
  Flashcoders@chattyfig.figleaf.com
  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
 
 ___
 Flashcoders@chattyfig.figleaf.com
 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
 

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)

___
Flashcoders@chattyfig.figleaf.com
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