- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 50 and 99 users
I’m trying to set up a client debugger (rather than have them install the flash debug player), and instead have any errors trace out to a textfield. Anyone know the best way to do this in AS3 ?
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Interviewed on the Envato Notes blog
- Author was Featured
- Item was Featured
- Beta Tester
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
EDIT :
Now i see that marc wanted to trace errors
It’s late 
but you can remove them easily.
Usage (in main class):
import com.golle.debug.*
......
......
addChild(new AlertPanel())
.........
........
//use this instead of trace
AlertPanel.alert("something")
You can also create alert.as file in same folder and place this code, then you can do “trace” just width
alert("something")
In subclases you don’t need to add panel on stage, just import it and call alert method.
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtErrors);
function handleUncaughtErrors(e:UncaughtErrorEvent):void{
e.preventDefault();
trace("BOO! ... ",e.error);
}
addChild(null);
Just change the trace to add lines of text to your textField
(and remove the “addChild(null)” .. that is just to demo functionality, of course
)
Actually you only need preventDefault() if the client is using a Debug Player and you don’t want the run time error popped up as usual …it’s best not to use at all because it can screw up your development effort; if you leave it enabled you won’t see any run time errors in the Output Panel of the Flash IDE either!
And by the way … I find anyone using UncaughtErrorEvent.preventDefault() in Activeden submissions to prevent runtime errors showing up in the debug player it will be an automatic rejection 
- Sold between 250 000 and 1 000 000 dollars
- Exclusive Author
- Interviewed on the Envato Notes blog
- Author was Featured
- Item was Featured
- Beta Tester
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
theflyingtinman said
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, handleUncaughtErrors); function handleUncaughtErrors(e:UncaughtErrorEvent):void{ e.preventDefault(); trace("BOO! ... ",e.error); } addChild(null);Just change the trace to add lines of text to your textField
EDIT :
Now i see that marc wanted to trace errors
It’s late 
ParkerAndKent said
Now i see that marc wanted to trace errorsIt’s late
![]()
Oh, now I saw that too, sorry. Btw, uncaughtErrorEvents is available on fp 10.1 and later.
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Author was Featured
- Bought between 10 and 49 items
- Exclusive Author
- Has been a member for 4-5 years
- Item was Featured
- Referred between 50 and 99 users
EXCELLENT ! THANKS EVERYONE . I love this place. You guys are my hero.
