Motorola and Flash Lite – News from 3GSM

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,…

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!

Adobe Launch Party Thanks

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 whi…

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.

Embedding Flash Lite in Mobile Pages Using Dreamweaver 8

I have a Flash Lite project on at the moment, and one thing the client would like is to have a mini-wap site so that users can download the game’s installer, or click through to a direct link to the SWF. If you don’t know where to start when coding for W…

I have a Flash Lite project on at the moment, and one thing the client would like is to have a mini-wap site so that users can download the game’s installer, or click through to a direct link to the SWF. If you don’t know where to start when coding for WAP, let me suggest that you, just for the moment, ignore the idiosyncrasies of the WML language used to create WAP pages, and instead stick to some mobile-centric XHTML, which any Flash Lite capable phone should be able to handle without problems.

XHTML is of course much more accessible to web developers as they will not have any extra tags to learn in order to get going. But for those of us who are hardcore Flashers and never touch HTML we can rely on Dreamweaver to give us a helping hand. If you click on the picture below you can see that Dreamweaver offers a template for an XHTML Mobile 1.0 page.

Dreamweaver 8

With that done we have a few choices. We can either link through to the SWF directly with a hyperlink or image, we can embed some server-side script to redirect the page directly to the SWF (using perhaps header(location: some.swf); in PHP), or we can actually embed the SWF directly in the page. In this example I have gone for the latter:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<object data="miaMobile.swf" type="application/x-shockwave-flash" width="100" height="100" >
<param name="bgcolor" value="#000000" />
<param name="loop" value="on" />
<param name="quality" value="high" />
</object>
</body>
</html>

Here’s a link to the file.

You may notice the lack of an embed tag, but don’t worry this will work. In the end I’m not going to use this approach as I want to run the SWF full-screen so I will link through directly, but it will be nice to see some Flash content appearing on mobile pages soon. If you don’t have a Flash Lite enabled phone, you can try the above URL in the emulator that comes with the new Series 60 SDK.

In the emulator you can also see that we get a focus rectangle appear around the Flash, this is something to consider when you wish to respond to user input. Just as in a desktop web-page, a user must give focus to the Flash element before they can interact.

Note:

I omitted to mention that this doesn’t work on all phones, only phones with the Flash player integrated as the plug-in, such as most Japanese i-mode handsets and according to the Nokia emulator at least, the new wave of Series 60 (ed 3) phones soon to be released. On our developer installs this still prompts us to click the Flash movie to open it.

Flash Lite App – Adobe Product Certification Practice

I’ve just received an email from Fabio over at elastech.it letting me know that they have just uploaded a new Flash Lite application to the freeware section at flashmobile.it. QuizAndPass aims to test you on several Adobe products including -of course- F…

I’ve just received an email from Fabio over at elastech.it letting me know that they have just uploaded a new Flash Lite application to the freeware section at flashmobile.it. QuizAndPass aims to test you on several Adobe products including -of course- Flash Lite. This is yet another nicely styled app that is polished throughout, following on from their previous app LitePoker, which also looks and runs great.

quizandpass1

quizandpass2

quizandpass3

Head on over to flashmobile.it to download it now. (Please note that my download link email arrived in my spam folder when using a gmail address).

Beware of Cached JSFL Commands

I’ve used JSFL a couple of times, but never really sat down to learn it, so I thought I’d post this little conundrum incase anyone starting to use it comes across it. We’ve just had a call from a friend wondering why his code was producing an error when…

I’ve used JSFL a couple of times, but never really sat down to learn it, so I thought I’d post this little conundrum incase anyone starting to use it comes across it. We’ve just had a call from a friend wondering why his code was producing an error when he was sure there was no error in his code – indeed there wasn’t. The code was a simple one line copy and paste from the Help files, selecting an item from the library.

One thing I found with JSFL is that the commands are cached when they are sitting in your Commands folder. So if you are running them by either double clicking the JSFL file, or going Commands > Run Command and selecting the file you are fine. But beware that if you make any changes to a file once it has found its way into your Commands menu, you’ll have to restart Flash before the changes take effect. As a quick tip I’d probably say when writing and testing the commands, run them from file, and move them into the Commands folder when final.

