With the new release of version 2.0.1 for the ActionScript 3 platform I have got to say I am buzzing. There are some nice changes to the framework which have already made my code cleaner and simpler. So, I thought it would be cool for people to list there likes for this version (not just the new changes made) and maybe an example of how they implement there highlighed likes. Lets get the ball rolling:

Like: facade.hasMediator

Example: I found this great for creating popups, using facade.hasMediator I can check to see if there is already a mediator already registered and prevent duplicate popups being instantiated.

1
2
3
4
5
var pop_registered:Boolean = facade.hasMediator( PopMediator.NAME );
if( pop_registered == false )
{
PopManager.openPopUpWindow( MyPop, PopMediator, true );
}

I am noting that there are others out there who share my frustration in the inability to install AIR applications and seek a solution (if there is one). AIR installs fine as one would expect but I tell you what, there is not one AIR application that will install on my machine, I get the following error:

Sorry, an error has occured The application could not be installed because the AIR file is damaged. Try obtaining a new AIR file from the application author

Read on →

I have had a recent request to check the length of text in a TextField, and if it exceeds a certain size i.e. the width of its container, then to find the characters that precedes the container boundary and replace them with “…”

Here is the method I ended up using to achieve this:

1
2
3
4
5
6
7
private function checkLength( tf:TextField, container:Sprite ):void
{ 
  var firstChar:Number = tf.getCharIndexAtPoint( container.width-5, tf.y );
  var endChar:Number = tf.text.length;
              
  tf.replaceText( firstChar, endChar, "..." );
}

Due to me buying myself the new beast of a computer ( 8 core mac pro!!!! ) I have been doing some spring cleaning and discovered my first Flex video player. This was a project I never got round to completing fully due to (a) time (b) no clients specifying ‘Flex’ as the platform to develop a video player. I had fun building this and look forward to getting back to it and implementing resize and full screen capabilities. It was build on the PureMVC framework and uses an XML playlist, displays clip info on rollover of video, features a loop playlist function and is built using a Video Object as opposed to the Flex VideoDisplay component which I am not terribly keen on personally. Anyway, check it out and be aware the video content may not be suitable for the easily offended (hip hop orientated clips).

Head scratch moment recalled whilst building the progress/scrub bar.

Newtriks Flex Video

I have noticed recently a web site that has completely ripped off one of my tutorials for an flv player using PureMVC and actually passed it off as their own!!!!! This is one major p*s$ take using my hard work for you lazy muppet sites who haven’t got the knowledge or courtesy to ask permission first.

All tutorial articles on this website are copyright to Newtriks and if anyone wants to reproduce them on their site PLEASE ask my permission first or do what most str8 up honest people to, link back!

P.S. Looks like this website has been hard at it ripping off the hard working developers involved in writing tutorials:

http://www.flashcomguru.com/index.cfm/2008/4/11/content-pirates

I needed a quick easy way to take BitMap snapshot of a loaded flv for an app. I thought the easiest way to accomplish this would be to load the FLV into my player and then play a very short snippet, pause the video and then take a snapshot. Here are some snippets of my code to give you an idea of how easy this is to accomplish. Maybe someone has a better way to do this which I would love to hear about:

Read on →

If your gonna listen out for notifications in a mediator thats registered using the PopManager class I detailed here http://www.newtriks.com/?p=76 be aware that the mediator may not be registered when the notifications are being fired.

For example, I want to populate a popup window with data from a proxy using the mediator to request the data. I do this by getting the mediator to send a notification to the facade which runs a command telling my proxy to get the data, the proxy will then send a notification with the data as its body.

The key to this all working is the point in which we send the notification for the data from the mediator, obviously the mediator needs to be registered with the facade so it can listen out for the notification sent by the proxy.

Solution:

The View calls onRegister() when the Mediator is registered, so override this method in the mediator and send the notification for the data within this method.

I was under a bit of time pressure and trying to stop dragging of a TitleWindow PopUp. I tried all sorts of funky stuff like intercepting the onMouseDown Event and using Event.stopImmediatePropogation() to no avail. I also wanted access to the titleBar exclusively so here is an extended TitleWindow which enables both my requirements and stops the dragging of a TitleWindow. Read on →

The Manifold Project is about integration of the community contributions into the codebase with a focus on creating reusable, ‘off-the-rack’ utilities that extend the framework’s capabilities. For a few months now I have been involved in the PureMVC Manifold Project as a project owner. This has involved building project demos to demonstrate how to use the PureMVC framework in real life applications. So far I have conrtibuted 3 demo apps highlighting use in Flex, AIR and ColdFusion, these should help people interesting in using a solid framework like PureMVC to get onto the ladder of developing neat little applications, never look back :) + PureMVC AS3 / AIR Demo - RSS Headlines + PureMVC AS3 / Flex / CF Demo - File Upload + PureMVC AS3 / Flex / CF Demo - Query a CFC

Check my project homepage for all my demo applications with release notes, source and further information! http://trac.puremvc.org/PureMVC/wiki/ProjectOwners/SimonBailey