PhotoDune

Help. Trace output dialog to textfield.

842 posts
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
+2 more
marcfolio says

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 ?

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

EDIT :

Now i see that marc wanted to trace errors :-p It’s late :)

44 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Has been a member for 4-5 years
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Serbia
golle says
I use this, I made it some time ago. Unfortunatly I was bored few days ago, so I add bunch of unnecessary stuff :-) 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.
2309 posts
  • Beta Tester
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 10 and 49 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 100 and 1 000 dollars
  • United States
theflyingtinman says
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 :D

3256 posts
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Interviewed on the Envato Notes blog
  • Beta Tester
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
+4 more
ParkerAndKent says

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 :-p It’s late :)

44 posts
  • Sold between 5 000 and 10 000 dollars
  • Exclusive Author
  • Has been a member for 4-5 years
  • Author had a File in an Envato Bundle
  • Bought between 10 and 49 items
  • Referred between 10 and 49 users
  • Serbia
golle says

Now i see that marc wanted to trace errors :-p It’s late :)

Oh, now I saw that too, sorry. Btw, uncaughtErrorEvents is available on fp 10.1 and later.

842 posts
  • Author had a File in an Envato Bundle
  • Author had a Free File of the Month
  • Bought between 10 and 49 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 50 and 99 users
+2 more
marcfolio says

EXCELLENT ! THANKS EVERYONE . I love this place. You guys are my hero.

by
by
by
by
by