So we know that ActionScript 3.0 at present doesn’t allow for private constructors in order to conform to ECMA standards, which in turn means that when we write our Singletons we aren’t really getting the real deal.

Tink and I experimented with a little idea last night that might help with this. Very simple code as follows:

package ...
{
class SomeSingleton
{
 private static var instance:SomeBusinessDelegate;
 private static var instantiatingSingleton:Boolean = false;

 public SomeSingleton()
 {
  if( !instantiatingSingleton )
  {
    throw new Error( "SomeSingletonis a Singleton and must be accessed through the getInstance() static method" );
  }
 }

 public static function getInstance() : SomeSingleton
 {
  if( !instance)
  {
   instantiatingSingleton = true;
   instance = new SomeSingleton();
   instantiatingSingleton = false;
  }

   return instance;
  }
 }
}

So this gives us one extra layer of security when it comes to someone accidentally instantiating an instance of our Singleton. On a different note, I’d like to see “throws” added to ECMA too so that the programmer is forced to catch these errors or at least expects them without digging through the code (if at all available).

Note that this uses an old trick that also applies to emulating Abstract classes, but below you can see that if your Singleton is also abstract (in this case our SomeBusinessDelegate) you have to change things a little bit:

package ...
{
 class SomeBusinessDelegate extends AbstractDelegate
 {
  private static var instance:SomeBusinessDelegate;

  public SomeBusinessDelegate()
  {
   if( !instantiatingSingleton )
   {
    throw new Error( "SomeBusinessDelegate is a Singleton and must be accessed through the getInstance() static method" );
   }
  }

  public static function getInstance() : BusinessDelegate
  {
   if( !instance )
   {
    instantiatingSingleton = true;
    instance = new BusinessDelegate();
    instantiatingSingleton = false;
   }

   return instance;
  }
 }
}
package ...
{
 class AbstractDelegate extends EventDispatcher
 {
  private static var instance:AbstractDelegate ;
  private static var instantiatingSingleton:Boolean = false;

  public AbstractDelegate ()
  {
   if( !instantiatingSingleton )
   {
    throw new Error( "SomeBusinessDelegate is a Singleton and must be accessed through the getInstance() static method" );
   }
  }
 }
}

Obviously we have no getInstance() static method in our Abstract class.

Last night’s London MMUG went very well, I’m sure any photo’s/video’s will make it online shortly. Congratulations to Niqui Merret who won the prize of Adobe Production Studio. For those of you that weren’t there, the winner was randomly selected and called from my mobile phone with a very simple little Flash Lite 1.1 app at the end of the night.

Even though this little app was never destined to be seen (god it’s ugly) I thought I’d upload it for anyone starting out in Flash Lite, and for those that would like to see how you can emulate arrays or call phone numbers. There’s not much in there at all, so it should be fairly self explanitory.

Download the app here.

So no accusations of a fix please! :) We had to use the back button to dial 6 numbers in the end, 2 people didn’t pick up to win their webDU shirts… sorry!

Btw the name “Galahad” follows on from the naming of the Lottery machines here in the UK: Lancelot, Guinevere, Arthur and Merlin.

Just reading the latest Sony news following the press conference in Tokyo. It mentions a major firmware upgrade this spring including support for GPS, Camera and VoIP modules/addons, and… Flash in the web browser!

Read the article here.

Another essential security update to Microsoft’s Internet Explorer is being distributed in the next series of system updates. This snippet explains it pretty well:

When a web page uses the APPLET, EMBED, or OBJECT elements to load an ActiveX control, the control’s user interface is blocked until the user activates it….If a page uses these elements to load multiple controls, each interactive control must be individually activated.

So now you don’t see anything until you click the big ugly block?Edit: It appears you do see the Flash movie, you just cannot interact with it through the mouse or keyboard. A user on FlashGroup.net states that it is possible to add the Flash content via the DOM to circumvent this.

This also affects the following Active X controls:

Adobe Reader
Apple QuickTime Player
Macromedia Flash
Microsoft Windows Media Player
Real Networks RealPlayer
Sun Java Virtual Machine

You can read more here, and here. I thought this was an old story but never made it? Thoughts?

