• Home
  • About Me
  • AIR Central
  • AS3 Libs
  • Books
  • Flex Central
  • Resources
  • The Guru's
  •  

    Flex 2 Metadata Tags

    April 17th, 2007

    wddj51.jpg

    My article on Flex 2 Metadata tags “Telling the Compiler how to Compile” is now available in the current issue of the Web Developer’s & Designer’s Journal. Check it out on pages 26 - 31. You can read it here.


    Flickrin Apollo Tutorial

    April 6th, 2007

    Flickrin is a real world application for searching photos online using Flickr API created by Ashwinee Kumar Dash. Currently in version 1.0, the user can do a basic keyword search for thumbnails.

    flickrin.jpg

    Link to tutorial:
    http://flnotes.wordpress.com/2007/04/05/flickrin-ver-10-flex-flickr-apollo-mashup-tutorial/

    Link to sources:
    http://www.ashwineedash.com/download/Flickrin_1_src_files.zip

    Link to application:
    http://www.ashwineedash.com/download/flickrin1.0.zip


    SnapIt Apollo - Source Included

    March 26th, 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

    1. private function snagPic():void {
    2. bitmapData = new BitmapData(this.width,this.height);
    3. bitmapData.draw(this,new Matrix());
    4. var bitmap : Bitmap = new Bitmap(bitmapData);
    5. var jpg:JPGEncoder = new JPGEncoder();
    6. var ba:ByteArray = jpg.encode(bitmapData);
    7. newImage = File.appStorageDirectory.resolve("Images/" + fileName.text + ".jpg");
    8. fileStream = new FileStream();
    9. fileStream.open(newImage, FileMode.UPDATE);
    10. fileStream.writeBytes(ba);
    11. }

    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 22nd, 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


    Apollo Online/Offline sample - full source included

    March 21st, 2007

    Here is a nice little example of testing for online and offline within Apollo. It is very basic.

    Test it by either hitting the Test Connection button or by pulling your cable on disconnecting your wireless.

    Here is what is occurring within the application:

    • on creationComplete Shell.shell.addEventListener(Event.NETWORK_CHANGE,onNetworkChange);
    • onNetworkChange test the connection. Here is the contents of the test connection function.
        1. var headRequest:URLRequest = new URLRequest();
        2. headRequest.method = "HEAD";
        3. headRequest.url = "http://blog.everythingflex.com";
        4. var response:URLLoader = new URLLoader(headRequest);
        5. response.addEventListener(HTTPStatusEvent.HTTP_STATUS,statusChanged);
        6. response.addEventListener(IOErrorEvent.IO_ERROR,error);
    • when the HTTPStatusEvent.HTTP_STATUS Event is broadcast statusChanged is called
      • The statusChanged fuction checks the status code and sets disconnected if code is 0
    • if IOErrorEvent.IO_ERROR is broadcast
      • we assume the connection is broken

    Thats it. There are additional URLLoader events that can be checked but I haven’t included them in this example. Check the documentation for details on these events. Here is the results:

    ONLINE:

    online.jpg

    OFFLINE:

    offline.jpg

    Download the application

    Download source code