FlashForward 2004 this week

I’ll be in NYC for FlashForward towards the end of the week this week. I will be in town from thursday afternoon till saturday and will only be attending the conference on Friday. I’m really looking forward to Jared’s session, it’s his first time speaking and am sure it will be very intersting.

Also I have been too busy to keep up with what friends will be attending so drop me a line sometime this week so we can meet up.

Note to Self, scrollIt() in ScrollBar class can lead to infinite loop

IÂ’m posting this here in case anyone runs into a similar issue. In a recent application we built (All V2 based of course) we got a bug which turned out to be much harder to track down than initially anticipated.

Essentially what would happen is if a user clicked the up or down arrows on a scrollbar the player would stop executing any more code because of an infinite loop. After spending a lot of hours I tracked it down to an issue with the user clicking a ScrollBar’s up/down arrows which would in turn call the scrollIt() function inside of the ScrollBar class and somehow an infinite loop would occur (The ScrollBar in use was part of a ScrollPane). At first I tried to comment out the code inside of the scrollIt() function with no luck, then I tried just not calling scrollIt() which worked but didnÂ’t really help, I even tried re-writing some of the code of the ScrollBar class and also had no luck. At the end I ended up copying the scrollIt() functionÂ’s code into a new function called scrollIt2() and calling that instead when the user clicks up/down and that worked. Why it worked I have no idea, I spent a few more hours after fixing it trying to narrow it down and couldnÂ’t find any logical reason for the bug and had to move on.

I’ll go back and look at it one day when I have some more free time and isolate the issue.

B-Line Charting Components 3.0 For Flash MX 2004 Now Available

We released our major update to B-Line Charting Components 3.0 today. This includes migration to the v2 architecture as well as internal updates to accomodate new features including combination charts, eight different axis scales, custom axis normalization routines, the ability to attach the legend to a container outside the chart, and enhanced styles support.

The set now includes fifteen charting components.

  1. Area Chart
  2. Box Chart
  3. Bubble Chart
  4. Candlestick Chart
  5. Clustered Bar Chart
  6. Combo Chart (new)
  7. Hi-Low Chart
  8. Horizontal Clustered Bar Chart (new)
  9. Horizontal Stacked Bar Chart (new)
  10. Line Chart
  11. Pie Chart
  12. Scatter Chart
  13. Stacked Bar Chart
  14. Step Chart (new)
  15. Triangle Chart

Notable features added in this release include

  • Enhanced event meta-data
  • Eight axis scales plus a custom scaling mechanism
  • Rotated and staggered tick mark labels
  • Vertical labels that don’t require an embedded font
  • Optional axes on all four sides of the chart
  • The ability to attach the legend to a MovieClip outside the chart
  • Expanded documentation with over 800 pages of information including many larger examples

For more general information and to purchase the components visit our website.

For detailed information on the features and functionality in this new version you can review the documentation online.

Easily work with Horizontal and Vertical content layouts

Recently we ran into several situations where we needed to lay out content either vertically or horizontally based on data available at run-time. In an effort to keep the conditional processing to a minimum and accomplish this goal, Chafic and I came up with a technique where we store the current position as properties of an object, and based on orientation set two variables, changeTarget and changeSource, to determine how to change the position at each iteration without having to check the orientation inside the loop.

Since the contitional is outside the loop, this improves performance, reduces the amount of duplicated code, and improves reusability.

Here’s an example of this implemenation that lays out a set of colored boxes both horizontally and vertically using the same layout code with only one conditional.

var data:Array = [0xFF0000, 0x00FF00, 0x0000FF];
var contentDepth:Number = 1;

function layoutContent(x:Number, y:Number, direction:String):Void {
var pos:Object = new Object();
pos.x = x;
pos.y = y;

var changeTarget:String;
var changeSource:String;

if (direction.substr(0, 1).toLowerCase() == "h") {
changeTarget = "x";
changeSource = "_width";
} else {
changeTarget = "y";
changeSource = "_height";
}

var max:Number = data.length;
var contentClip:MovieClip;

for (var i:Number = 0; i