Ever wanted to be able to display multi-column text in Flash? What about text that spans multiple arbitrary text fields? Sure, Adobe's Text Layout Framework will let you display multi column text, but it's still in beta, not to mention that it's a big, robust framework.

TextFlowLite is a simple, light-weight class that works in Flash Player 9 with standard text fields. It takes one line of code to link any number of text fields together so that the overflow of each textfield runs into the next. Likewise, it's one line of code to change the text, or reflow it if the textfields are resized.

import com.gskinner.text.TextFlowLite;
// set up the TextFlow, by default it will use the text of the first field:
var tfl:TextFlowLite = new TextFlowLite([fld1,fld2,fl3]);
...
// change the text:
tfl.text = "my new text";
...
// change the size of a field, and reflow the text:
fld1.height += 20;
tfl.reflow();

I built this class about a year and a half ago while working on the Spelling Plus Library, and had meant to release it much earlier. It is part of a set including TextFlow (adds support for orphans and widows), and TextFlowPro (which includes support for selection, editing, copy/paste). I will release the other two for free when I have time to retest and clean them up (hopefully later this week).

Here's a simple demo: Continue reading "Multi Column Text in Flash 9: TextFlowLite"

Just a quick note to correct my post from yesterday that GTween beta 3 was released, when in fact it was beta 4. Sorry for the confusion. You can check out all the GTween beta 4 info here.

GTween beta 4 has been released! This is the final beta of the library, and I am only keeping it beta for this release because there is a chance I will toy with the API a little bit more, and I'd like to clean up the demos before final (right now they are an ugly mix of demo and test file).

The main new feature in this release is a more robust synchronization model which allows you to synchronize child tweens to the delay, beginning, end or duration of its parent. This release also includes the GTweenFilter class (<0.5kb) which a number of people have been patiently waiting for.

I also patched a number of bugs, added a few more simple demos, and created a MultiTween class that allows you to tween multiple objects to either the same destination property values, or different values using a single tween instance.

Both of the new classes should be useful, but they are also there to serve as templates for people interested in writing their own extensions to GTween. They are not required to work with GTween normally - still just a single class.

Here is the full list of changes:


  • fixed a bug with autoHide (thanks to JTtheGeek)
  • fixed a bug with useSmartRotation and destination values over 360 (thanks to radicalFish)
  • added propertyTarget and getPropertyTarget(), to support GTweenFilter and other potential subclasses
  • renamed the static "ticker" property to "activeTicker" to prevent issues in some editors due to it being named the same as the instance property. (thanks to Thomas Brekelmans)
  • fixed a problem with progressPoints set to a position of 0 not firing (thanks to Toby Skinner)
  • moved event meta tags to before class declaration, so they show up properly in the API documentation (thanks to Jordi Boggiano)
  • updated .clone() to support .useSetSize and .useSnapping properties
  • modified .addChild() to accept GTween.TWEEN_PHASE, GTween.END, GTween.DURATION, GTween.BEGINNING as a second parameter, allow more complex synchronization options.
  • included GTweenFilter and MultiTween in package.

As always, you can view the latest documentation, and download the latest version of the library at gskinner.com/libraries/gtween/.

I don't usually blog about things that are unrelated to the Flash platform, but once in a while something comes up that I think is impressive, lacks the exposure it deserves, and might be useful to other geeks. Eneloop batteries met that set of criteria, and they're good for the environment, which is always a bonus.

I heard about Eneloop about a year ago, but I never found them in stores, and thought maybe the technology was vapour-ware. I wasn't surprised, because they sounded too good to be true: They are rechargeable batteries that outperform alkalines, retain a charge for over a year (so you can charge them, stick them in a drawer, and forget about them until you need them), charge fast, and are quite cheap (only slightly more than brand name alkalines, and nearly half the price of the Panasonic rechargeables I had been using).

Then about 4 months ago I found some in a local computer store, and figured I'd give them a shot. I was impressed enough by the first pack that I've replaced all of my batteries with them, which only cost about $100 for 35 batteries and a charger (they also charge fine with my old charger). So far I'm really happy with them. They last a long time (about 2 months of use in my XBox360 controller, versus about a month with fully charged Panasonics), and hold a charge well so far (the ones I've put in my tv remotes are still going strong). The only thing I noticed is that unlike the AAs, the AAAs did not come precharged. I'm guessing they discharge more quickly in storage than the AAs due to their smaller size.

I have a bit of a conspiracy theory about these batteries, which is part of the reason I wanted to give them some exposure. These are theoretically "batteries for life" - if you charge them every 2 weeks, and they last the stated 1000 charges, they will work for over 40 years. Obviously this isn't going to happen, but it seems like they should last a good while. Sanyo is the largest rechargeable battery manufacturer in the world, but as far as I know they have never marketed them directly. I can imagine a scenario where Sanyo approached the companies that were rebranding their batteries with this new technology, and were shot down because it has the potential to dramatically reduce the demand for batteries (because you don't need to replace them). Likewise, you can't find these batteries at stores like Best Buy, possibly for the same reasons - batteries are a high margin business, with a good replacement cycle. It's just a guess, but it sounds possible to me.

I tracked mine down at a local computer shop, and then later at Costco. And no, I'm not getting paid by Sanyo to promote these, I just think they're a smart product, and they aren't getting any attention. And yes, they have a really crappy "skip intro" type thing on the Eneloop website. Good batteries, bad Flash. :)

Powered by Movable Type 3.14 | Hosted by Media Temple