X
xgqing
Unregistered / Unconfirmed
GUEST, unregistred user!
在Form上放一个StockwaveFlash,Popupmenu,mainmenu,Applicationevent,
Opendialogfile,写了一个简单的Flash播放程序。
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_RBUTTONDOWN) and (msg.hwnd =flashcontrol.handle) then
begin
popupmenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
Handled := True;
end;
end;
procedure TForm1.PpexitClick(Sender: TObject);
begin
Flashcontrol.FreeOnRelease;
Close;
end;
procedure TForm1.PpopenClick(Sender: TObject);
begin
if OpenDialogFlash.Execute then
begin
flashcontrol.Stop;
flashcontrol.FreeOnRelease;
Flashcontrol.Movie := OpenDialogFlash.Filename;
try
Flashcontrol.Play;
except
showmessage('error');
end;
end;
end;
procedure TForm1.PpfullClick(Sender: TObject);
begin
Menu := nil;
Borderstyle := bsNone;
WindowState := wsMaximized;
flashcontrol.Refresh;
end;
procedure TForm1.PpNormalClick(Sender: TObject);
begin
Menu := MmFlash;
Borderstyle := bsSingle;
WindowState := wsNormal;
end;
procedure TForm1.PpStopClick(Sender: TObject);
begin
FlashControl.Stop;
end;
procedure TForm1.PpPlayClick(Sender: TObject);
begin
FlashControl.Play;
end;
end.
问题列表:
1.播放一个Flash文件。第一次点击PpFull(全屏),窗口全屏,担是播放的Flash文件却没有全屏,只有左上角一块。点击PpNormal(正常),再点击PpFull(全屏),就行了。这是什么原因,怎么解决。
2.点击PpFull(全屏)后,再点击PpNormal(正常),恢复不到窗口的原始大小,不知这是为何。
3.有没有办法这么个事件:
点击Flash控件区域A(10,50),(20,90)触发事件A
点击Flash控件区域B(100,150),(110,150),触发事件B
能做到吗?提供点思路。有原码最好,非常感谢。
Opendialogfile,写了一个简单的Flash播放程序。
procedure TForm1.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
begin
if (Msg.message = WM_RBUTTONDOWN) and (msg.hwnd =flashcontrol.handle) then
begin
popupmenu1.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
Handled := True;
end;
end;
procedure TForm1.PpexitClick(Sender: TObject);
begin
Flashcontrol.FreeOnRelease;
Close;
end;
procedure TForm1.PpopenClick(Sender: TObject);
begin
if OpenDialogFlash.Execute then
begin
flashcontrol.Stop;
flashcontrol.FreeOnRelease;
Flashcontrol.Movie := OpenDialogFlash.Filename;
try
Flashcontrol.Play;
except
showmessage('error');
end;
end;
end;
procedure TForm1.PpfullClick(Sender: TObject);
begin
Menu := nil;
Borderstyle := bsNone;
WindowState := wsMaximized;
flashcontrol.Refresh;
end;
procedure TForm1.PpNormalClick(Sender: TObject);
begin
Menu := MmFlash;
Borderstyle := bsSingle;
WindowState := wsNormal;
end;
procedure TForm1.PpStopClick(Sender: TObject);
begin
FlashControl.Stop;
end;
procedure TForm1.PpPlayClick(Sender: TObject);
begin
FlashControl.Play;
end;
end.
问题列表:
1.播放一个Flash文件。第一次点击PpFull(全屏),窗口全屏,担是播放的Flash文件却没有全屏,只有左上角一块。点击PpNormal(正常),再点击PpFull(全屏),就行了。这是什么原因,怎么解决。
2.点击PpFull(全屏)后,再点击PpNormal(正常),恢复不到窗口的原始大小,不知这是为何。
3.有没有办法这么个事件:
点击Flash控件区域A(10,50),(20,90)触发事件A
点击Flash控件区域B(100,150),(110,150),触发事件B
能做到吗?提供点思路。有原码最好,非常感谢。