Skip to main content

Posts

Showing posts from April, 2009

Toggling _focusrect

Rather than Flash lite 2.x, you can not modifications its _focusrect property. By default _focusrect be yellow box around.

You can toggle _focusrect by using
_focusrect = false;

Using the SetFocusRectColor command within your Flash Lite 2.x and 3 applications is easy, as there is a custom fscommand2.

fscommand2("SetFocusRectColor", 0, 0, 0);
Selection.setFocus(any_mc);

You need to set the color to replace 0,0,0.




Memory Limitation for Flash Lite Game

You may have flash lite application on your project which need to be so an adventure-like game. Ever wonder how many Megabytes are acceptable for Flash Lite applications?

A Flash Lite application should be in the kilobytes range not megabytes. Remember everything runs in memory. Test using Device Central and look at the memory consumption.`Usually is around 2MB for S60 phones.

On the phone you will get a prompt asking to access the network. Usually only once.
If you are not distributing your application to the public you really do not need to go through the Symbian singed process.


2 Way and 4 Way Navigation

Ever wondered why some flash lite application can use 2 way navigation, while other can use 4 way?

This not because if specific script to push some application only working in 2 or 4 way. That because you set it on different device. Some device, mostly japanese one, only support 2 way navigation. That's why you can not make 4 way navigation for their market.

You can have this device to test on 2 way navigation :

Fujitsu F700i, Fujitsu F700iS, Fujitsu F901iC, Fujitsu F901iS, and Mitsubishi D901i. Those are working for flash lite 1.x.

To check on your computer, you can open C:/Program Files/Macromedia/Samples and Tutorial/Samples/Flash Lite 2.0.

_focusrect in input text

Usually if we create flash lite application, we use input type to collect some data. It can any variable to send to database or any query to specific URL.

While you doing that, sometime you want to disable any focus rectangle (yellow box) on button. You can use this code that apply to button :

on (rollOver) {
_focusrect = true;
}

While you leave those button away from yellow box, you can enable each input type by adding code to first frame :

tex1._focusrect = true;

That if you already set input text name as text1.


Place Movie Clip On Specific Area

I have one movieclip or MC, and I want to have it on top of the page. Maybe it would be so easy to do so. You just make an movie clip in flash lite, and then put it whit align help panel to set it right in the center area.

Done.

But how if you dont know the size of mobile screen size. It has different size, from 240*320, 176*208, 352*416, and so on. First, you need to get information about size. You can use Stage.width; (get width) and Stage.height; (to get its height). So for example, you make stageWidth_txt text with variable name : stageWidth_txt. Then in first frame you type :

onEnterFrame = function()
{
stageWidth_txt.text = Stage.width;
}

Then it will tell the width of the screen size.

With this information, when you make a movie clip with name : box_mc, you can set it to get middle and top of screen with :

onEnterFrame = function()
{
setProperty( "box_mc", _y, 0 );
setProperty( "box_mc", _x, (Stage.width/2) );

}