---++!! !CommonCtrl.FlashPlayerControl %TOC{title="Contents:"}% %STARTINCLUDE% ---++ 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 %T% __Sample Code__ <verbatim> 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"); </verbatim> ---+++ Member Functions ---++++ !FlashPlayerControl:new <verbatim> 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, }</verbatim> CommonCtrl.FlashPlayerControl = FlashPlayerControl; constructor __syntax__ <verbatim>function FlashPlayerControl:new (o)</verbatim> __parameters__ | *o* | | ---++++ !FlashPlayerControl:Destroy Destroy the UI control __syntax__ <verbatim>function FlashPlayerControl:Destroy ()</verbatim> ---++++ !FlashPlayerControl:Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. __syntax__ <verbatim>function FlashPlayerControl:Show(bShow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | ---++++ !FlashPlayerControl.OnClose close the given control __syntax__ <verbatim>function FlashPlayerControl.OnClose(sCtrlName)</verbatim> __parameters__ | *sCtrlName* | | ---++++ !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__ <verbatim>function FlashPlayerControl.GetFlashCursorPosition(UIObjectName, FlashPlayerIndex, screen_x, screen_y)</verbatim> __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__ <verbatim>function FlashPlayerControl.OnMouseClick(sCtrlName)</verbatim> __parameters__ | *sCtrlName* | | ---++++ !FlashPlayerControl:LoadMovie load a movie by name __syntax__ <verbatim>function FlashPlayerControl:LoadMovie(sFileName)</verbatim> __parameters__ | *sFileName* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback