Join Now
Quality Rating:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)
Expertise Level:
  • Currently 0.0 / 5
(0.0 / 5 - 0 votes cast)

This page was last modified 09:53, 6 June 2008.

Flash Liteにおける基本的なキー移動機構を作成する方法

From Forum Nokia Wiki


原文(英語): How to make a basic key movement in Flashlite

Flash Lite 1.1

Flashの座標系

最初に、Flashが、各サイドに4座標を持つ座標系を持つことを知る必要があります。 基本的に、座標系はFlashのルート時間軸のようなもので、常にルート時間軸上の左上角から開始します。FlashにおけるXY軸の左上角は(0,0)です。

Flash座標系は、X軸に沿った幅(WIDTH)を、Y軸に沿った高さ(HEIGHT)を表します。
Flash座標系は、X軸に沿った幅(WIDTH)を、Y軸に沿った高さ(HEIGHT)を表します。

Flash座標では、X軸に沿った幅とY軸に沿った高さを表します。

ここで、ムービークリップを作成します。

16X16の四角形を描画し、それを中心に配置します。

インスタンス名は"Player"とします。

キーリスナーを追加する

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;
    }
}

ダウンロード

例題コードは、下記サイトからダウンロードできます。

基本的なキーによる移動

Related Discussions
Thread Thread Starter Forum Replies Last Post
Mp3 in Flash Lite programs micke1977 Flash Lite on Nokia Devices 1 2008-04-18 19:42
Custom Video Player in flash Melmoth Flash Lite on Nokia Devices 3 2008-09-02 10:46
Preinstalled Flash Lite support in Nseries phones (N70, N90)? Kipt General Discussion 3 2006-02-08 19:09
Flash Lite APIs sticklebrick Mobile Java General 4 2006-05-25 21:11
New innovation fxtycoon General Discussion 0 2006-01-30 11:36
 
Powered by MediaWiki
     
     RDF Facets:
     
     
     qfnZtypeQUqfnTypeZCommunityContentQ
     qfnZtypeQUqfnTypeZWebpageQ
     qfnZtypeQUqfnTypeZWikiContentQ
     qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX