Accordion with Icons

March 29, 2007

accordioniconsimg.jpg

I built this component to allow an icon to be added to each Accordion Header where the icon is dependent on the current state of the Accordion. There are 3 possible states that are tracked, up, down, and selected. The upIcon is displayed whenever the pane is above the selected pane. The downIcon is displayed whenever the pane is below the selected pane. The selectedIcon is displayed when pane is the selected pane. See the image below.

accordioniconsdiagram.png

Sample Syntax (Basic with default icons):

<eflex:AccordionIcons>
<mx:Canvas label=”Canvas”/>
<mx:VBox label=”VBox”/>
<mx:HBox label=”HBox”/>
</eflex:AccordionIcons>

Sample Syntax (Advanced with custom icons and selectedIndex):

<eflex:AccordionIcons
upIcon=”@Embed(source=’assets/icons/arrowUp2.gif’)”
downIcon=”@Embed(source=’assets/icons/arrowDown2.gif’)”
selectedIcon=”@Embed(source=’assets/icons/arrowSelected2.gif’)” height=”200″
selectedIndex=”1″>
<mx:Canvas label=”Canvas”/>
<mx:VBox label=”VBox”/>
<mx:HBox label=”HBox”/>
</eflex:AccordionIcons>

Run this demo

View/Download Source

Docs


New CS3 Products

March 27, 2007

CS3 Prices leaked

March 26, 2007

Amazon has had some of the new CS3 products posted. They just pulled the pricing but here is what was posted:

Photoshop CS3 $649.95

CS3 Web Premium $1599.95

CS3 Design Premium $1799.95

CS3 Master Collection $2499.95

For full product breakdowns visit here


SnapIt Apollo – Source Included

March 26, 2007

I have had requests on how to take snap shot and save it to disk.  So here is a vary basic example that takes a picture of itself and saves it to disk using the file name provided.  Here is the guts of the function that saves the image:

snapit.jpg

private function snagPic():void {
bitmapData = new BitmapData(this.width,this.height);
bitmapData.draw(this,new Matrix());
var bitmap : Bitmap = new Bitmap(bitmapData);
var jpg:JPGEncoder = new JPGEncoder();
var ba:ByteArray = jpg.encode(bitmapData);
newImage = File.appStorageDirectory.resolve(“Images/” + fileName.text + “.jpg”);
fileStream = new FileStream();
fileStream.open(newImage, FileMode.UPDATE);
fileStream.writeBytes(ba);
}

Please note you will need the core lib for the image encoders if you want to compile it yourself.

Download the application

Download source code


Tutorials – Apollo (Community)

March 22, 2007

I have just added a new page for tutorials that have been made by the Apollo community. The 1st post is a tutorial on how to build an mp3 player with Flex and Apollo by Ashwinee Kumar Dash

Please visit this new page here.

If you have created tutorials and would like to have them posted, please contact me at rtretola@gmail.com