Showing posts with label flash lite. Show all posts
Showing posts with label flash lite. Show all posts

Friday, 5 March 2010

Flash Lite Language

So far in my studies, I have learnt to write in numerous programming languages, such as: Turbo Pascal, Visual Basic, C++ and even Java. The problem was, when I start learning the language I could eventually write it and speak it fluently as if it were my second language. But once I stopped practicing it, I ended up forgetting how to even define the simplest of things like variables.


So looking at the language for Flash Lite brought back some memories, but I already knew that some of the designs which I might want to develop will not come to fruition due to my lack of knowledge (and to some extent, motivation).


So today we had some basic code broken down to us. I found quite thorny to wade my way through all the lines, I figured out what the line was doing more or less, I just couldn’t understand the lingo. I eventually managed to work through the code to understand its core task, all it was simply doing was listening out for any key presses and then taking the user back/forth to the next screen.




// set up


fscommand2("FullScreen", "true");

status = fscommand2("SetSoftKeys", "left", "right");


doStart();


// trap key presses


var globalKeyListener:Object = new Object();


globalKeyListener.onKeyDown = trapKeyDown;


function trapKeyDown():Void {

var keyCode = Key.getCode();

var theFrame = _currentFrame;

trace(keyCode +" / "+theFrame);

switch (keyCode) {

case ExtendedKey.SOFT1 :

switch (theFrame) {

case 2 :

doGame();

break;

case 3 :

doStart();

break;

case 4 :

doStart();

break;

case 5 :

doStart();

}

break;

case ExtendedKey.SOFT2 :

switch (theFrame) {

case 2 :

doExit();

break;

case 3 :

doExit();

break;

case 4 :

doBye();

break;

}

}

}

Key.addListener(globalKeyListener);

function doStart():Void {

gotoAndStop("start");

trace("doStart");

}

function doGame():Void {

gotoAndStop("game");

trace("doGame");

}

function doExit():Void {

gotoAndStop("exit");

trace("doExit");

}

function doBye():Void {

gotoAndStop("bye");

trace ("doBye");

}




My test screens using the code above

I think over the next few days I will concentrate on deciphering the above piece of code till I become a little bit more familiar with the lingo.

Sunday, 28 February 2010

Workflow with Flash Lite and Device Central

When working with Flash Lite and Device Central, to simplify things a certain workflow method is recommended to be picked up. For example, begin in Device Central (decide your platform, etc) > Move over to Flash and start building it up > Package it to .SIS > then distribute.


Note: Packaging is a term used in mobile development to describe the process of gathering and compressing numerous files together in to a single file with a specific format that’s then interpreted by a device. Once placed within the device the package can then be launched or installed. Within the mobile platform category there are several types of packaging formats, such as:


Symbian – .SIS

Windows Mobile – .CAB

Java Applications – .JAR

Nokia Series 40 – .NFL


When creating Flash Lite content, the process will become very iterative as there will need to be constant switching back and forth between Flash and Device Central. Here’s a detailed overview of how I would recommend a simple and logical workflow.


Identify your target device and Flash Lite content type: Obviously different devices have different screen sizes, support specific types of video/audio formats and have different colour screen depths, among many other factors. These factors may well influence your applications design and implementation.


In addition to this, different devices support different Flash Lite content types (e.g. screen savers, video ring tones). The type of content which you are also developing for will also determine what type of features will be available to implement within your application.


Create the application in Flash and run a simulation in Device Central. Device Central CS3 includes an emulator which allows you to transfer your Flash application to it and emulate it as if it were on a phone, without having to actually transfer it to a phone. This allows you to quickly refine your application and correct and errors before transferring it to a mobile phone.


Test the application on your target device(s). This is an important step as you cannot solely rely on the Device Central. The Device Central won’t emulate every aspect of your device; this includes your processor speed and even the colour depth. For example, an animation that simulates smoothly on Device Central may not run as smooth on your mobile device due to its lower processing power, or a gradient that appears smooth on Device Central may appear banded on your device due to the colour bit depth. After testing the application on an actual device, you may find that some further refinements are required to the design.



The recommended work flow procedure