PureMVC Tutorial – Flex, PureMVC, Jabber and XIFF 3: Introduction

Introduction
Part 1 – Frameworks
Part 2 – Directory structure
Part 3 – Application and ApplicationFacade
Part 4 – Notifications, Commands & Use Cases
Part 5 – Model & Proxy
Part 6 – The Application View & Mediator
Part 7 – The Login View & Mediator
Part 8 – The Roster View & Mediator
Part 9 – The Chat View & Mediator
Conclusion, Demo & Downloads

I like Actionscript 3, I like Flex, I like Flash and I especially like PureMVC. In fact, I like them so much that its about time I wrote a fully fledged tutorial to help the rest of you like them as much as I do. The code we are going to recreate here started life as a technical test for a job I was interested in. Unfortunately it ended up not being for me, but the code itself lends itself excellently to demonstrating how to use PureMVC as well as creating a decent application along the way. As you have probably guessed from the title we’ll be creating a simple but fully functional Jabber chat client. Its not exactly going to be feature rich, but by the end of this tutorial your application will allow you to login, logout, show your buddy list and have one-to-one chats with your friends. Chatrooms, invites and all the other bits of Jabber goodness are left as an exercise for the reader :)

Before we start I should also humbly point out that there are many ways to program using PureMVC – what I’ve presented in this tutorial is the way that I like to do it, and the way that makes the most sense to me. However there are many equally valid ways to develop within a framework and you shouldn’t take my word as gospel, but work in whichever way you find suits you best.

Note that I’ve programmed the client using Flex merely because its quicker to create popup windows, form elements, etc in Flex than Flash. However, the bones of the app are valid in both so even if you don’t use Flex often you should still be able to get something out of this.

Before we get going, you’ll need the following:

Now we have the tools, its time to setup our project. We’re going to create an empty FlashDevelop project ready to receive our code. Open FlashDevelop and select Project->New Project. Choose Flex 3 project from the list, name the project ‘XIFFer’, check ‘Create directory for project’ and finally click OK to create the new project.

Finally we need to set the dimensions of our Flex application

  1. Right click on ‘XIFFer’ and select Properties…
  2. Set the dimensions to 760 x 400 px
  3. Click OK

We’ve got everything we need to get going! Continue onto part 1…

27 comments

  1. According to me it still needs live ip address ( or not under any proxy server )to login from client system. There are a majority of users who are using other messengers under their main proxy servers but xiff is not working under any type of proxies.
    Please do something for that.

  2. Hey Tony,

    XIFF is still in beta, so I guess this is something they will be fixing in a later release. What error messages are you getting in the console when you attempt to connect behind a proxy?

    Dave

  3. Thanks for the information shared here. that was an interesting and informative. I had a good experience by participating in the Adobe DevSummit in 2009 and looking forward to attend Adobe Flash Platform Summit 2010 as well. AFPS 2010 is the single largest Flash Platform conference in India which features topics like Flash, Flex, Flash Platform, AIR 2.5, Andriod, RIA, LiveCycles, PHP and more. I found the information about the conference from adobesummit.com

  4. Hi Dave,

    I am not able to run the application as it is giving Security Error. Anyways i want to know what is the use of send button in ChatView. Please reply ASAP.

  5. I rarely leave remarks, however i did a few searching and wound up here PureMVC Tutorial – Flex, PureMVC,
    Jabber and XIFF 3: Introduction | Dave Keen. And I actually
    do have 2 questions for you if it’s allright. Is it only me or does it
    look like some of the responses appear as if they are left by
    brain dead individuals? 😛 And, if you are posting on other online
    sites, I would like to follow anything new you have to post.
    Would you list of all of your shared sites like your
    twitter feed, Facebook page or linkedin profile?

Leave a Reply

Your email address will not be published. Required fields are marked *