Jabber Client with Flex & PureMVC
Just found a great and very detailed tutorial(with source) on creating a jabber client with Flex, PureMVC, Jabber and XIFF. It consists of nine parts:
- 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
As you can see, Dave Keen did a great job, and it’s really worth of taking a look.
Thanks Dave!
Using WebServices in FMS
This one is a quick beginner tutorial on using WebServices in Flash Media Server. Here you will learn how to retrieve web-service data from server side and pass it to all users connected to application. As an example I’m going to retrieve weather forecast.
- Let’s start from creating a new application(folder) on server and
call it “webservice-tutorial” or whatever you like. - Create main.asc file and copy the following code.
// Load WebService component. load("webservices/WebServices.asc"); application.onAppStart = function() { trace ("Application Started"); // Load WebService. this.loadWS(); } application.onConnect = function(client) { // Handle client functionality... application.acceptConnection(client); } application.loadWS = function() { // Define WebService. weatherService = new WebService("http://www.webservicex.net/WeatherForecast.asmx?WSDL"); weatherService.onLoad = function() { trace ("weatherService loaded..."); // Invoke getWeatherByName method and set interval // to invoke it every 10 seconds for example. application.getWeatherByName("New York"); setInterval(application.getWeatherByName, 10000, "New York"); } weatherService.onFault = function(fault) { // Handle error here. trace (fault.faultstring); } } application.getWeatherByName = function(location) { // Invoke web-service method passing it the location. weatherByName = weatherService.GetWeatherByPlaceName(location); weatherByName.onResult = function(result) { var newObj = new Array(); // Loop throught result and push needed fields to array. for ( var i = 0; i < result.Details.length; i++ ) { newObj.push({day:result.Details[i].Day, min:result.Details[i].MinTemperatureC, max:result.Details[i].MaxTemperatureC}); } var c = application.clients; if ( c.length ) { // Loop throught clients and pass weather data. for ( var j = 0; j < c.length; j++ ) { c[j].call("setWeather", null, newObj); } } } weatherByName.onFault = function(fault) { // Handle error here. trace(fault.faultstring); } }
Everything should be clear if you have Read more
AMFPHP Flex Guestbook
Would like to present you the first beta release of my Flex Guestbook. A week ago I’ve started to write a tutorial on creating a full featured paging, but ended up in a more complex example.
The application is tied with amfphp services which so far can return comments and insert them, the client part formats and displays posts, has a paging feature and of course a simple form to insert your data. At this point I stoped, to show the work in progress, so you could help me to define what other features I can add. Of course, there should be an admin part to moderate the content. But should it be an external app, or be right there in guestbook? Should there be multiple administators/moderators with different access level? Or maybe something is wrong or uncomfortable in existing version?
Would really like to hear any suggestions, meanwhile feel free to test the FGuestbook demo.
After getting some feedback, I’ll finish this project and open-source it.
As all my other projects it’s build on PureMVC framework, so it should be a good example for pmvc users or those who would like to learn it!
Sliding Puzzle Game
I’ve made this one using Flex and PureMVC framework. Also AMFPHP for high scores. As for design - “Darkroom” theme(modified a little bit) from scalenine.com. By the way, you can find some more cool themes there if you need. I always do so when I feel lazy to draw something by myself.
Anyways main goal was to test PureMVC framework on a real example, to see how fast would I be able to complete a project like this one. The resault was amaizing - I’ve finished all the functionality in less than a day! Though the code isn’t very clean, but thanks to mvc structure it would be easy to refactor.
If I’ll find some free time to clean the code, I might open-source it. But if you need a project like that, or just curious, contact me and i’ll send you the source.
The rules are simple :
- you should place pieces by way of following numbers from 1 up to 15.
- Your goal is to collect a puzzle for smaller amount of turns.
I solve it in less than a minute. Try it out youself.
Related Posts: Renju, The Game