Flash Lite 3 Security Sandbox – A Reminder

This isn’t anything new but it’s an easy one to forget and something that caught me out the other day. So to be perfectly honest I’m writing this as more of a reminder to myself rather than anything else.

Firstly the problem. I was helping someone with their Flash Lite app that let the user send SMS messages to friends, but for some strange reason the device refused to launch the SMS application. Of course it was a silent failure so there were no error messages explaining why.

Now I’d simply put it down to the dude’s Nokia E90 not supporting SMS within Flash Lite but Alessandro Pace thankfully chipped in with the reason and a solution. It was of course all down to the fact that the SWF was running on a device shipped with Flash Lite 3 which, rather infuriatingly, has the exact same security sandbox as the Flash 8 player.

So why’s that such a bad thing? Well this security model effectively means that apps can either have local access or remote access but not both, which doesn’t really make much sense when dealing with mobile. If you want to make a getUrl()call, which is required to send an SMS, then you’ll need to publish your SWF with network access enabled and also copy it to a special Trusted folder on your Nokia.

Unfortunately this security model and the work-around both have a whole series of implications ranging from backwards compatibility with SWFs published for older Flash Lite players, to issues getting your applications Symbian Signed.

Adobe have addressed this with Flash Lite 3.1 but it’s something that isn’t going to go away in the short term due to Flash Lite fragmentation across the range of Nokia handsets that are already out there.

If you want to know more then I strongly suggest you read Ugur’s excellent blog entry that he posted way back when Flash Lite 3 was launched. This issue was also raised by Faisal Iqbal at the time who wrote a great follow up with additional issues and nags.

Adobe’s Mobile Strategy Fundamentally Flawed?

Well it is if you believe what Aral Balkan had to say recently. His post sparked some intense and much welcomed debate within the community regarding Adobe’s mobile strategy. In particular both Scott Janousek and Mark Doherty posted excellent responses and I think all three posts are definitely worth a read.

Flash Lite in particular took a bit of a bashing from Aral and it’s something I’d like to talk about here. Firstly I’d like to point out that I agree with many of Aral’s points. I don’t personally know him but he’s highly respected and very influential within the Flash community, and his blog is something I make a point of checking out from time to time.

I’ve been writing Flash-based mobile apps before Macromedia released Flash Lite and although my Flash Lite work these days is restricted to personal projects I’ve been following its evolution since day one, so feel I’m well positioned to comment.

Continue Reading

Just Ask Lee Brimelow

There’s a great recording of Adobe Platform Evangelist Lee Brimelow on USTREAM answering 50 questions put to him by the Flash community. His answers give an interesting insight into Adobe’s strategy for the Flash platform and also helped confirm things that many suspected.

He confirmed that Adobe are deliberately pushing developers towards Flash Builder and continuing to cater for designers within Flash Professional. It’s why very little effort has gone into improving the coding tools within Flash whereas Flex/Flash Builder’s IDE has gone from strength to strength. The news regarding the tighter integration between the upcoming Flash CS5 and Flash Builder was also very welcome and something I’m really looking forward to.

Also due for release in Flash CS5 is a brand new text engine and much improved font support. Anyone who’s used Flash will know how tricky it can be when dealing with fonts and managing the fonts that are embedded within your SWFs, so I’m sure it’s going to be another great reason for upgrading to CS5.

Also anyone holding their breath for ActionScript 4 should probably stop. Lee confirmed that ActionScript 3 is here for the foreseeable future and that there are no plans internally for a replacement. He does however state that there will probably be improvements to the language over time, so people hoping to see language features such as the inclusion of private constructors might still get their wish.

One thing that really surprised me was Lee’s admission that although a lot of effort had gone into improving the animation system in Flash CS4 most users had not embraced it, and had instead opted to stick with the traditional system. I have to admit that I still use the classic timeline animation model in Flash but I’m a developer who doesn’t have as much need to use the timeline. I would however have expected designers/animators to have gone mad for it. I might make it a priority to find the time to look into the new timeline animation in Flash CS4. After all the guys at Adobe put in a lot of effort and from what I can see, produced a pretty neat piece of work.

Have a great new year, and I’ll hopefully blog again in a few days time.

Draw me a crocodile and make it snappy!

That’s exactly what I said to concept extraordinaire Steve K and he happily obliged. The image below is a render from the 3D model Alan has produced from Steve’s artwork.

So what’s this character’s name then? Well his friends (and his enemies) simply call him Croc and as you can no doubt guess he’s the other main character in my iPhone project. I haven’t gone into any great detail regarding the game yet but let’s just say that both Croc and Dare don’t get on.

Conditional Compilation

It’s the simple things that make me happy. Conditional compilation is one such thing and although it has been available since Flash CS4 those developing for mobile have been unable to take advantage of it. Why? Well to-date mobile developers have been limited to Flash Lite and ActionScript 1/2, whereas conditional compilation is only available when writing ActionScript 3.

