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 ?
- Has been a member for 3-4 years
- Won a Competition
- Author had a File in an Envato Bundle
- Author had a Free File of the Month
- Item was Featured
- Author was Featured
- Exclusive Author
- Sold between 50 000 and 100 000 dollars
- Bought between 10 and 49 items
- Referred between 50 and 99 users
- Has been a member for 3-4 years
- Author had a File in an Envato Bundle
- Interviewed on the Envato Notes blog
- Author had a Free File of the Month
- Item was Featured
- Author was Featured
- Beta Tester
- Exclusive Author
- Sold between 250 000 and 1 000 000 dollars
- Bought between 10 and 49 items
- Italy
- Referred between 100 and 199 users
- Has been a member for 3-4 years
- Item was Featured
- Author was Featured
- Exclusive Author
- Sold between 5 000 and 10 000 dollars
- Bought between 10 and 49 items
- Serbia
- Referred between 10 and 49 users
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.- Has been a member for 4-5 years
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Item was Featured
- Beta Tester
- Exclusive Author
- Sold between 100 and 1 000 dollars
- Bought between 1 and 9 items
- United States
- Referred between 10 and 49 users
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 
- Has been a member for 3-4 years
- Author had a File in an Envato Bundle
- Interviewed on the Envato Notes blog
- Author had a Free File of the Month
- Item was Featured
- Author was Featured
- Beta Tester
- Exclusive Author
- Sold between 250 000 and 1 000 000 dollars
- Bought between 10 and 49 items
- Italy
- Referred between 100 and 199 users
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 
- Has been a member for 3-4 years
- Item was Featured
- Author was Featured
- Exclusive Author
- Sold between 5 000 and 10 000 dollars
- Bought between 10 and 49 items
- Serbia
- Referred between 10 and 49 users
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.
