CommonCtrl.FlashPlayerControl
flash player control: it can play swf or flv movie files.
Title |
flash player control: it can play swf or flv movie files. |
Author(s) |
LiXizhi |
Date |
2007/3/27 |
File |
script/ide/FlashPlayerControl.lua |
Description
Sample Code
NPL.load("(gl)script/ide/FlashPlayerControl.lua");
local ctl = CommonCtrl.FlashPlayerControl:new{
name = "FlashPlayerControl1",
FlashPlayerIndex = 0,
alignment = "_lt",
left=0, top=0,
width = 512,
height = 290,
parent = nil,
};
ctl:Show();
ctl:LoadMovie("d:/tennis.swf");
Member Functions
FlashPlayerControl:new
common control library
NPL.load("(gl)script/ide/common_control.lua");
define a new control in the common control libary
default member attributes
local FlashPlayerControl = {
-- the top level control name
name = "FlashPlayerControl1",
-- flash index
FlashPlayerIndex = -1,
background = "", -- current background, it can be a swf file or image file.
-- normal window size
alignment = "_lt",
left = 0,
top = 0,
width = 512,
height = 290,
parent = nil,
}
FlashPlayerControl =
FlashPlayerControl;
constructor
syntax
function FlashPlayerControl:new (o)
parameters
FlashPlayerControl:Destroy
Destroy the UI control
syntax
function FlashPlayerControl:Destroy ()
FlashPlayerControl:Show
- param bShow : boolean to show or hide. if nil, it will toggle current setting.
syntax
function FlashPlayerControl:Show(bShow)
parameters
bShow |
boolean to show or hide. if nil, it will toggle current setting. |
FlashPlayerControl.OnClose
close the given control
syntax
function FlashPlayerControl.OnClose(sCtrlName)
parameters
FlashPlayerControl.GetFlashCursorPosition
get the flash mouse cursor position by screen coordinate
- param UIObjectName : UI object name, such as a container object name
- param FlashPlayerIndex : usually 0
- param screen :_x, screen_y : usually mouse_x, mouse_y from the "onmouseup" event handler
syntax
function FlashPlayerControl.GetFlashCursorPosition(UIObjectName, FlashPlayerIndex, screen_x, screen_y)
parameters
UIObjectName |
UI object name, such as a container object name |
FlashPlayerIndex |
|
screen |
_x, screen_y : usually mouse_x, mouse_y from the "onmouseup" event handler |
x |
|
screen |
_x, screen_y : usually mouse_x, mouse_y from the "onmouseup" event handler |
y |
|
FlashPlayerControl.OnMouseClick
event handler
syntax
function FlashPlayerControl.OnMouseClick(sCtrlName)
parameters
FlashPlayerControl:LoadMovie
load a movie by name
syntax
function FlashPlayerControl:LoadMovie(sFileName)
parameters