Updated: I’m going ahead and making the rough original source available since I have less time to work on this than expected. Please let me know if this helps you on any project or at least gets you started
One of the more popular posts on this blog is “Warping Text in Flex“. People are frequently asking for the source code and I am frequently not giving it to them (unless they say please) because it’s really really dreadful. Truly. So I have brought the project back to life as something I’m not embarrassed of.
An open sourced as-is etc version of this component will be posted shortly (preview below). The component will use a three point Bézier curve for the text path. Currently, this version uses the geometry classes from http://www.algorithmist.net/ but the released version may or may not.
Continue reading for a simple preview …
Continue reading ‘Text on a curved path in Flex - Resurrected’
To learn more about the mysimplemp3 project, click the <my:SimpleMP3 /> tab at the top of this website. The project is hosted here on Google Code where you can download the latest swc or check out the source.
Currently the only demo is my proof of concept found here. I’m looking forward to seeing the components and projects you end create with mysimplemp3. Please keep me posted - and let me know about feature requests and potential bugs! Thanks.
What's this? It looks easy!
OK. I really don't like building MP3 player components in AS3 for Flex. It's doable, sure, but tedious. In fact, I don't like it enough that I've done something about it. Now it can be fun to make an MP3 player in Flex! (not available yet, but there's a demo below).
XML:
-
<my:SimpleMP3
-
id="music"
-
url="http://url.com/my.mp3" />
Now, just treat it like you'd expect!
Actionscript:
-
music.play();
-
music.pause();
-
music.stop();
-
music.volume = 0..1;
Yes, there's more: scrubbing, streaming, buffering, panning left to right, auto load, auto play, auto rewind, repeat and most importantly ... states! Read more and play with a quick demo after the jump.
Continue reading 'Almost introducing <my:SimpleMP3 />'
Here is a cool article from the Flex 3 livedocs on ActionScript 3.0 and how the language handles fixed property and prototype inheritance. There is also a brief history of AS from version 1.0 to present. The content may not help you with day-to-day tasks, but it is an interesting and fun read.
I've been searching for a way to write view code in my Flex & AIR projects that is completely reusable, scalable and simple yet powerful. I've read about and used the questionably named 'code-behind' techniques that Ted and Adobe promote. I've tried the 'script src' technique that Tink is passionate about. I've used 'view helpers' and I've even tried the rarely discussed 'code-in-front' technique that Marc has written about. However, I've recently been creating my views with a technique I call the 'simple' method which is in the same school of thought as Marc's idea. Here's a table that describes the five methods mentioned above for creating views in Flex:

Continue to try out each technique in a Flex application with source and find out why I especially like the all MXML 'simple' method ...
Continue reading 'Flex View Component Techniques in MXML & AS'
This post is an extension of an earlier post entitled "Flex Part 02: Value Objects & Model Objects".
Recap: Model Objects are similar to Value Objects in that they hold the same data, except that the Model Object is responsible for making sure that no 'bad' data gets into the VO. The Model Object enforces business rules like, "phone must be at least ten digits long" which a VO cannot do on its own. A Model Object may even include methods for easily manipulating properties.
In the earlier post I presented some example code for a Model Object. It turns out that what I provided is a pain to maintain over time. There's just too much duplication and poor use of public properties. Continue reading for my attempt at a better, easier Model Object ...
Continue reading 'Flex Part 02+: A Better Model Object'
Sometimes it is necessary to display a formatted value such as currency or a percentage in a NumericStepper component, but that is not a default behavior. I need something extremely simple that can be written as:
XML:
-
<mx:CurrencyFormatter id="currencyFormatter"
-
currencySymbol="$"
-
precision="2"/>
-
-
<controls:FormattedStepper formatter="{currencyFormatter}"/>
My internet searches turned up this similar attempt, but it seemed overly complicated (just my opinion). Continue reading to view my attempt at a simple formatted numeric stepper with source. I've also included an example of a custom formatter as well as an item renderer / item editor in a DataGrid.
Continue reading 'FormattedStepper extends NumericStepper'
I work on a lot of charting and data visualization applications. Flex is great for these projects, but what happens when a client wants to use a chart (or any DisplayObject) from the application in a document, presentation, website or email? I needed a way to let users save jpeg and png files to their computers without storing any images on the server. The following solution works with PHP but it should be very simple to duplicate the process for other environments. Continue reading to try it out and view code.
Continue reading 'DisplayObject to JPEG or PNG with IImageEncoder'
This post is a continuation of "Distinct Data Providers with GroupingCollection." The code and example is extremely similar - there are a couple minor changes to accommodate one addition: the use of HierarchicalCollectionView.
What's new?
We saw in the previous post that a GroupingCollection works very well for creating a grouped data provider for an AdvancedDataGrid or even for use in part in a List or ComboBox control. But there's a(nother/ better) way to populate that distinct List or ComboBox from the GroupingCollection. Use a HierarchicalCollectionView. It's a more elegant solution and also lets you use your grouped data to populate a Tree or Menu control! Continue reading to try it out and view code.
Continue reading 'GroupingCollection -> HierarchicalCollectionView'
Update: This post is updated and continued in the next post, "GroupingCollection -> HierarchicalCollectionView." Please see that post for additional (better) suggestions.
This post is itself an update to "DistinctArrayCollection extends ArrayCollection." The old post describes the problem and proposes a solution. I did not post code in that article because I felt like there had to be a better way of doing things. Here's a better way (see the update for a much better way): use the GroupingCollection class in Flex 3. Continue reading to try it out and view code.
Continue reading 'Distinct Data Providers with GroupingCollection'