Eric D. threw up a very interesting point in his latest blog post. Asking whether there is a way to accurately emulate the performance of a lower powered, slower device such as a mobile phone.

I did a quick couple of tests using the latest Flash Lite emulator and a combination of an FPS speedometer, capabilities test, and a couple of apps designed to slow down your computer’s CPU for emulating old DOS games. Check out the results, posted in the comments on Eric’s blog.

It was interesting to see the Flash Lite emulator is in fact limiting FPS, and I do believe CPU speed. Also interesting was that the capabilities test we created ran quicker in the Flash Lite 2.0 emulator than it did when published as a desktop profile (Flash 4), in particular, the prime number test.

If anyone has any other ideas to try, or some further insight please add it to the comments over on the blog.

Skype 2.0 for Windows now has video calling, mood messages and your local time.

Skype 2

Skype 1.4 for Mac now also includes your mood message and local time, but it also appears to be skinnable from the pic below. There is also a widget useful for looking up country codes and checking call rates. It will also pause iTunes with incoming calls and several other nice features.

Skype 1.4

Click an image to download.

Something I forgot to upload a while back.

This “component” allows the user to enter text with T9 (non-predictive) text input without having to use the cursor keys and select to give focus to the textfield, i.e. tapping the 2 key will cycle through “a”, “b”, “c”, “2″ and wait a second for it to advance to the next character in the string. Simple concept that we now take for granted on phones, Macromedia created a Flash Lite 1.1 version which did the same thing although this one was a lot easier to make having to modify that for an FL1.1 app just recently (kudos for the major effort that must have been put in there)!

FL2 Inline TF

Feel free to download the source to use as-is. Simply call myInlineField.setFocus(true); to activate user input. I feel strongly about the way users have to tab to textfields and then press enter to begin text input in Flash Lite and would rather not have the extra step of pressing enter/select, or take a game-alike philosophy where-ever possible using the inline field. For things like forms on the other hand the existing system works fine. I’ll take some time to improve this later, instead of a cursor flashing it should display a carat in the textfield and so on…

Also, I’ll be uploading a full Flash Lite 2.0 app with source in the next few days so look out :)

First up, eagle eyed Scott has just caught a job vacancy on Monster for a “Senior Product Manager, Flex Mobile Development at Adobe”. Well there’s been some suspicion regarding this matter since Flash Lite 1.1 came out, I asked Mike Chambers this when he came over for the 8-Ball London MMUG special in Sep with a very understandable no comment, but now it looks like the final piece of the puzzle is fitting into place.

I spoke with Alex Bradley at Spark in Amsterdam last October about this matter, and how he might convert the excellent Kinetic Fusion into a Flash Lite content generation and distribution platform that runs on any Java enabled server, something similar to Flash Cast but without being completely closed to everyone but mobile operators. People that might be interested in using it include large TV channels, papers/magazines, educational facilities and any other entities that have a large amount of managed textual and multimedia content that they’d like to distribute to a wide user base through the web and mobile.

I can see a lot of room for such products in the near future, now I need to have someone give us the capital, and let’s get coding!

Unfortunately I couldn’t make it to 3GSM, but I’ve just been informed that the chief integrator of Motorola has said that we will see Flash Lite on their phones such as the Rokr within 3 months! Motorola were the last of the major manufacturers to cave, but now we have the whole set :)

Series 60 news – As we know the new Series 6 v3 SDK contains the Flash Lite player as a standalone and web plug-in. It looks like the greatly anticipated N91 (4gig, wifi, I want one) will have it installed, as well as the lovely looking E-Series business phones, the E60 is my personal favourite.

Also we have already heard that series 40 phones will support Flash Lite, the only worry there being the speed of execution. Well again I’ve been told that the 6125, a series 40 mass market, doesn’t run much slower than the all singing series 60 smartphones, great news! To boot, it has Flash Lite as a screensaver option!

Thanks to Alistair for keeping us informed!

Big thanks to Adobe for last night’s party in London, we had a good time and it was great to catch up with everyone. Here’s a bit of fun with one of the photos just before we got there, it’s called spot the Tink. Guy seems to be concentrating on some white dots that happened to be floating in front of him. Mike has some good ones too.