Flash & Mobile Devices

July 14th, 2008

tp://www.adobe.com/devnet/devices/articles/ten_tips_flash_lite_games.html

In the code example below, the _y property of the duplicated movie clip is extracting hard-coded values from an array. In contrast, the _x property is determined programmatically, by first calculating the width of the stage, and then placing the duplicate movie clips based on the resulting values of the calculation.

var clipNum = 3
var xLocate = Stage.width/ (clipNum+1);
var yArray = new Array (30,40,50);
for(x=1; x<=clipNum; x++){
var tempMc = attachMovie("block",
"block"+x, x);
with (tempMc) {
_x = xLocate*x;
_y = yArray[x-1];
}
}

http://www.adobe.com/devnet/devices/articles/flash_projects.html

People will access your project on different mediums and devices. They may even use a stylus or their finger to press buttons. Users will expect standard key presses will be used and followed. (Become familiar with common mobile device conventions.)

The options for functionality should be flexible and not device dependent. The general practice of keeping the functionality of your project separate from the events that trigger it will allow more compatibility and possibility of your project to operate on many different devices.

As you begin your project you should with a commonly used screen size (176×208 or even 240×320 pixels). These will allow you to port your game to devices much easier.

Your project files should be able to meet the needs of different displays. Perhaps allowing for resizing or rescaling the graphics and text will allow for greater display needs. Think about text size and legibility as well as graphics and bitmaps.

http://www.adobe.com/devnet/devices/articles/total_training_key_press_events.html

It’s important for the user to interact with the device and the application. You will use a broadcaster-listener model and handler method to allow the application to respond when the user has interacted with the device.

http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002449.html

http://www.adobe.com/devnet/flash/articles/actionscript_guide_06.html

Use of variables should be utilized to help keep your code flexible. All of us have coded for “hitTest” functions now. Considering mobile devices, The method below is easy on the mobile processor and uses the objects x and y values as well as the objects dimensions.

var obj = new Object (x1, y1, w1, h1, x2, y2, w2, h2);
if((obj.x1 >= obj.x2) && (obj.x1+obj.w1 <=
obj.x2+obj.w2) && (obj.y1 >= obj.y2) && (obj.y1+obj.h1 <=
obj.y2+obj.h2)){
collision = true;
}else{
collision = false;
}

This code checks the relationship of obj.x1’s left edge in relation to obj.x2’s left edge. Next it evaluates the right edge, top edge and finally the bottom edge of both.

Entry Filed under: AS2, AS3, All, Flash, actionScript, mobile

Leave a Comment

You must be logged in to post a comment.

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

July 2008
M T W T F S S
« Jun   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts