Vixiom
Snippets
-
Merb on Air fix for Flex Beta 3 by vixiom
Save as Favorite | Tags: file upload, drag and drop
-
Format price with ActionScript 2.0 by vixiom
ActionScript 2.0 biggest weakness is lack of support for regular expressions. This makes relatively simple things like formatting price (the American way) a bit of a chore. Here’s a solution for those not quite ready to make all their users switch to Flash Player 9.
Save as Favorite | Tags: AS2, price, format, string
-
How to get smooth image scaling in Flex by vixiom
Sometimes images loaded externally into a Flex app will become pixelated when scaled, here's how to smooth them and make sure cross domain images load properly.
Save as Favorite | Tags: Flex, image, smooth, cross-domain, load, loaderContext
-
Convert r,g,b values to a single color value by vixiom
Save as Favorite | Tags: color, values, rgb
-
ActionScript Singleton by vixiom
The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. Often a singleton is used as the Model in a Model View Controller (MVC) structure. Useful if you're looking for a quick (and better) way to store global variables and data than dumping them in a global or root holder.
-
URL Encode a string in ActionScript by vixiom
Here are a couple of methods that are similar to PHP's urlencode.
Save as Favorite | Tags: AS3, urlencode, encode, string, encodeURI, escape, UTF-8, URI, URL
-
Remove extra returns from dynamic text by vixiom
Flash and Flex text boxes sometimes like to add bonus returns/line breaks to text coming from a database and displayed in text box. Here's a one liner to remove them.
Save as Favorite | Tags: AS3, replace, string, return, line break, remove
-
Get a display object's rectangle in another object's coordinate space by vixiom
An alternative to jumping around with globalToLocal and localToGlobal if you need to get one object's location in another's coordinate space. getRect excludes any strokes, if you want the size plus position with strokes use getBounds.
Save as Favorite | Tags: getRect, getBounds, AS3, MovieClip, Rectangle
-
Randomize an Array by vixiom
This function takes an array shuffles its items and returns the random array.
Save as Favorite | Tags: random, randomized, AS3, array
-
Convert a CMYK color to RGB by vixiom
This method takes a CMYK color and converts it to RBG. Unfortunately it can't mimic Photoshop or ImageMagick's conversion exactly as you need a color profile for that but it's still pretty close.
-
Convert degrees to radians by vixiom
This ActionScript method converts degrees to radians. One radian is equal to 180/π degrees.
Save as Favorite | Tags: degree, radian, AS3, convert
Scraps
-
Encrypted Local Store in AIR by vixiom
"One of the questions I encountered regularly during the AIR Bus Tour was about encryption using AIR. There’s an obvious sensitivity towards having an application remember certain details (like passwords) about the user, and then storing that data in the clear in a text file. During AIR Beta 1, I suggested that folks use one of the various ActionScript encryption libraries. I’m happy to report that AIR Beta 2 includes an “encrypted local store” for developers to use."
Save as Favorite | Tags: encryption, air, store
-
Using REST services with Flex by vixiom
Save as Favorite | Tags: Flex, REST, Service
-
AS3 Facebook Library by vixiom
Save as Favorite | Tags: AS3, Facebook, library
-
ActionScript Animation Library Tweener by vixiom
In layman's terms, Tweener helps you move things around on the screen using only code, instead of the timeline. The general idea of a tweening Class is that dynamic animation and transitions (created by code) are easier to maintain and control, and more stable than animation based on the regular Flash timeline, since you can control it by time rather than by frames.
Save as Favorite | Tags: animation, AS3, AS2, tweener, transitions, library
-
Yahoo ASTRA Flash Components by vixiom
Yahoo! offers a set of UI components for use in your Flash applications. These components complement the existing Flash CS3 Components, and are built to match them very closely, which eases the learning curve and facilitates development. These components are open source and available under the BSD license.
Save as Favorite | Tags: yahoo, component, library
-
Better form validation in Flex by vixiom
Aral Balkan shows a better way to display Flex form errors "If you tab around that example, you may notice that you are probably doing something wrong (as indicated by the red borders around the form items that begin to appear) but you have no idea what you're doing wrong. In order to find out, you have to mouse over the form field. Only then does a tooltip appear to tell you what the problem is. Needless to say, having the user switch input devices and exert additional effort in order to see a form validation error does not make for good ergonomics or usability. A better alternative is to actually display the error message beside the control. "
Save as Favorite | Tags: Flex, form, validation, error
-
Log into Facebook with Adobe AIR by vixiom
I’ve been messing around with the Facebook API and one of the things I don’t like about the desktop version is that you still have to authorize an app through a browser. I know you only have to do this the first time but what’s the point of a desktop application if you have to open a browser? Here’s how to use AIR’s HTML control to login to Facebook without leaving the safe confines of your desktop. The example will log into facebook and grab the most recent noifications for the logged in user - that’d be you :)
Save as Favorite | Tags: Facebook, air
-
Flex rounded image by vixiom
Save as Favorite | Tags: Flex, image, rounded, cornerRadius
-
ActionScript 2.0 Flash Remoting with Flash CS3 by vixiom
The fix is to copy the needed packages from your Flash 8 install to a Classpath that Flash CS3 is looking for (best to make a new one rather than dump them with the CS3 classes). The old ones live in Macromedia Flash 8 -> First Run -> Classes -> mx and the packages you need are data, remoting, rpc, and services
Save as Favorite | Tags: AS2, remoting, CS3
-
ActionScript Spelling Plus Library (Commercial) by vixiom
Spelling Plus Library (SPL) is a full featured client-side spell checking engine, designed to be used in Flash, Flex and AIR; by both developers and designers. It was built as a best of breed library, with careful attention to architecture, optimization, and extensibility.
Save as Favorite | Tags: spelling, completion, spell check, library
-
ActionScript 3.0 library for handling syndication feeds by vixiom
Use the syndication library to parse Atom and all versions of RSS easily. This library hides the differences between the formats so you can parse any type of feed without having to know what kind of feed it is.
Save as Favorite | Tags: rss, feed, AS3, syndication, library
-
Integrating Flex, BlazeDS, and Scala/Lift by vixiom
"A short while ago Adobe announced that they would be releasing an open source version of LiveCycle Data Services called BlazeDS. In short, BlazeDS is Java technology that makes it really easy to do HTTP streaming and server-side push to Flex and AIR applications. While this announcement is definitely welcome news, there may be a lot of people out there who thought to themselves, “That’s great, but I don’t use Java.” Well, the good news is that just because BlazeDS uses Java the platform doesn’t mean that you necessarily need to use Java the language to take advantage of it."
Save as Favorite | Tags: Flex, scala, lift, blazeds
-
Load CSS files into flex at runtime by vixiom
"Today I made the last completion to my CSSLoader class, the class enables you to load CSS files into your flex application during runtime, a functionality Actionscript3.0 lacks."
Save as Favorite | Tags: css, flex AS3, external
-
Gaia a framework for Flash development by vixiom
Gaia is targeted at anyone who develops Flash sites. It provides solutions to the challenges and repeated tasks we all face with front-end Flash site development, such as navigation, transitions, preloading, asset management, site structure and deep linking. It provides speed and flexibility in your workflow and a simple API that gives you access to its powerful features. Most Flash frameworks are back-end frameworks, or require senior level coding experience to use. Gaia is different because it focuses on front-end development. It is easy enough for novice Flash developers, yet powerful enough that advanced coders can use it without feeling limited. Gaia is tightly focused on helping you do your job without getting in your way. It is flexible enough to enable you to work the way you like to work without forcing you to change your style. Whether you write everything in strictly-typed AS2 classes, hack AS1 on the timeline or anywhere in between, Gaia helps you get the job done.
Save as Favorite | Tags: library, framework, AS2, AS1
-
Alternative DateChooser that fills out an input box by vixiom
The Flex framework is amazingly capable. Between renderers, editors, skins, styles and containers, you can produce amazing applications. Sometimes however developers get stuck in the framework; they think they need to use the framework for everything. I used to see this a lot with list-based controls, but of late the target for getting stuck seems to be the DateChooser. Guess what though, the results are in, and you don’t have to use the DateChooser to produce a calendar.
Save as Favorite | Tags: datechooser, input, AS3, Flex
-
Layout organizers by vixiom
Pure AS3 alternative to using MXML for laying things out.
Save as Favorite | Tags: layout, AS3, grid
-
Flex style HBox and VBox components for Flash by vixiom
Save as Favorite | Tags: AS3, HBox, VBox, layout


