<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>RS Dhariwal&#187; flex examples</title>
	<atom:link href="http://www.rsdhariwal.com/category/flex-examples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rsdhariwal.com</link>
	<description></description>
	<lastBuildDate>Mon, 14 Sep 2009 11:09:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Snackr a RSS ticker flex AIR application tool</title>
		<link>http://www.rsdhariwal.com/2009/09/14/snackr-a-rss-ticker-flex-air-application-tool/</link>
		<comments>http://www.rsdhariwal.com/2009/09/14/snackr-a-rss-ticker-flex-air-application-tool/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 07:31:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[flex examples]]></category>
		<category><![CDATA[AIR Tool]]></category>

		<guid isPermaLink="false">http://www.rsdhariwal.com/?p=84</guid>
		<description><![CDATA[I got a new Flex AIR application tool. There are some very useful desktop applications that in time I find out. One of them in my opinion is Snackr, an AIR app built using Adobe Flex 3 and Adobe AIR 1.0.
]]></description>
			<content:encoded><![CDATA[<p>I got a new Flex AIR application tool. There are some very useful desktop applications that in time I find out. One of them in my opinion is Snackr, an AIR app built using Adobe Flex 3 and Adobe AIR 1.0.</p>
<p>Snackr is a RSS ticker which pulls random items from your favorite feeds and scrolls them across your computer desktop. It keeps you up to date in a very simple way.</p>
<p>Snackr does run on the Linux AIR alpha that Adobe just released, but it doesn&#8217;t look right (animations are glitchy, transparency doesn&#8217;t work). It should be functional, though. You&#8217;ll need to download the runtime manually for now. Click here to <a href="http://snackr.net/" target="_blank" rel="nofollow">download</a> it </p>
<p>To get more about it please check out the following Video.</p>
<p><object width="460" height="280"><param name="movie" value="http://www.youtube.com/v/aWOyiv9Bin0&#038;hl=en&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/aWOyiv9Bin0&#038;hl=en&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="460" height="280"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rsdhariwal.com/2009/09/14/snackr-a-rss-ticker-flex-air-application-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex Progress Bar control</title>
		<link>http://www.rsdhariwal.com/2009/08/07/flex-progress-bar-control/</link>
		<comments>http://www.rsdhariwal.com/2009/08/07/flex-progress-bar-control/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 17:52:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[flex examples]]></category>
		<category><![CDATA[Flex Control]]></category>
		<category><![CDATA[ProgressBar]]></category>

		<guid isPermaLink="false">http://www.rsdhariwal.com/?p=65</guid>
		<description><![CDATA[The ProgressBar control shows a visual progress of a task over time. There are two types of ProgressBar controls: Determinate and Indeterminate. ]]></description>
			<content:encoded><![CDATA[<p>The ProgressBar control shows a visual progress of a task over time. There are two types of ProgressBar controls: Determinate and Indeterminate. </p>
<p><strong>Indeterminate</strong> ProgressBar control shows time-based processes for which the scope of task is not yet determine. As soon as you can determine the scope, you should use a determinate ProgressBar control.</p>
<p><strong>Determinate</strong> ProgressBar control is a linear representation of the progress of a task over time. You use a determinate ProgressBar when the scope of the task is known. It displays when the user has to wait for an extended amount of time.<br />
You can create a progress bar by:</p>
<p>If progress bar mode is manually You can set progress bar value manually but The ProgressBar control shows a visual progress of a task over time. There are two types of ProgressBar controls: Determinate and Indeterminate. </p>
<p><strong>Indeterminate</strong> ProgressBar control shows time-based processes for which the scope of task is not yet determine. As soon as you can determine the scope, you should use a determinate ProgressBar control.</p>
<p><strong>Determinate</strong> ProgressBar control is a linear representation of the progress of a task over time. You use a determinate ProgressBar when the scope of the task is known. It displays when the user has to wait for an extended amount of time.</p>
<h4>ProgressBar control modes</h4>
<p>You use the mode property to specify the operating mode of the ProgressBar control. The ProgressBar control supports the following modes of operation:</p>
<p><strong>event</strong> : You generally use a determinate ProgressBar in this mode. The ProgressBar control only updates if the value of the source property extends the EventDispatcher class. This is the default mode.</p>
<p>You also use this mode if you reload an image and Image controls to load multiple images.</p>
<p><strong>polled:</strong> Use the source property to specify a loading process that exposes the bytesLoaded and bytesTotal properties. You generally use a determinate ProgressBar in this mode.</p>
<p><strong>manual :</strong> Set the maximum, minimum, and indeterminate properties along with calls to the setProgress() method. generally use an indeterminate ProgressBar in this mode.</p>
<p>You can create a progress bar by:<br />
<code>&lt;mx:ProgressBar width="200" mode="polled"/&gt;</code></p>
<p>Here you can get complete syntax of progressbar control. </p>
<pre><code>&lt;mx:ProgressBar
    Properties
    conversion="1"
    direction="right|left"
    indeterminate="false|true"
    label="No default"
    labelPlacement="bottom|top|left|right|center"
    maximum="0"
    minimum="0"
    mode="event|polled|manual"
    source="No default"
  
    Styles
    barColor="undefined"
    barSkin="ProgressBarSkin"
    borderColor="0xAAB3B3"
    color="0x0B333C"
    disabledColor="0xAAB3B3"
    fontAntiAliasType="advanced"
    fontFamily="Verdana"
    fontGridFitType="pixel"
    fontSharpness="0"
    fontSize="10"
    fontThickness="0"
    fontStyle="normal|italic"
    fontWeight="normal|bold"
    horizontalGap="8"
    indeterminateMoveInterval="26"
    indeterminateSkin="ProgressIndeterminateSkin"
    labelWidth="Computed"
    leading="0"
    maskSkin="ProgressMaskSkin"
    paddingLeft="0"
    paddingRight="0"
    textAlign="left|right|center"
    textDecoration="none|underline"
    textIndent="0"
    themeColor="haloGreen|haloBlue|haloOrange"
    trackColors="[0xE6EEEE,0xE6EEEE]"
    trackHeight="Calculated"
    trackSkin="ProgressTrackSkin"
    verticalGap="6"
  
    Events
    complete="No default"
    hide="No default"
    progress="No default"
    show="No default"
  
    Effects
    completeEffect="No default"
  /&gt;</code></pre>
<p>If progress bar mode is manual then you can set progress bar value by setProgress method. Here is the syntax:<br />
<code>setProgress(Number completed, Number total)</code></p>
<p>By default, the ProgressBar displays the label LOADING xx%, where xx is the percent of the image loaded. You use the label property to specify a different text string to display.</p>
<p>The label property lets you include the following special characters in the label text string:</p>
<p>%1 Corresponds to the current number of bytes loaded.<br />
%2 Corresponds to the total number of bytes.<br />
%3 Corresponds to the percent loaded.<br />
%% Corresponds to the % sign. </p>
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.events.SliderEvent;

            private function slider_change(evt:SliderEvent):void {
                progressBar.setProgress(evt.value, progressBar.maximum);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="Set Progress bar by moving slider:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="360"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="10"
                        change="slider_change(event);"
                        width="{progressBar.width}" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:ProgressBar id="progressBar" mode="manual" minimum="0"maximum="360" /&gt;

&lt;/mx:Application&gt;</code></pre>
<p>Soon I will post some more flex progress bar code example. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rsdhariwal.com/2009/08/07/flex-progress-bar-control/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Flex file upload with PHP using the FileReference class</title>
		<link>http://www.rsdhariwal.com/2009/08/06/flex-file-upload-with-php-using-the-filereference-class/</link>
		<comments>http://www.rsdhariwal.com/2009/08/06/flex-file-upload-with-php-using-the-filereference-class/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 04:57:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Adobe Flex 3]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[flex examples]]></category>
		<category><![CDATA[file uploading in flex]]></category>
		<category><![CDATA[FileReference]]></category>
		<category><![CDATA[upload]]></category>
		<category><![CDATA[Upload file]]></category>

		<guid isPermaLink="false">http://www.rsdhariwal.com/?p=50</guid>
		<description><![CDATA[Many flex user need to know about file uploading in flex. Today I am giving you some information with code examples regarding file uploading in flex. ]]></description>
			<content:encoded><![CDATA[<p>Many flex user need to know about file uploading in flex. Today I am giving you some information with code examples regarding file uploading in flex. </p>
<p>The FileReference class provides a means to upload and download files between a user&#8217;s computer and a server. </p>
<p>An operating-system dialog box prompts the user to select a file to upload or a location for download. Each FileReference object refers to a single file. You can get information about file like Name of file, Size of file, date of creation and date of modification etc. with the help of FileReference properties.</p>
<p>FileReference instances are created by the following ways:<br />
<code>var myFileReference = new FileReference();</code></p>
<p>By default, the system open file dialog box allows users to select any file type from the local computer, although you can specify one or more custom file type filters by passing an array of file filter instances to the browse() method:</p>
<pre><code>var imageTypes:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif, *.png)", "*.jpg; *.jpeg; *.gif; *.png");
var textTypes:FileFilter = new FileFilter("Text Files (*.txt, *.rtf)", "*.txt; *.rtf");
var allTypes:Array = new Array(imageTypes, textTypes);
var fileRef:FileReference = new FileReference();
fileRef.browse(allTypes);</code></pre>
<p>When you attempt to upload a file using the FileReference.upload() method, any of the following events may be dispatched:</p>
<ul>
<li>Event.OPEN: Dispatched when an upload operation starts.</li>
<li>ProgressEvent.PROGRESS: Dispatched periodically during the file upload operation.</li>
<li>Event.COMPLETE: Dispatched when the file upload operation completes successfully.</li>
<li>SecurityErrorEvent.SECURITY_ERROR: Dispatched when an upload fails because of a security violation.</li>
<li>HTTPStatusEvent.HTTP_STATUS: Dispatched when an upload fails because of an HTTP error.</li>
<li>IOErrorEvent.IO_ERROR: Dispatched if the upload fails because of any of the following reasons:</li>
<li>
<ul>
<li>An input/output error occurred while Flash Player is reading, writing, or transmitting the file.</li>
<li>The SWF tried to upload a file to a server that requires authentication (such as a user name and password). During upload, Flash Player does not provide a means for users to enter passwords.</li>
<li>The url parameter contains an invalid protocol. The FileReference.upload() method must use either HTTP or HTTPS.</li>
</ul>
</li>
</ul>
<p>You can declare event and there call back function is as follow:</p>
<p>fileRef.addEventListener(Event.SELECT, fileRef_select);<br />
fileRef.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);<br />
fileRef.addEventListener(Event.COMPLETE, fileRef_complete);</p>
<p>The above code statement declares that on occurring any of the above declared event which function should be call.</p>
<p>The following example shows you how you can use the FileReference class’s browse() method to allow users to select and upload a single file to a Web server.</p>
<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/21/uploading-files-in-flex-using-the-filereference-class/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="init();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private var fileRef:FileReference;

            private const FILE_UPLOAD_URL:String = "http://www.yourdomain.com/services/upload.php";

            private function init():void {
                fileRef = new FileReference();
                fileRef.addEventListener(Event.SELECT, fileRef_select);
                fileRef.addEventListener(ProgressEvent.PROGRESS, fileRef_progress);
                fileRef.addEventListener(Event.COMPLETE, fileRef_complete);
            }

            private function browseAndUpload():void {
                fileRef.browse();
                message.text = "";
            }

            private function fileRef_select(evt:Event):void {
                try {
                    message.text = "size (bytes): " + numberFormatter.format(fileRef.size);
                    fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
                } catch (err:Error) {
                    message.text = "ERROR: zero-byte file";
                }
            }

            private function fileRef_progress(evt:ProgressEvent):void {
                progressBar.visible = true;
            }

            private function fileRef_complete(evt:Event):void {
                message.text += " (complete)";
                progressBar.visible = false;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:NumberFormatter id="numberFormatter" /&gt;

    &lt;mx:Button label="Upload file"
            click="browseAndUpload();" /&gt;
    &lt;mx:Label id="message" /&gt;
    &lt;mx:ProgressBar id="progressBar"
            indeterminate="true"
            visible="false" /&gt;

&lt;/mx:Application&gt;</code>
</pre>
<p>In the above example we take a progress bar which will show the progress of file uploading. We also take a button which opens a system file open dialog box to select file from local computer. </p>
<p>When ever the above flex code gets execute first of all init() function will run. Using this function we create instance of FileReference and declare call back function for three FileReference events SELECT, PROGRESS and COMPLETE.</p>
<p>When we system dialog box using browse() and user will select a file from local computer at that time SELECT event will fire and the declared method will call to upload file at server by Upload().</p>
<p>When file uploading start at server to show uploading process we set the progress bar value at every time when PROGRESS event fire.</p>
<p>When file uploaded successfully at the server COMPLETE event fire we write appropriate code in that function which do what we want to do after file uploaded at server.</p>
<p>Please write a file for handling uploading using php and upload at the server and set its URL in the flex code. You can get lots of example of php file uploading just search on google.</p>
<p>The above code example upload single file at a time. If you want to allow users to upload multiple files at once, you would use the FileReferenceList class instead of FileReference.</p>
<p>I will post a example for FileReferenceList in my next post. </p>
<p>I hope the above information helps a lot if you have any query then feel free to ask. Please post your comment for the motivation to posting me information about flex here. if you need any other code example please let me know. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.rsdhariwal.com/2009/08/06/flex-file-upload-with-php-using-the-filereference-class/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
