===========(Delphi与Flash 参数消息传递)============
第一步(flash中Button添加script):
on (release) {
var userCode = editCode.text
var userName = editName.text;
fscommand("btSubmit", userCode+","+userName); //这样传入args
}
第二步(Delphi中TShockwaveFlash.FSCommand事件)
procedure TForm1.Flash1FSCommand(ASender: TObject; const command,
args: WideString);
function splitFSCmdArgs(args:wideString;var usrCode,usrName:string):boolean;
var i:integer;str:wideString;
begin
try
result:=true;
str:=args;
usrCode := ''; usrName := '';
i:=Pos(',',str);
if i<=0 then exit;
usrCode := copy(str,1,i-1);
Delete(str,1,i);
usrName := str;
except
result:=false;
end;
end;
var deptID,usrCode,psw,s:string ;
begin
if Command='btSubmit' then begin
splitFSCmdArgs(args,usrCode,usrName); //分割编号和名称
showMessage('人员编号:'+usrCode+#13#10+
'人员名称:'+usrName) ;;
end;
end;
===========(屏蔽或自定义右键菜单)============
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
var
mPoint : TPoint;
begin
//if IsChild(Flash1.Handle, Msg.Hwnd) then
if ((Msg.Message = WM_RBUTTONDOWN) or (Msg.Message = WM_RBUTTONUP)) then
begin
GetCursorPos(mPoint);
//如果去掉下面这行就是屏蔽右键菜单,不去掉为自定义右键菜单
PopupMenu1.Popup(mPoint.X, mPoint.Y);
Handled:=True;
end;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
Application.OnMessage := ApplicationEvents1Message; //屏蔽Flash右键菜单,或弹出自定义右键菜单
end;
===========(背景透明)============
wmode参数值为transparent

浙公网安备 33010602011771号