AS3

Netbeans & Silver Stripe

OK quick note, Netbeans is an awesome IDE. Love the debugging options an set to xdebug default options. So it just works when running Linux PHP Xdebug. Was a life changer when someone showed me how about six months ago.

Silver Stripe is also an awesome PHP framework/cms. But .ss files the ones used by the Silver Stripe templating system don’t get recognised by Netbeans. A quick Google resulted in a few incomplete forum results. I’m using Netbeans 7.2 and it took under a minute once I knew where to go, to enable syntax highlighting and code completion (apart for ss template tags).

Read more →

Bitmap to ByteArray

Some notes about using sprites from Flash Professional in Flash Builder.

1 When adding Sprites or Movie Clips to a Flex application add them to a UIcomponent first or use rawChildren.addChild() to avoid run time errors.

fx:Script spritecanvas.addChild(new Sprite()); // OR this.rawChildren.addChild(new Sprite(); </fx:Script> <mx:UIComponent id=“spritecanvas” width=“100%” height=“100%"> 2. The information on labeled timelines and labeled movieclip instances remains intact

fx:Script [Embed(source=”../sprites/Demo.swf", symbol=“test”)] private var TimeLineTest:Class; var TestTimeLine:MovieClip = new TimeLineTest() as MovieClip; TestTimeLine.gotoAndPlay(’timelinelabel’); // accessing sub movie clips which have been given an instance name in Flash Professional // TestTimeLine.inception == MovieClip </fx:Script> 3. AS3 code however does not remain intact but stop() commands do (I’m wondering if I’m missing a flag here when embedding) A movie clip symbol in Flash Professional which is given a base class of the following

Read more →

Flash Professional & Flash Builder Compatibility with Sprites

Some notes about using sprites from Flash Professional in Flash Builder.

When adding Sprites or Movie Clips to a Flex application add them to a UIcomponent first or use rawChildren.addChild() to avoid run time errors.

<fx:Script>
 spritecanvas.addChild(new Sprite());
 // OR
 this.rawChildren.addChild(new Sprite();
</fx:Script>
<mx:UIComponent id="spritecanvas" width="100%" height="100%">

The information on labeled timelines and labeled movieclip instances remains intact

<fx:Script>
 [Embed(source="../sprites/Demo.swf", symbol="test")]
 private var TimeLineTest:Class;
 var TestTimeLine:MovieClip = new TimeLineTest() as MovieClip;
 TestTimeLine.gotoAndPlay('timelinelabel');
 // accessing sub movie clips which have been given an instance name in Flash Professional
 // TestTimeLine.inception == MovieClip
 </fx:Script>

AS3 code however does not remain intact but stop() commands do (I’m wondering if I’m missing a flag here when embedding) A movie clip symbol in Flash Professional which is given a base class of the following

Read more →

Adobe AIR SQLite ORM

A note from a series of posts on AIR and SQLite. At the time, I needed to put together an analytics tracking library for an AIR application — Google Analytics only supported Flex apps with DOM access, so it wasn’t available in AIR. That constraint pushed me toward building a custom persistence layer to buffer and batch events locally before syncing them upstream.

Wanting a cleaner approach to persistent data in AIR, I started writing my own DataObject class to handle saving and retrieving records. While writing it I assumed someone had already solved this problem — and sure enough, they had.

Read more →