Create applications with Adobe Catalyst

[ad]
We wanted to share with you a great video tutorial about how to use Adobe Flash Catalyst and create Flex Applications starting just with an image.
The tutorial explains in details how you can create a Flex button and a scrollbar using Catalyst.

0 Comments

TOP 10 Twitter AIR Applications

Twitter -  My favorite AIR  Applications for Twitter

[ad]

0 Comments

Flex Gumbo – Displaying a video using the VideoElement

The following example shows how you can display a video using the chromeless VideoElement control in Flex Gumbo.

[ad]

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/05/14/displaying-a-video-using-the-videoelement-control-in-flex-gumbo/ -->
<s:Application name="Spark_VideoElement_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">

    <mx:ApplicationControlBar width="100%" cornerRadius="0">
        <s:Button id="playBtn"
                label="play"
                click="videoElement.play();" />
        <s:Button id="pauseBtn"
                label="pause"
                click="videoElement.pause();" />
        <s:Button id="stopBtn"
                label="stop"
                click="videoElement.stop();" />
        <s:CheckBox id="mutedCheckBox"
                label="muted"
                selected="true"
                click="videoElement.muted = mutedCheckBox.selected;" />
        <s:Graphic>
            <s:SimpleText id="playheadTimeLabel"
                    text="{videoElement.playheadTime.toFixed(3)}" />
        </s:Graphic>
    </mx:ApplicationControlBar>

    <s:Group horizontalCenter="0" verticalCenter="0">
        <s:VideoElement id="videoElement"
                autoRewind="true"
                source="http://helpexamples.com/flash/video/cuepoints.flv"
                muted="true"/>
    </s:Group>

</s:Application>

[ad]

0 Comments

Flex Gumbo – Toggling smoothing on Spark VideoPlayer

The following example shows how you can toggle smoothing on a Spark VideoPlayer object in Flex Gumbo by setting the Boolean smoothing property on the VideoPlayer object’s internal videoObject property.

[ad]

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/05/24/toggling-smoothing-on-a-spark-videoplayer-object-in-flex-gumbo/ -->
<s:Application name="Spark_VideoPlayer_VideoElement_videoObject_smoothing_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">

    <fx:Script>
        <![CDATA[
            private function checkBox_change(evt:Event):void {
                videoPlayer.videoElement.videoObject.smoothing = checkBox.selected;
            }
        ]]>
    </fx:Script>

    <s:CheckBox id="checkBox"
            label="smoothing"
            left="10"
            top="10"
            change="checkBox_change(event);" />

    <s:Panel id="panel"
            title="{videoPlayer.source}"
            horizontalCenter="0"
            verticalCenter="0">
        <s:VideoPlayer id="videoPlayer"
                source="http://helpexamples.com/flash/video/water.flv"
                muted="true" />
    </s:Panel>

</s:Application>

[ad]

1 Comment

Setting left and right margins on a Spark TextArea control in Flex 4

The following example shows how you can set left and right margins on a Spark TextArea control in Flex 4 by setting the paragraphStartIndent and paragraphEndIndent styles.

<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/06/04/setting-left-and-right-margins-on-a-spark-textarea-control-in-flex-4/ -->
<s:Application name="Spark_TextArea_paragraphStartIndent_text"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>
 
    <fx:Script>
        <![CDATA[
            private function sliderStart_change(evt:Event):void {
                textArea.setStyle("paragraphStartIndent", sliderStart.value);
            }
 
            private function sliderEnd_change(evt:Event):void {
                textArea.setStyle("paragraphEndIndent", sliderEnd.value);
            }
        ]]>
    </fx:Script>
 
    <mx:ApplicationControlBar width="100%" cornerRadius="0">
        <mx:Form styleName="plain">
            <mx:FormItem label="paragraphStartIndent:">
                <s:HSlider id="sliderStart"
                        liveDragging="true"
                        change="sliderStart_change(event);" />
            </mx:FormItem>
            <mx:FormItem label="paragraphEndIndent:">
                <s:HSlider id="sliderEnd"
                        liveDragging="true"
                        change="sliderEnd_change(event);" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>
 
    <s:Group width="100%" height="100%">
        <s:TextArea id="textArea"
                textAlign="justify"
                left="10" right="10"
                top="10" bottom="10">
            <s:content>
                <fx:String source="lorem.html" />
            </s:content>
        </s:TextArea>
    </s:Group>
 
</s:Application>
0 Comments

Setting vertical spacing between paragraphs on the Spark TextArea control in Flex 4

[ad]
The following example shows how you can set vertical spacing between paragraphs in a Spark TextArea control in Flex 4 by setting the paragraphSpaceBefore and paragraphSpaceArea styles.


<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2009/06/05/setting-vertical-spacing-between-paragraphs-on-the-spark-textarea-control-in-flex-4/ -->
<s:Application name="Spark_TextArea_paragraphSpaceBefore_test"
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/halo">
    <s:layout>
        <s:VerticalLayout />
    </s:layout>

    <fx:Script>
        <![CDATA[
            private function sliderBefore_change(evt:Event):void {
                textArea.setStyle("paragraphSpaceBefore", sliderBefore.value);
            }

            private function sliderAfter_change(evt:Event):void {
                textArea.setStyle("paragraphSpaceAfter", sliderAfter.value);
            }
        ]]>
    </fx:Script>

    <mx:ApplicationControlBar width="100%" cornerRadius="0">
        <mx:Form styleName="plain">
            <mx:FormItem label="paragraphSpaceBefore:">
                <s:HSlider id="sliderBefore"
                        liveDragging="true"
                        change="sliderBefore_change(event);" />
            </mx:FormItem>
            <mx:FormItem label="paragraphSpaceAfter:">
                <s:HSlider id="sliderAfter"
                        liveDragging="true"
                        change="sliderAfter_change(event);" />
            </mx:FormItem>
        </mx:Form>
    </mx:ApplicationControlBar>

    <s:Group width="100%" height="100%">
        <s:TextArea id="textArea"
                textAlign="justify"
                left="10" right="10"
                top="10" bottom="10">
            <s:content>
                <fx:String source="lorem.html" />
            </s:content>
        </s:TextArea>
    </s:Group>

