DateAdd for ActionScript

following yesterday’s theme, in which I built a dateDiff method for AS2, today I extended the class with a static method to provide dateAdd() functionality.  Again, its modeled on the behavior of the CFML dateAdd, so it takes as arguments datePart:String, date:Date, numToAdd:Number.  The method returns a new date object.  Continue Reading

DateDiff for ActionScript

One of the tools I often find myself needing when developing applications in ActionScript is a utility for determining the difference between 2 dates.  Following the structure of ColdFusion’s DateDiff function, I came up with this: class DateFunction { /** dateDiff(datePart:String, date1:Date, date2:Date):Number<BR> returns the difference between 2 dates<BR> valid dateParts:<BR> s: Seconds<BR> n: Minutes<BR> h: Hours<BR> d: Continue Reading

Broadcasting custom events

Did you know you are not limited to working with the events built into components, but you can broadcast your own events as you need to within Flash and Flex? Its actually really easy, and gives great ability to loosely couple the application.  If you are working in a subclass Continue Reading

LocalConnection for debugging

Did you know you can communicate between two different flash applications running at the same time?  This is possible using the LocalConnection Object.  I’ll often use this for building app debuggers, so i can see the debug outside the main application.  Here is a simple example, where various events in Continue Reading

Powered By Detroit

I’ve just been invited to speak at the New Flash and ColdFusion Conference, Powered By Detroit.  This conference is aimed squarely at folks aiming to build Rich Internet Apps with ColdFusion and Flash.  More Information available at their website.  I believe I’ll be talking specically about Customizing Flex Components with Continue Reading

Click to Close Accordion

It seems odd that all my Flex posting here is about how to make a built in component do something it wasnt intended to do.  This time, I had clients which wanted an Accordion header to close, if clicked when it was already open.  I’m not particularly fond of the Continue Reading

Tweening a Color Transform

I’ve been working with the Tween and Transition classes a lot lately, and was recently tasked with fading a tint over a movieClip. My fisrt instinct was to draw a colored square over the clip, with the alpha of the square set to something less than 100%, like this: function Continue Reading