I recently needed to rearrange the depths – z-order – of a number of objects on the stage. I tried the swapDepth() method from Actionscript 2 and got the “call to a possibly undefined function…” error. After a little reasearch – with Google’s assistance – I found solutions using the setChildIndex(), swapChildren() and SwapChildrenAt() methods [...]
Entries from March 29th, 2010
Replacing swapDepth in Actionscript 3: setChildIndex, swapChildren, swapChildrenAt
March 29th, 2010 · 2 Comments · Tutorials
Tags:depth·setchildindex·swapchildren·swapchildrenat·swapdepth·z-order
Using updateAfterEvent with mouse events as an alternative to StartDrag
March 18th, 2010 · 2 Comments · Tutorials
If you have ever used the StartDrag method you have probably noticed that if a user drags an object too quickly its movement becomes erratic and jumpy. This is because dragging an object initiated by startDrag is synced to the frame rate – normally 30 frames per second.
Displaying time: the Clock class
March 16th, 2010 · 1 Comment · AS3 Custom Classes
The Clock class displays a digital clock with optional 24 hour display mode and optional display of seconds. Text properties are controlled by an array which define the text’s placement within the background and the display’s font, size and color.
Tags:class·clock·date·digital clock·time
Using caurina Tweener to tween text movement
March 11th, 2010 · 2 Comments · Tutorials
A reader requested a very simple solution for moving text so I decided to respond with this short tutorial on using the caurina Tweener library to move a block of text. (To repeat tween reload page.)
Tweening a text message: the MsgPanel_RIGHT class
March 9th, 2010 · No Comments · AS3 Custom Classes
I recently saw a video of Microsoft’s upcoming Mobile 7 phone interface and, surpirisingly, was impressed with its bold 2D graphics – no 3D bevelled edges, no gradations, no faux glass reflective surfaces. The MsgPanel_RIGHT class is my interpretation of a 2D graphic approach to the interface.
Prototyping the Bookshelves function
March 5th, 2010 · No Comments · AS3 Custom Classes
I originally wrote this function in 2007 in Actionscript 2 (remember createEmptyMovieClip) and recently rewrote it in as3. The concept is to present a series of “shelves” that move together vertically as a group but move independently of each other when moving horizontally. Instead of a grid of rows and buttons imagine shelves of books with each [...]
Improving the ImageManager class
March 2nd, 2010 · No Comments · AS3 Custom Classes
The ImageManager class, introduced in the last post, has been modified to expand its usability. In the first iteration, the id of the image displayed was contained internally and could not be used by an outside function or class; in the modified version the current image id is announced to external event listeners via a custom [...]