delphi能否利用flash activx控件调用flash中的函数

icerainhxj 2006-11-14 02:11:59
利用fscommand好像只能使delphi得到flash传出来的参数

那怎么样才能是delphi调用flash中的函数呢?并使flash调用delphi的函数。

谢谢大家。
...全文
354 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
老冯 2006-11-14
  • 打赏
  • 举报
回复
TShockWaveFlash完全类定义:
TShockwaveFlash = class(TOleControl)
private
FOnReadyStateChange: TShockwaveFlashOnReadyStateChange;
FOnProgress: TShockwaveFlashOnProgress;
FOnFSCommand: TShockwaveFlashFSCommand;
FOnFlashCall: TShockwaveFlashFlashCall;
FIntf: IShockwaveFlash;
function GetControlInterface: IShockwaveFlash;
protected
procedure CreateControl;
procedure InitControlData; override;
function Get_InlineData: IUnknown;
procedure Set_InlineData(const ppIUnknown: IUnknown);
public
procedure SetZoomRect(left: Integer; top: Integer; right: Integer; bottom: Integer);
procedure Zoom(factor: SYSINT);
procedure Pan(x: Integer; y: Integer; mode: SYSINT);
procedure Play;
procedure Stop;
procedure Back;
procedure Forward;
procedure Rewind;
procedure StopPlay;
procedure GotoFrame(FrameNum: Integer);
function CurrentFrame: Integer;
function IsPlaying: WordBool;
function PercentLoaded: Integer;
function FrameLoaded(FrameNum: Integer): WordBool;
function FlashVersion: Integer;
procedure LoadMovie(layer: SYSINT; const url: WideString);
procedure TGotoFrame(const target: WideString; FrameNum: Integer);
procedure TGotoLabel(const target: WideString; const label_: WideString);
function TCurrentFrame(const target: WideString): Integer;
function TCurrentLabel(const target: WideString): WideString;
procedure TPlay(const target: WideString);
procedure TStopPlay(const target: WideString);
procedure SetVariable(const name: WideString; const value: WideString);
function GetVariable(const name: WideString): WideString;
procedure TSetProperty(const target: WideString; property_: SYSINT; const value: WideString);
function TGetProperty(const target: WideString; property_: SYSINT): WideString;
procedure TCallFrame(const target: WideString; FrameNum: SYSINT);
procedure TCallLabel(const target: WideString; const label_: WideString);
procedure TSetPropertyNum(const target: WideString; property_: SYSINT; value: Double);
function TGetPropertyNum(const target: WideString; property_: SYSINT): Double;
function TGetPropertyAsNumber(const target: WideString; property_: SYSINT): Double;
procedure EnforceLocalSecurity;
function CallFunction(const request: WideString): WideString;
procedure SetReturnValue(const returnValue: WideString);
procedure DisableLocalSecurity;
property ControlInterface: IShockwaveFlash read GetControlInterface;
property DefaultInterface: IShockwaveFlash read GetControlInterface;
property ReadyState: Integer index -525 read GetIntegerProp;
property TotalFrames: Integer index 124 read GetIntegerProp;
property InlineData: IUnknown index 191 read GetIUnknownProp write SetIUnknownProp;
published
property Anchors;
property TabStop;
property Align;
property DragCursor;
property DragMode;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property Visible;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property Playing: WordBool index 125 read GetWordBoolProp write SetWordBoolProp stored False;
property Quality: Integer index 105 read GetIntegerProp write SetIntegerProp stored False;
property ScaleMode: Integer index 120 read GetIntegerProp write SetIntegerProp stored False;
property AlignMode: Integer index 121 read GetIntegerProp write SetIntegerProp stored False;
property BackgroundColor: Integer index 123 read GetIntegerProp write SetIntegerProp stored False;
property Loop: WordBool index 106 read GetWordBoolProp write SetWordBoolProp stored False;
property Movie: WideString index 102 read GetWideStringProp write SetWideStringProp stored False;
property FrameNum: Integer index 107 read GetIntegerProp write SetIntegerProp stored False;
property WMode: WideString index 133 read GetWideStringProp write SetWideStringProp stored False;
property SAlign: WideString index 134 read GetWideStringProp write SetWideStringProp stored False;
property Menu: WordBool index 135 read GetWordBoolProp write SetWordBoolProp stored False;
property Base: WideString index 136 read GetWideStringProp write SetWideStringProp stored False;
property Scale: WideString index 137 read GetWideStringProp write SetWideStringProp stored False;
property DeviceFont: WordBool index 138 read GetWordBoolProp write SetWordBoolProp stored False;
property EmbedMovie: WordBool index 139 read GetWordBoolProp write SetWordBoolProp stored False;
property BGColor: WideString index 140 read GetWideStringProp write SetWideStringProp stored False;
property Quality2: WideString index 141 read GetWideStringProp write SetWideStringProp stored False;
property SWRemote: WideString index 159 read GetWideStringProp write SetWideStringProp stored False;
property FlashVars: WideString index 170 read GetWideStringProp write SetWideStringProp stored False;
property AllowScriptAccess: WideString index 171 read GetWideStringProp write SetWideStringProp stored False;
property MovieData: WideString index 190 read GetWideStringProp write SetWideStringProp stored False;
property SeamlessTabbing: WordBool index 192 read GetWordBoolProp write SetWordBoolProp stored False;
property Profile: WordBool index 194 read GetWordBoolProp write SetWordBoolProp stored False;
property ProfileAddress: WideString index 195 read GetWideStringProp write SetWideStringProp stored False;
property ProfilePort: Integer index 196 read GetIntegerProp write SetIntegerProp stored False;
property AllowNetworking: WideString index 201 read GetWideStringProp write SetWideStringProp stored False;
property OnReadyStateChange: TShockwaveFlashOnReadyStateChange read FOnReadyStateChange write FOnReadyStateChange;
property OnProgress: TShockwaveFlashOnProgress read FOnProgress write FOnProgress;
property OnFSCommand: TShockwaveFlashFSCommand read FOnFSCommand write FOnFSCommand;
property OnFlashCall: TShockwaveFlashFlashCall read FOnFlashCall write FOnFlashCall;
end;
如果还有什么具体问题,你自己先写几段代码后再提出,一定耐心解答
天涯倦客 2006-11-14
  • 打赏
  • 举报
