PDA

View Full Version : try catch...not working



outback
June 7th, 2009, 11:28 AM
Hi all,

I'm having a problem trying to disable an error message, I was told to use the folowing code:


try{
//bad line of error
}catch(err:Error){}

what part of my line of error should I use?

TypeError: Error #1009: Cannot access a property or method of a null object reference.
at <anonymous>()[los_poseidos_fla.MainTimeline::frame1:118]

Thanks

senocular
June 7th, 2009, 11:48 AM
Debug your movie to find out. (In Flash, use Debug > Debug Movie)

outback
June 7th, 2009, 01:14 PM
Isn' there a way to disable all error messages at once?

senocular
June 7th, 2009, 06:59 PM
Isn' there a way to disable all error messages at once?

Yeah, write code that doesn't cause errors. That's why the errors are there in the first place, to tell you something is wrong with your code. Its your job to make sure that's taken care of.

and in case you were looking for a catch-all error handler, unfortunately Flash doesn't have one.

outback
June 7th, 2009, 07:54 PM
thanks, I fixed the errors