SWF Scout |
Tutorial: making an Flash Lite SWF animation with objects responding when user press Enter key on his mobile device SWF Scout -is capable of generating Flash Lite and i-mode compatible flash animations. This includes ActionScript support. This example will show how to generate Flash Lite compatible flash animation file where sprite object responds to <Enter> key press on a mobile device (or when user press joystik). Another supported keys in SWF Scout Actionscript compiler are:
<Enter>, <Up>, <Down>, <Left>, <Right>,
<PageUp>, Download source code of this example: swfscout_flash_lite_move_button_on_key_press.zip (2KB) A screenshot of the resulted SWF movie (in i-mode simulator):
Resulted flash movie (Btn_KeyPress_AS_SCRIPT_Compile.swf)
Source code: ' //////////////////////////////////////////////// W = 320 Movie.BeginMovie 0,0,W,H,1,12,101 ' 101 - is a Flash Lite compatible file format Font = Movie.AddFont( "Arial",12,true,false,false,false,0) Text = Movie.AddText("Press Enter key to move a ball",0,0,0,255,Font,
0, 80, 170, 160) Shape = Movie.AddShape Shape2= Movie.AddShape sCode = "on(keyPress '<Enter>'){if(_root._x>200){_root._x -= 1;}else{_root._x+=1;}}" Movie.BUTTON_CompileEvent sCode Movie.PlaceButton Button,Movie.CurrentMaxDepth Movie.ShowFrame 1 Movie.SaveToFile "Btn_KeyPress_AS_SCRIPT_Compile.swf" Download source code of this example: swfscout_flash_lite_move_button_on_key_press.zip (2KB) |
|
|
||