×
Namespaces

Variants
Actions
Revision as of 02:51, 14 May 2013 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:How to make a basic key movement in Flash Lite

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

We do not recommend Flash Lite development on current Nokia devices, and all Flash Lite articles on this wiki have been archived. Flash Lite has been removed from all Nokia Asha and recent Series 40 devices and has limited support on Symbian. Specific information for Nokia Belle is available in Flash Lite on Nokia Browser for Symbian. Specific information for OLD Series 40 and Symbian devices is available in the Flash Lite Developers Library.

Article Metadata
Code Example
Source file: Media:Key nokia.zip
Article
Created: narender_raul (13 Feb 2008)
Last edited: hamishwillee (14 May 2013)

Flash Lite 1.1

Flash Cartesian Coordinate

First know that Flash Cartesian coordinate with four separate coordinate for each side. Basically Cartesian coordinate likes a flash root timeline. It will always start in the upper left hand corner on the root timeline. The top left corner in flash the X,Y coordinates is (0,0).

Flash coordinates represent position of WIDTH along the x axis and HEIGHT along the y axis


Flash coordinate represent positions of width along the X axis and Height along the Y axis.

Create a movie clip.

Draw 16X16 rectangle and make center align.

Make a Instance Name "Player".

Add key listener

on(KeyPress "<Left>"){
// Define _x axis movement.
/*The _x coordinate of a movie clip, relative to the local coordinates of the parent movie clip. Its coordinate system refers to the upper-left corner of the stage as (0,0).*/
//The width of the movie clip in pixels.
if(player. _x>(player._width/2)){
player. _x - =5;
}
}
 
on(keyPress "<Down>"){
if(player._x<(172-(player._width/2))){
player._x +=5;
}
}
 
on(keyPress "<Up>"){
// Define _y axis movement.
if(player._y>(3+(player._width/2))){
player._y -=5;
}
}
 
on(keyPress "<Down>"){
if(player._y<(203-(player._width/2))){
player._y +=5;
}
}

Download

you can download an example with source code here:

Basic key Movement

Narender Raul

This page was last modified on 14 May 2013, at 02:51.
106 page views in the last 30 days.
×