Sunday, July 22, 2007

Without Good Title


I have read a little bit more my Flash Mobile book and I made my first application which is actually doing something.

Simple application that shows how screen reacts on keys. This is what I did. Make a movie clip with text field. Name movie clip "mctxt", name text field var "myinput". On root place next code:

fscommand2("FullScreen", true);
_root.mctxt.myinput="keys test";

Make button, put next code for button's actions:

on(keyPress "4")
{
_root.mctxt.myinput="4";
}
on(keyPress "6")
{
_root.mctxt.myinput="6";
}
on(keyPress "5")
{
_root.mctxt.myinput="by flanture";
}


That's it. I tested it and it works great. Don't forget to publish movie with flash lite 1.1 and don't forget (I did) to make text color different from background color. Text field must be dynamic. Also, movie size must correspond with your screen size.

This application is very simple, but it has some usefull elements like reaction on keys and displaying response. These element are basic for any game or serious application. Right.


AddThis Social Bookmark Button

Posted by flanture at 03:08:00 | Permanent Link | Comments (0) |
Comments
Write a comment