回复
http://www.delphibox.com/article.asp?articleid=1980
例子

In the flash movie you need to set up the action script, e.g. in response to a button click
on (release) {
fscommand("test", "");

}

In Delphi set the event handler for the Flashplayer
e.g.
procedure TForm1.FlashFSCommand(ASender: TObject; const command,
args: WideString);
begin
if command = 'test' then ;//do something here
end;
老冯 2006-11-14
  • 打赏
  • 举报
回复
先说说基本处理方式吧。
1、首先你要从OCX解析得到2个文件
ShockwaveFlashObjects_TLB.pas (类库)
ShockwaveFlashObjectsEvents.pas (事件组件)
2、安装事件组件到组件面板上,(通常是在Activex),
生成2个组件ShockwaveFlash和ShockwaveFlashEvents
3、对ShockwaveFlash编写代码调用FLASH的方法(函数和过程)
对ShockwaveFlashEvents编写事件代码让FLASH调用你自己写的Delphi函数或过程。
在相应事件触发时系统自然就会让FLASH去执行你的Delphi函数.

具体代码,等我忙完手上的事情就给你
icerainhxj 2006-11-14
  • 打赏
  • 举报
回复
谢谢啊 我QQ:18021894 可以的话在线指导下就行:)
老冯 2006-11-14
  • 打赏
  • 举报
回复
可以的。等会做个DEMO给你

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