</s:Application>

[ad]

0 Comments

Changing the base theme color on the Halo TextArea control in Flex 4

[ad]
The following example shows how you can change the base/theme color on the Halo TextArea control

(with default Spark skin) in Flex 4 by setting the baseColor style. Setting the baseColor style sets both the TextArea control’s border color and horizontal/vertical scroll bar’s track/thumb colors.

<?xml version=”1.0″ encoding=”utf-8″?>
<!– http://blog.flexexamples.com/2009/06/10/changing-the-base-theme-color-on-the-halo-textarea-control-in-flex-4/ –>
<s:Application name=”TextArea_SparkSkin_baseColor_test”
xmlns:fx=”http://ns.adobe.com/mxml/2009″
xmlns:s=”library://ns.adobe.com/flex/spark”
xmlns:mx=”library://ns.adobe.com/flex/halo”>

<mx:ApplicationControlBar width=”100%” cornerRadius=”0″>
<mx:Form styleName=”plain”>
<mx:FormItem label=”baseColor:”>
<mx:ColorPicker id=”colorPicker” selectedColor=”red” />
</mx:FormItem>
</mx:Form>
</mx:ApplicationControlBar>

<mx:TextArea id=”textArea”
baseColor=”{colorPicker.selectedColor}”
left=”50″ right=”50″
top=”50″ bottom=”50″>
<mx:htmlText><fx:String source=”lorem.html” /></mx:htmlText>
</mx:TextArea>

</s:Application>

[ad]

0 Comments

Flex Builder 4 Refactored to Flash Builder

[ad]

The next version of our IDE, Flex Builder, will be called Flash Builder 4.

There is already available a public beta for Flash Builder 4 and Flash Catalyst (check Adobe Labs for downloads).

Mihai Corlan (Platform Evangelist for Adobe):
At the same time, we will not change the name of Flex Builder 3. This will stay as it is now. Furthermore, the names of the Flex framework, and the Flex SDK, remain unchanged. The same goes for Flash Professional, which remains unchanged.”
….
“This has happened to me more than once. When I ask people at conferences “Who’s a Flex developer?” many people are unsure how to answer. Why? Because some of you are using the Flex framework, to create Flex or AIR applications, and not our IDE (Flex Builder), some of you are using Flex Builder, but without using the Flex framework (you use ActionScript 3 to create Flash applications). Thus the uncertainty.

Of course, the correct answer is this: anyone who uses the Flex framework, is a Flex developer. It doesn’t matter what tools you use to create these applications. At the same time, any Flex application gets compiled into a SWF file, which is played by the Flash Player. The same happens with the applications written using ActionScript and not the Flex framework.

So looking at it from this perspective, I think it makes a lot of sense. Have the developer tool that is used for creating Flash/AIR applications with or without the Flex framework called Flash Builder 4.

Flex Builder 3 Flash Catalyst Flash Builder 4

[ad]

2 Comments

Adobe Flex Button with Photoshop (web 2.0 button skin)

[ad]

Here you can see the live result and also download the project source code by right clicking inside the application.

Step 1:
Create Up, Over, Down, Disabled states for the button with Photoshop

1.1 Open Photoshop and choose the desired button size. I will choose 90x28px with transparent background.

1_button_size

1.2 Using the “rounded rectagle tool” create the button to look like in the image

1_button_size

1.3 Duplicate the existing layer, set the “Fill” property to 0 and then apply a gradient effect like in the image below.


1.4 now let’s make the button cloured :D . Apply to the first layer (original) an horizontal gradient overlay like in the image.


1.5 To make the button look even better we add a border and some inner glow to the originl layer like in the images below



1.6 Duplicate the first layer (original) and edit the colors so you can get all 4 states of our button.


1.7 after getting ready all states for the buttons export them 1 by 1 as .png and name them button_up.png button_over.png button_down.png and button_dis.png

Step 2:
Add images to project and create CSS for the button

2.1 Create an Adobe Flex project and name it PhotoshopButton.


[ad]

2.2 Create a folder inside the /src folder and name it /images

2.3 Copy the 4 png images to /src/images/

2.4 Create a folder inside the /src folder and name it /css, inside this folder Add a new css file and name it main.css

2.5 Inside the main.css file add the following button style:


/* CSS file */
Button
{
     up-skin: Embed(source="/images/button_up.png");
     over-skin: Embed(source="/images/button_over.png");
     down-skin: Embed(source="/images/button_down.png");
     disabled-skin: Embed(source="/images/button_dis.png");
     selected-down-skin: Embed(source="/images/button_down.png");
     selected-up-skin: Embed(source="/images/button_down.png");
    
     color: #ffffff;
     roll-over-color: #000000;
     disabled-color: #efefef;
}


2.6 Your project should look until now like this


[ad]

2.7 Open the PhotoshopButton.mxml file and add the reference to your css file



<mx:Style source="css/main.css"/>

//Then add some buttons and let's see how does it look :)

<mx:HBox width= "100%" horizontalAlign="center">
    <mx:Button label= "Click Me!"/>
    <mx:Button label= "Disabled" enabled= "false"/>
</mx:HBox>


And again the result…


That’s all, enjoy!

1 Comment

Adobe Flex 3 Developer Guide

[ad]
Adobe Flex 3 Developer Guide Adobe Flex 3 Developer Guide bykiat

[ad]

0 Comments