Trace in FDT without Debug Perspective

I recently switched to OS X, so I can't use my beloved FlashDevelop. FDT is really the most viable option despite the price tag. It takes awhile to get used to Eclipse and get all the settings dialed in, but it's worth it.

The only last major issue I had was getting trace output from the debug player to appear in the Eclipse console without launching a Debug task (way too much additional overhead just to see trace messages).

I'm on OS X which has 'tail' -- if you're on windows (why aren't you using FlashDevelop?), you'll have to use cygwin or get fancy with the batch scripting. There's also something called tail.exe from MS...

Found this: http://flash-focus.blogspot.com/2007/06/creating-bare-bones-output-window-in.html which outlines how to configure the Debug Player to drop trace messages into a log file.

First, I followed those instructions ... then in Eclipse added an External tool configuration:

Run >> External Tools >> External Tools Configurations
New Program
Location: /usr/bin/tail
Arguments: -f "/Users/MYUSER/Library/Preferences/Macromedia/Flash Player/Logs/flashlog.txt"

I wasn't able to point to the user Library via ~/Library -- maybe that's an Eclipse shortcoming...

Launch that, and it appears as one of the running console logs, then you can run your build normally, ANT or what-have-you, and you'll still get the trace output without all the debug perspective stuff, and it's about a zillion times faster. Yay!

Seems like there ought to be console level configuration somewhere, but I'm no Eclipse expert.

Hope this helps someone else.

I decided I'd try an FLA-less project using embedded library assets from swfs, but that proved contrary to my workflow. If I'm going to use the IDE for layout, then I've got a good handful of layers. Not just a graphic or three. I want several things to align, you know visually, so I used a visual layout tool to configure my layout. Smart, huh? But you can't pull in an entire timeline worth of assets and then provide the class and still expect to get the whole thing wired up. Flex compiler's gotta be all one child asset at a time within the class.

Despite reading more than once that you could somehow:

[Embed (src="library.swf", symbol="layout"]
public class layoutClass extends Sprite
{
// rest of class here
}

I never got it to work. I only got the directive to work for class property members, not the class definition itself.

You could use composition to pull an entire layout's worth of assets in. But then you've got this magic asset container property that's different from the local "this" context. No, I wanted all the assets linked to the class in one place, like I was used to with the IDE in the first place.

I decided it was worth it to reparent all the assets out of a temporary holder, and reconstruct the layer stack in the new parent.

I knew the code for this wasn't hard or long, but it isn't exactly obvious:

//Layout is a class that can be populated via
//embed directive or by having a 'skin' swc in your classpath. 

var layout:Sprite = new Layout()

var len = layout.numChildren
for (var i=0; i<len ; i++) {
  //move the child into this
  var c = addChild (layout.getChildAt(0))
  //link the property name of the class to the asset
  this[c.name] = c
}

Merry WhateverDecemberweenNewYear.