Creating Trials for Flash Lite Apps (Part II)

So following on from the first part of this discussion I was asked to look at creating a 10 day trial Flash Lite application. The theory is sound, you either contact a server and pass it the IMEI (best option), or work out a way of storing some informati…

So following on from the first part of this discussion I was asked to look at creating a 10 day trial Flash Lite application. The theory is sound, you either contact a server and pass it the IMEI (best option), or work out a way of storing some information on how many uses have taken place locally on the phone, either using plain-text, a hash or some real encryption.

In Flash Lite 2.0, we can do this with Local Shared Objects, this is also great to keep the information from prying eyes as you have to know where to look for the SO’s in order to try and crack them, the down side is that a little bit of digging a while back showed they look fairly similar (if not the same) as desktop Flash Player SO’s and therefore there are already tools available to read them. Either way, they are a boon to Flash Lite development for many other reasons.

However, we aren’t able to use SO’s in Flash Lite 1.1, so we are going to use a very simple EXE bundled with the app to write to and update a text file, “config.dat”.

The first step is to create a new Flash Lite 1.1 FLA, and create a sub-folder in it’s directory called “config”. Into this we put our EXE, Christian Halbach’s flash2file (for which the source is available), and a plain text file named config.dat, which contains the following text:

uses=295

You might think that it’s strange to set the number of uses to 295 to start, but this is because we are piping that number through a formula to figure out the real number:

Figure to store = 300 - (3n^2 + 5)

Where n is equal to the number of uses so far. So with that in mind, we can visualise a table to suit:

Number of uses: Figure to store:
0 295
1 292
2 283
3 268
4 247
5 220
6 287
7 148
8 103
9 52

Now that we can “hide” our number of uses in a not so obvious manner, we can go about hooking up our Flash Lite app with flash2file to read and write this value. On frame 1 I have the following code:

fscommand2("SetQuality", "high");

// Load in number of uses so far
uses = -1;
loadVariables("config.dat", "/");

On frame 2 the following:

// Loop until number of uses has loaded
if(uses != -1)
{
// Convert figure to useable value
// i.e. find x where x = 300 - (3n^2 + 5)
numUses = 300 - uses;
numUses = (numUses-5)/3;
numUses = (numUses==0) ? 0 : int(Math.sqrt(numUses));

// Display usage information
gotoAndStop(5);
}
else gotoAndStop(2);

…and finally on frame 5:

// Display number of uses
usesTxt = numUses add " uses so far";
if(numUses>=9) usesTxt = "Demo expired";

// Path to flash2file.exe
appname = "c:/documents/flash/flash2file.exe";

// Path to the file to write to
path = "c:/documents/flash/config.dat";

// Update numUses
numUses++;
uses = 300 - ((numUses*numUses)*3 + 5);

// Text to write to file
txt = "uses=" add uses;

// Update number of uses to text file
argument = appname add "," add path add "," add txt;
fscommand("Launch", argument);

As you’ve probably guessed, I’ve got a textfield with a variable name of “usesTxt”, and not much else apart from the code. That’s it. Now you could either exit the app, or display a nag if numUses is >= your desired figure.

Now we are ready to copy it all to the phone in order to allow flash2file to do its job… So our directory structure that we will mirror on the phone is as such:

– 10daytrial.swf
– config.dat
– flash2file.exe

Finally, copy the SWF and config folder to the phone’s c:documentsflash folder, and test the SWF. Ideally you would package this up as a SIS installer and get it to install to a non-public folder to better hide your config file.

You can download the finished project here – I have not included flash2file.exe as Christian has requested that you contact him for the latest version.

Summary:

This method is inherently insecure. The reason for this is that we are using some incredibly weak protection, simply using ord() and chr() to mask the number of uses is not really acceptable, but even if you did take the time to port md5 to Flash Lite 1.1 the SWF is still accessible, decompilable and crackable. There is nothing we can do about this, it happens on the web all the time. On the web we like to let the server deal with the security. On a phone we can do the same, but that might annoy the end user, so instead we need to look forward to some DRM integration and standardisation across the handset manufacturers in order for Flash Lite to leverage this functionality. One plus point is that mobile content is dirt cheap, it has to be; and it is therefore not usually worth the time it takes to crack even the simplest form of protection we might employ. The ringtones and mobile downloads industry is still booming even though people are able to bluetooth items for free. 🙂

Note if you are using the Flash Lite 2.0 player:

If using the FL2.0 player you will need to change the paths to c:NokiaOthers or e:Others for the Flash Lite player to pick up your SWF and for the app to function correctly.

First Nokia with Flash Lite Pre-installed – a Mass Market Model!

Great news, Darren Osadchuk on the Flash Lite Yahoo Group spotted this press release today stating the brand new Nokia 6125 series 40 (i.e. cheaper/more accessible/mass market) phone comes pre-installed with the Flash Lite player.
It might sound like I…

Great news, Darren Osadchuk on the Flash Lite Yahoo Group spotted this press release today stating the brand new Nokia 6125 series 40 (i.e. cheaper/more accessible/mass market) phone comes pre-installed with the Flash Lite player.

It might sound like I’m making a big deal out of this but this is something us Flash Lite folk have been waiting for for months, not that the browser implementation on the Sony Ericsson walkman phones wasn’t good news, but hopefully this means we’ll see the standalone player out there.

Creating Trials for Flash Lite Apps

David Williams on the Flash Lite Yahoo Group asks, how do I make time limited trials in Flash Lite 1.1?

There are a few options to consider:
Time out after a few minutes each time.
Time out after X days and never run again.
Lose functionality af…

David Williams on the Flash Lite Yahoo Group asks, how do I make time limited trials in Flash Lite 1.1?

There are a few options to consider:

  • Time out after a few minutes each time.
  • Time out after X days and never run again.
  • Lose functionality after X days or weeks.

Unfortunately it is getting late and I have work to do, so I’ve only got time to cover the first in that list, but I’m still writing my book on Flash Lite which is due March, and that will have detailed instructions and samples for each – end plug.

So the code for the first example is very simple, and I’ve included an FLA which contains a movie clip in the library that you can simply drag into your game or app to make sure it exits 3 minutes after starting up.

First up, create a new Flash document using a mobile template, and create a new movie clip, called “TrialMaker”. Edit that movie clip and type the following code on frame 1:

timeout = 180;
startTime = getTimer();

Next up, create a keyframe on frame 10, and add the following:

if(getTimer()-startTime > timeout*1000) 
{
    fscommand("quit");
}
	
gotoAndPlay(2);

I chose frame 10, as this creates an automatic loop, a loop that doesn’t execute code all that often thus having a negligable impact on your game execution speed whilst remaining fairly accurate (which we all know is essential for Flash Lite games). You can modify the value of timeout to any number of seconds you wish, I chose 3 minutes at Davids request.

Download FLA.

If you are lucky enough to be using Flash Lite 2, you can simply add the following code to frame 1:

setInterval(function() { fscommand("quit"); }, 180000);

London MMUG – Tink and Aral on the Alphas

This month’s LMMUG will see Tink and Aral give an introduction to ActionScript 3, and an introduction to Flex 2. So if you’ve downloaded the alphas or not and want to get up to speed drop on by on the 19th.
See you there.

This month’s LMMUG will see Tink and Aral give an introduction to ActionScript 3, and an introduction to Flex 2. So if you’ve downloaded the alphas or not and want to get up to speed drop on by on the 19th.

See you there.

10 Symbian Developers Wanted

David Churchward is looking for 10 Symbian Engineers for a contract with Nokia Mobile Phones, 12 month contracts to start with scope for the projects to go on. The rate is around 40 GBP/hr and Nokia are based in Farnborough, Hampshire, UK.

If you get…

David Churchward is looking for 10 Symbian Engineers for a contract with Nokia Mobile Phones, 12 month contracts to start with scope for the projects to go on. The rate is around 40 GBP/hr and Nokia are based in Farnborough, Hampshire, UK.

If you get in touch with me through the contact details over on the right, I’ll pass you on to David directly.