This has been a real shame since Flash Lite developers arguably require conditional compilation more than any other Flash developer. Take my GamesFlash project as an example. I targetted over 50 different handsets and also wanted to ensure that it would run within a web browser for demonstration purposes. Considering the varying specifications across my target devices I quite often had to remove features from certain builds – streaming video being a feature that was only supported by the S60 devices. Without conditional compilation doing this can be a side-project in itself.

Sure, there are ways around it. For example, you can write multiple versions of certain classes (a feature rich version of a class for high-end handsets and a more modest version for low-end devices), store them in different folders, then using multiple profiles, point each profile’s class path to the correct folder for the version of the class that’s required. This approach works well for those going down the object oriented route, but for many Flash Lite developers this won’t be the case and including/excluding code from certain builds will suddenly become more difficult.

Thankfully developing iPhone apps using Flash CS5 won’t have these problems since it’s the first time that mobile developers using Flash will be able to take advantage of ActionScript 3. The following snippet of code illustrates just how useful conditional compilation can be:

private function setup() :void
{
    CONFIG::WEB
    {
        // Add lots of complex shapes - we've got the CPU.
        addShapes( new ComplexShape(), 1000 );
    }

    CONFIG::IPHONE_3G
    {
        // Add a modest number of simple shapes - we don't have much CPU.
        addShapes( new SimpleShape(), 50 );
    }

    CONFIG::IPHONE_3GS
    {
        // Add lots of simple shapes - we have some more CPU.
        addShapes( new SimpleShape(), 100 );
    }
}

The example above expects there to be three config constants set via the Publish Settings panel in Flash: CONFIG::IPHONE_3G, CONFIG::IPHONE_3GS and CONFIG::WEB. Depending on the build I want to make I can set certain constants to true or false, or alternatively create multiple profiles with different configurations for these constants and simply select the desired profile. This should make life so much easier.

So what about Flash Lite developers? Well if you’re developing for any of the current Flash Lite players you’re still going to run into the same frustrating problem. However there is light at the end of the tunnel. Flash Lite 4 and Flash Player 10 for mobile are on the horizon, and with both offering support for ActionScript 3, building for multiple targets will become a whole lot easier.

RSS Feeds Fixed

I suppose I should have noticed this sooner but it looks like it has been impossible to subscribe to this blog’s RSS feed on certain browsers due to a small bug with the theme. Thankfully it was only a small one line fix to the header.php file. It’s working now so there should be no excuse for not clicking on the little orange icon on the top-right.

Introducing Dare

With my Russian roulette game done and dusted it’s time for me give you lucky readers a sneak peek at my next project. I wont reveal too much at the moment, mainly because it’s still in the very early stages, but I can tell you that it’ll be an iPhone game starring a monkey called Dare. Why the iPhone and why a monkey? Well the iPhone seems to be what all the cool kids have these days and I’ll be able to focus on a single screen resolution, which makes life much easier. As for the monkey, well everyone loves monkeys and they just seem to work in video games.

From concept art to rendered 3D model.

I’ve got two artists with me on this one, although I’ll admit that I’m a bit apprehensive about working with either of them due to some peculiarities they have. The concept art is being done by a dude named Steve Koran who unfortunately was recently bitten by a zombie and has become one of the living dead himself. Interestingly, the shuffling and unpredictable motion that comes with being a zombie seems to work well with his drawing style and I now have him chained to a desk and working happily away. Getting the concept art off him can be dangerous though. On several occasions he’s tried to bite me as I reached over to grab the drawings.

The other creative will be taking Steve’s concepts, converting them into 3D models and animating them. But this is where it gets even stranger and I promise you I’m not making this up. The other artist is actually a future version of myself trapped in the present. Now I know this sounds completely bonkers but it turns out that time travel isn’t that difficult. Apparently all you need is a couple of cardboard boxes and some argon gas. Unlike my future self, just make sure you don’t lose the boxes or you’re gonna have difficulty getting back to your own time. Anyway while there’s a duplicate copy of myself running around I thought I might as well put him to some use and get him working on the graphics. To hide the fact that he’s actually from the future I’ve decided to pretend I have a twin and will from this point on refer to my future self as Alan.

Wireframes of Dare

I thought that this would be the perfect opportunity for me to create something in preparation for the release of Flash CS5, which will allow developers to build content for the iPhone. My previous mobile projects have all been Flash Lite based so it’ll be good to write some ActionScript 3 for a change. I’ll keep you posted and will reveal more details about the game over the coming months including one other very important character.

Russian Roulette Touch Released

If you’re lucky enough to own a touchscreen Nokia rather than one of those smelly iPhones or HTC thingies then you’ll be able to play the latest version of my Russian roulette game that is now available from clickgamer.

It’s the ideal game for making bets with friends and family. I’ve won a considerable amount of money from my cousin Gregory but that’s because we’ve been playing with a ‘special’ version I hacked together that allows me to cheat! Gregory hasn’t figured this out yet and somehow believes he’s the unluckiest guy in the world when in fact he’s actually just the dumbest. Shhh! Nobody tell him.

Russian roulette

As well as the screenshot above there’s also a video in one of my earlier posts of the revolver working on my Nokia 5800.

So what touchscreen (or S60 5th Edition as us geeks prefer to call them) Nokias will it run on? Well it should run on all the 5th Edition devices actually but for the avoidance of doubt here’s a list:

    Nokia 5235
    Nokia N97 mini
    Nokia X6
    Nokia 5230
    Nokia 5530
    Nokia N97
    Nokia 5800

I must say, both the X6 and 5530 are nice looking devices.

Russian roulette is available from clickgamer.

RIP GamesFlash

‘What the heck is GamesFlash?’ I hear you ask. ‘Is this another one of your hugely ambitious personal projects that never got finished Mr Caleb?’ Well yes and no. You see I did actually finish this one, although I do confess to having spent the last three years of my life on it. Strictly speaking, saying I’d finished it is actually a little white lie. You see the very nature of GamesFlash means that I suppose I could go on indefinitely working on it but I felt the time was right to move on to other things, including this blog.

GamesFlash

So what is it? We’ll it’s a Flash Lite application that delivers the latest video game reviews, news and videos straight to your phone. Although at its heart it’s much more generic than that and can really deliver any content you like. GamesFlash was used as a test case to demonstrate the technology behind it. I ran GamesFlash over a two year period along with a few friends who helped me regularly update it with new articles. While I was producing content I was also continually adding new features and optimising the code base to squeeze it onto as many handsets as possible. As you can imagine it didn’t really leave me with much time for anything else.

When I started work on GamesFlash, browsing the web on a phone wasn’t a very satisfying experience and thanks to high data charges was also very expensive. The aim of GamesFlash was to get round this by bypassing the phone’s web browser completely and instead deliver graphically rich but bandwidth light content via the Flash Lite player. Articles delivered to the phone were template based and each template had a very small set of tags enabling me to keep data transfer to a minimum. All graphics were also optimised on the server for the device, again ensuring very fast and inexpensive downloads.

A few years down the line I also introduced streaming video for those who had a suitable data plan for their phone. Users were able to watch video trailers that accompanied many of the articles and I felt it added significantly to the experience. However by this point the iPhone was a really big deal and had revolutionised the mobile web experience. Suddenly in an attempt to catch-up, every phone manufacturer was producing pretty decent browsers for their handsets and the carriers were finally offering affordable data plans.

All this meant that GamesFlash was starting to look a little obsolete in its approach. Plus the scale of the project had started to get seriously out of hand. To be honest it had stopped being a one-developer project some time ago but I kept furiously chipping away at it determined to realise my original vision. Maintaining both the server-side and client-side code was a huge strain and I also made the decision to completely re-write the client one year into the project. It was necessary in order to get it running on mass-market devices such as Nokia’s Series 40 handsets but with very limited spare time on my hands it took around 10 months to do.

I’m very proud of GamesFlash and what I managed to achieve considering the scale of the project. In its first year alone GamesFlash was downloaded 8000 times, which I thought was pretty remarkable considering I could barely find the time to publicise it – another drawback of doing it all myself. It was also a finalist in this years Flash Lite Developer Challenge which was quite exciting and in many ways felt like a reward for all the time I’d put into it.

However with the mobile landscape having changed so much I feel there’s no longer a need for something like GamesFlash. It could perhaps survive in some capacity for low-end handsets where web browsing can still be a clunky experience but with smart phones gaining greater market penetration I think more and more people will be able to access on their handset the same content they view on their desktop.

I’ve learned a lot during this project and I’m delighted that I got everything into a more-or-less complete state and that people actually used it. But the time is right to move onto new things. If you’ve made it this far then thanks for letting me get all this off my chest, and if you fancy taking a peek at GamesFlash then you can actually play around with it via the web-based emulation below.

Use the mouse to click on the handset’s softkeys and navigation pad, or alternatively click to focus then use the cursor keys and the return key on your keyboard.

Touchscreen Demo

Well that’s the revolver code from my Russian roulette game rewritten for touchscreen. Having touch support has allowed me to make things a little more interesting, with the user now being able to tinker with individual parts of the gun, which you can see in the video below.

Considering how tricky resistive touchscreens can be to work with I’m pleased with the end result. Getting it to work with a finger rather than the Nokia 5800’s stylus wasn’t easy and there were times when I wasn’t sure it would give a satisfying experience.

There’s definitely room for improvement and I should be able to increase the frame rate by making a few tweaks here and there. I’m actually rotating the revolver graphics 90 degrees at the moment, which is obviously a huge performance hit. Once I get the user interface up and running I’ll go back and optimise things.