ActiveDen

Help. Trace output dialog to textfield.

836 posts
  • 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
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
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 ?

1 year ago
3086 posts
  • 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
  • Beta Tester
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Italy
  • Referred between 100 and 199 users
ParkerAndKent says

EDIT :

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

1 year ago
40 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Serbia
  • Referred between 10 and 49 users
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.
1 year ago
2309 posts
  • Has been a member for 4-5 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • 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
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

1 year ago
3086 posts
  • 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
  • Beta Tester
  • Exclusive Author
  • Sold between 250 000 and 1 000 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Italy
  • Referred between 100 and 199 users
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 :)

1 year ago
40 posts
  • Has been a member for 3-4 years
  • Exclusive Author
  • Sold between 5 000 and 10 000 dollars
  • Bought between 10 and 49 items
  • Serbia
  • Referred between 10 and 49 users
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.

1 year ago
836 posts
  • 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
  • Exclusive Author
  • Sold between 50 000 and 100 000 dollars
  • Elite Author
  • Bought between 10 and 49 items
  • Referred between 50 and 99 users
marcfolio says

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

1 year ago
by
by
by
by
by