Junk Byte Code for Kicks

25Feb/120

ASDOC inside SWC

Just learned how to include asdoc inside swc so that it shows up in IDE
(tested with FlashBuilder).

Thanks to http://forums.adobe.com/thread/444791

Added a new console download: Console2.6+asdoc.swc

http://code.google.com/p/flash-console/downloads/list

19Feb/129

Flash String weirdness

A long time ago...

I had this bug report in Console that FPS and memory graph is leaking memory.
Issue: http://code.google.com/p/flash-console/issues/detail?id=89
I was not able to find the exact cause of this other than the fact that if I don't update texts in graph, it doesn't show any memory problems.
I suspected back then that Strings were strange but was not able to pin point what's strange about it.

Fast forward to today

I recently learned that flash keeps 'master string' of strings when they get passed around.
See http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/sampler/package.html#getMasterString()
Quote:

For example, if you call String.substr(), the returned string will often actually be implemented as just a pointer into the original string, for the sake of efficiency. In normal usage, this is an implementation detail which is not visible to the user; however, it can be confusing when using a profiler to analyze your program's memory consumption, because the string may be shown as taking less memory than would be needed for the string's value. In addition, a string might be retained in memory solely because it is the master for other strings. getMasterString() allows profilers to show the user an accurate graph of string dependencies.

It sounds good, it is obviously saving memory by not copying the strings and reusing via referencing to original string where possible.
But...

  • What if you only need to keep a tiny part of the string (say downloaded from an external file), will it know to discard the big string?
  • What if you chain a lot of strings together, will it keep references to all its parts?
  • Could it cause memory leaks?
14Jul/102

BitmapMovieClip

A lot don't seem to know how expensive (slow) it is to render and display vectors in flash.
Yes,... flash is famous for great vector animations, but it is actually very slow to have too many vectors in one screen (or when offscreen on stage) because it needs to render them every time they get changed to another frame or possibly when moved around too.
Specially in games, this sort of performance issue can effect the player's experience.
Have no fear! BitmapMovieClip is here to help...
10Jul/106

Console has arrived

Finally managed to rename the Console source package name to junkbyte.com

That took quite a lot of afford. Had to change all documentations and sample files as well.
I am afraid I will piss some users because I've also made a lot of changes to how console is set up in this new version.
Here is the changes note of the last version:

Version 2.4 BETA

  • Renamed source package name to com.junkbyte.console - to be less personal
  • Move a lot of 'configuration' settings from C. to ConsoleConfig (that you pass at start)
  • Due to security concern, CommandLine is no longer allowed by default. You must do C.commandLineAllowed = true OR C.commandLine = true (to allow and show)
  • CommandLine: no longer auto scope to new return. Enter '/' to change scope to last returned object. Turn on auto-scoping by typing /autoscope
  • Very long lines are automatically split before displaying to increase speed
  • Custom graphing is now passed into remote.
  • Added C.explode
  • Added C.stack
  • Added C.autoStackPriority and defaultStackDepth in ConsoleConfig
  • C.fatal will get auto stack trace by default.
  • External trace call will have channel name as first param, log line as second param and priority as third
  • Removed tracingPriorty, prefixChannelNames, tracingChannels
  • Removed C.filterText and C.filterRegExp - use /filter in interface
  • Removed C.gc() - use memoryMonitor - G button in interface.

Source code and most of documentation will still be hosted in: http://code.google.com/p/flash-console/

AsDoc is now located here: http://junkbyte.com/flash-console/asdoc/com/junkbyte/console/Cc.html

Sample here: http://junkbyte.com/flash-console/

This site will act as a 'blog' and second degree support.
Will be writing more about console in later posts. I always wanted to write all about it somewhere and now I can...

Console Controls: