So you’re bumping along doing some work in Adobe Flex using the flex sdk and you need to get some debug information about what’s going on in one of your applications. You know that the guys using Adobe’s Flex Builder IDE have source level debugging but you don’t have the Flex Builder or, for whatever reason, don’t want to use it.
Here’s a quick how-to for setting up flex debugging to an output file, plus a link to a very simple test application that is known to work so that you can ensure that you have debugging setup properly on your test machine before you start tearing your hair out.
- You need to ensure that you have the debug version of the Flash Player installed. You can find instructions on installing the Flash Debug Player here. The instructions appear to be a bit dated, in the version of the SDK that I have on my development box there is no “uninstall_flash_player.exe”. I simply ran the “Install Flash Player 9.exe” and then after rebooting my system seemed to work fine. Notice that the link above also allows you to validate that you have successfully installed the debug player.
- To enable writing to a text file you will need to create a mm.cfg file on your system placing it in the appropriate directory for your operating system.
- OSX : /Library/Application Support/Macromedia/mm.cfg
- Windows : C:\Documents and Settings\<username>\mm.cfg
- Linux : /home/<username>/mm.cfg
- Now open the file you’ve just created and add the the following 2 lines to the file :
- ErrorReportingEnable=1
- TraceOutputFileEnable=1
- That’s about all there is to it, although I think I ended up rebooting before it worked properly. Now go to a simple Flex test app I threw together to generate output data to the file.
- Click on the button labeled “Click Me”.
- If you have been successful in setting up the debugging you should see output written to a file appropriate for your operating system :
- OSX : /Users/<username>/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt
- Windows : C:\Document and Settings\<username>\Application Data\Macromedia\Flash Player\Logs\flashlog.txt
- Linux : /home/<username>/Macromedia/Flash_Player/Logs/flashlog.txt
- Next time we’ll get into some more advanced debugging tools available.
Categories: flex, programming Tags: adobe, adobe flash, adobe flex, builder, debug file, flash, flex debugging, flex development, how, how-to, howto, to
I’ve been reading through a bunch of books on Flex development. It’s pretty interesting stuff. It is probably most easily understood as a programmatic interface into Flash with a bunch of widgets such that you can develop very sophisticated applications that talk asynchronously to a backend server. The upside of this being that wherever you can get a Flash player installed you can have your application and it works the same everywhere, something that can’t be said for AJAX.
I wrote up a quick app yesterday afternoon to look at a customized RSS feed for this blog and allow a user to navigate through the results. It’s just something I was fiddling with, it’s not complete and probably never will be. I’m going to investigate a different approach to some things I was doing to see if it makes things cleaner. Check it out here
I’ve been reading Paul Graham’s book on ANSI Common Lisp, and Gleick’s Chaos, and probably a Remo Williams adventure or two ( gotta have the mindless fiction, it’s like TV but, Remo is entertaining ). At some point, while reading either Graham’s book, or essays on his website, i realized that i could implement a “top level” ( of a sort ) in PHP. It wouldn’t be as powerful , but it would allow me to interact with my system in a way that would normally require lots of screwing around otherwise.
So I sat down and coded it up before work one morning and then a few days later I updated the console to utilize a bit of AJAX to support history browsing. It has worked terribly well, i’ve been pretty impressed with what i’ve been able to pull off with it. Building new classes has gotten easier, because i can build out a test harness quickly and just keep executing it while i’m developing, but the more impressive bit is when I have a bug in the system, i’m able to test specific pieces in the system quickly without having to open up a bunch of different files.
I realize that this is not the behaviour that a top-level provides, as a top level allows you to drop new classes/methods into the system and they stay there until the system is rebooted or you get rid of them. However, i’ve sorted through this by using a text area for the input, giving me the ability to write large bodies of script. This allows me to write classes/methods/etc and execute it all at once, so while it is not exactly the same, the spirit is there. I suppose it would be relatively straightforward to add in some stuff to actually write out these things to files and then have them hang around indefinitely, but there’s some issues with the implementation that make it a non-trivial problem, and i don’t know that there’d be much benefit.
The system is almost completely stabilized from the massive rewrite of pretty much everything. The resource management system is almost there, a few things to finish as part of the cleanup of the database during the move to Postgres.
I was doing some work for a client this weekend and needed to resize a photo. I dusted off the picprep source, built the app, and did what I needed to do, but i noticed an odd problem in the way it worked. So i earmarked that for further investigation when my work was done. Sure enough, when I got some time to look at it in detail there was a bug in picprep, and it was a kinda major bug.
I know how it made it this long without being discovered, the bug only shows up when you are working against single files, and not doing appending of characters to the output filenames, but i should have caught this a lot sooner. I fixed the bug, and then started looking through the rest of the source and found some interesting things in my notes about this project. I had mentioned that I would port this to linux at some point. However when i looked at the source, it had been ported to linux ( i think i did this one morning when shad needed it, and forgot to package it up for general release ) So the application now runs natively on windows/osx/linux, pretty cool on that deal.
I thought of a couple of features that I could use in this product so perhaps when time allows i’ll add them they include :
- rotate process : the ability to rotate images would be nice
- collage process : the ability to point picprep at a bunch of image files and have it turn them into a single large file would be nice. this would include the ability to generate an image map coordinates file back to the original pictures such that you could drop the resulting image and coords onto a webpage and have a interface into the pictures
- command files : it would be convenient to be able to save a set of operations into a text file such that if you were always wanting to process files in a particular manner you could just drop them into some directory and then say “run these commands on this directory”. The thing about picprep is that its processes are discrete operations such that if you want to rotate, add border and then create a collage that is three seperate commands that must be issued to picprep in series, having the ability to create command files for multi-step operations would obviate the need of ways to chain the operations together internally.
- border process : i haven’t looked into this but i’ve seen a bunch of images on the web where people add a little white border around their photos, I guess to give it the polaroid instamatic touch. It might be kinda nice to be able to say “add border to these photos”
I’ll probably spend some time on this when I need a little bit of sanity in my life. The myndkryme website has been down for a while not sure why, haven’t talked to the ISP about it yet. So if you want new builds of picprep ask me directly here, and i’ll get them posted somewhere where you can download them.
Went to Stanford in December to watch a Knuth lecture. It was interesting, he kept the heavy math bits out of the lecture so i could understand it. ( well not so I myself could understand it, but as a consequence of him keeping the math bits out, i was able to understand it. )
I’ve been slowly reading through his MMIX paper, it has been interesting, although i have had to take detours to understand some things that he takes for granted.
Shad sent me this today :
