Sunday, August 10, 2008

Rotating the image by 360 degree

A sample application demonstrating the rotation of image image by 360 degree. The image snapshots are taken in all angles and are loaded as per the slider value.


View the application....

Customizing Combobox in Flex


A sample application demonstrating the custom combo box with the image item renderer.



View the application....

Saturday, August 9, 2008

Simple FIle Upload and Download

A sample application demonstrating the file upload and download functionality using flex an php.

Watch out the max file upload size in php.ini settings..


View the application here....

Image Dragging animation


Sample application demonstrating the Image drag and drop in Flex with animation.

The image gradually fades away from the source tile list with a sound effect.

View the application here.....

PHP Session in flex.....

A sample application to demonstrate the session id using flex and PHP

Whenever you press the hts.send button in the upper left corner...The count value is returned for that session.

The right corner login button is used for the login management...

The trick in php is the session ID managed by the browser cookies to save it...
ini_set ( 'session.use_cookies', 1); 


ini_set (' session.use_only_cookies', 1);


PHP Code:


<?php

ini_set('session.use_cookies'     , 1);


ini_set('session.use_only_cookies', 1);


session_start();



$_SESSION['cnt'] ++;



if( $_POST['name'] == "testuser" && $_POST['passwd'] == "testpwd" ){

    $_SESSION['login'] = 1;


}else{


    $_SESSION['login'] = null;


    unset( $_SESSION['login'] );


}



var_dump( $_POST);

var_dump( $_GET);


var_dump( $_COOKIE );


var_dump( $_SESSION );


?>




Flex Code:



<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()">


    <mx:Script>


        <![CDATA[


            private function init():void{


            }


            private function submitLogin():void{


                hts.method = "POST";


                hts.send({


                    "name":nameTxt.text,


                    "passwd":passwdTxt.text


                });


            }   
        ]]>


    </mx:Script>


    <mx:HTTPService id="hts" url="http://yoursite/sessionTest.php" resultFormat="object"/>


    <mx:TextArea x="10" y="39" width="310" height="365" text="{hts.lastResult}"/>


    <mx:Button x="245" y="9" label="hts.send" click="{hts.send();}"/>


    <mx:Panel x="342" y="20" width="336" height="238" layout="absolute" title="Login Form">


        <mx:Form x="30" y="30">


            <mx:FormItem label="Usename" required="true">


                <mx:TextInput id="nameTxt" text="testuser"/>


            </mx:FormItem>


            <mx:FormItem label="Password" required="true">


                <mx:TextInput displayAsPassword="true" id="passwdTxt" text="testpwd"/>


            </mx:FormItem>


        </mx:Form>


        <mx:Button label="Login" click="submitLogin()" x="212" y="120"/>


    </mx:Panel>


</mx:Application>




 









View the application here....

Image preloading in flex

A sample application demonstrating the Image preloading.

A swf animation will be shown till the image is fully loaded.

A sample component has been developed to load the image and show the animation till that point of time.

All you need to give is...



View the application here...




Monday, August 4, 2008

Desktop Alert program

I have written a desktop Alert Program in AIR for getting a desktop alert when a user posts an entry in the guest book.

Run the air file....Post an entry here

You would get an desktop alert within 3o secs. This needs a bit of server side scripting....cron job in ActionScript...

A sample program is already present in adobe devnet...


Download the Air file...