flash 的几个问题!!!急!帮者有分!!!!(50分)

H

hanliu

Unregistered / Unconfirmed
GUEST, unregistred user!
我是用的 ShockwaveFlash
我想在程序运行后动态生成的ShockwaveFlash能随鼠标拖动任意改变大小,
还有就是(ShockwaveFlash.dblclick)能有双击事件就好了,希望各位能提出
宝贵的意见,多谢!!!!!
 
看SWF SDK,重载它的双击事件函数
 
我是菜鸟啊,不知道怎么办,你能说清楚吗??[?][?]
 
谢谢,请看到的兄弟帮我顶一下!![:(][:(]我急啊!
 
回答第一个问题,新建一程序,程序目录下放一“1.swf”,然后放一Button和Flash控件
到窗体上,将swfPlay.Align设为alClient:

procedure TForm1.FormResize(Sender: TObject);
begin

btnExit.SetFocus;
swfPlay.SetFocus;
end;


procedure TForm1.FormCreate(Sender: TObject);
begin

swfPlay.Movie := ExtractFilePath(Application.ExeName) + '1.swf';
end;
 
我也想知道,幫你up.
 
你可以把ShockwaveFlash先放在一个panel上在改大小时先把焦点移到panel上就可以了我以前做过
 
我是想改变FLASH播放窗口的大小,由鼠标控制,FORM窗口不改变,行得通吗??
 
flash载入后如果改变大小,最好给flash组件发一个鼠标左键按下的消息,
否则显示会可能出现问题。
双击事件你应该在flash中做,在delphi判断fscommand来处理
 
to: yanyandt2
你能在代码上给我指导吗?你讲的我听不太懂,我感到有难度。
 
如果使用flash做部分界面,必须要判断一下机器里是否安装了flash的activex
var
TempFlash:TShockWaveFlash;
begin

try
TempFlash:=TShockWaveFlash.Create(application);
except
application.MessageBox('Install Flash ActiveX','',MB_OK);
winexec('./InstallFlash AX.exe',SW_SHOWNORMAL);
application.Terminate;
exit;
end;
//end of try
TempFlash.Free;
end;

//InstallFlash AX.exe 在 flash软件里带


根据flash的fscommand来执行相应的动作:
procedure Tform_main.flashFSCommand(Sender: TObject;
const command,
args: WideString);
begin

if( command='quit') then
close;
end;

//fscommand在制作flash时做好,由做的人自己起名字也可以


载入flash时会出现这样一个问题,如果窗体刚创建时不是最大化,那么在最
大化时flash的显示不会随着变大,尽管已经设置了alclient,但是用鼠标
点一下就可以了(不知道为什么),所以flash由小变大时,要发送一个鼠标
按下的消息,如 sendmessage(flash.handle,wm_lbuttondown,0,0);
 
改变大小,可以用splitter来实现。
 
你们都没有了解他要问的。
我知道,看代码,给分吧!
Procedure TForm1.FormResize(Sender:TObject);
//相应窗体的OnResize事件
begin

ActiveControl:=nil;
ActiveControl:=ShockwaveFlash1;
end;

{=============== www.delphicn.com ===================}
你试试吧.绝对可以改变flash控件的大小
 
to: antong
大哥,我是要在运行之后改变大小的,并不是在运行前啊!
哪位大哥有好的简单的方法啊!!
 
to 巴格达:交流一下,我的QQ:25950596
 
给你我的控件,要再处理一下不会是什么难事了吧

unit CoolFlash;

interface

uses
SysUtils, Messages, Classes, Controls, OleCtrls, ShockwaveFlashObjects_TLB,
Windows, Menus, Forms;

type
TCoolFlash = class (TShockwaveFlash)
private
FPlayerVersion: string;
FStrecth: Boolean;
function GetStrecth: Boolean;
function GetVersion: string;
procedure RButtonDown(var Msg: TWMRBUTTONDOWN);
message WM_RBUTTONDOWN;
procedure RButtonUp(var Msg: TWMRBUTTONUP);
message WM_RBUTTONUP;
procedure SetStrecth(AValue: Boolean);
procedure WhenKeyDown(var Msg: TWMKEYDOWN);
message WM_KEYDOWN;
procedure WhenKeyUp(var Msg: TWMKEYUP);
message WM_KEYUP;
procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd);
message WM_ERASEBKGND;
procedure WMReSize(var Msg: TWMSIZE);
message WM_SIZE;
public
constructor Create(AOwner: TComponent);
override;
procedure ShowAboutBox;
procedure Update;
override;
published
property Strecth: Boolean read GetStrecth write SetStrecth default True;
property Version: string read GetVersion;
property Movie stored True;
property Menu stored True;
end;


procedure Register;

implementation

procedure Register;
begin

RegisterComponents('PIHOME', [TCoolFlash]);
end;


{
********************************** TCoolFlash **********************************
}
constructor TCoolFlash.Create(AOwner: TComponent);
begin

inherited Create(AOwner);

FPlayerVersion:=InttoStr((FlashVersion shr 16) and $00FF);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr(FlashVersion shr 24);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr(FlashVersion and $000000FF);
FPlayerVersion:=FPlayerVersion+'.'+InttoStr((FlashVersion shr 8) and $0000FF);

FStrecth:=True;
end;


function TCoolFlash.GetStrecth: Boolean;
begin

Result:=FStrecth;
end;


function TCoolFlash.GetVersion: string;
begin

Result:=FPlayerVersion;
end;


procedure TCoolFlash.RButtonDown(var Msg: TWMRBUTTONDOWN);
begin

Msg.Result:=1;
end;


procedure TCoolFlash.RButtonUp(var Msg: TWMRBUTTONUP);
begin

Msg.Result:=1;

if Menu and Assigned(PopupMenu) then

with Mouse.CursorPosdo

PopupMenu.Popup(X,Y);
end;


procedure TCoolFlash.SetStrecth(AValue: Boolean);
begin

FStrecth:=AValue;
end;


procedure TCoolFlash.ShowAboutBox;
begin

MessageBox(Application.Handle,PChar('CoolFlash Ver 1.0'#13'程序设计: PIHOME'
+#13#13'基于 MacroMedia Flash ActiveX 控件 '#13'版本: '+Version
+#13'Macromedia Inc.'+#13'http://www.macromedia.com'),'关于...',
mb_OK+MB_ICONINFORMATION+MB_SYSTEMMODAL);
end;


procedure TCoolFlash.Update;
begin

inherited;

if Visible and (not (csDesigning in ComponentState)) then

do
ObjectVerb(-1);
end;


procedure TCoolFlash.WhenKeyDown(var Msg: TWMKEYDOWN);
begin

Msg.Result:=1;
end;


procedure TCoolFlash.WhenKeyUp(var Msg: TWMKEYUP);
begin

if Msg.CharCode<>vk_RButton then

Exit;

Msg.Result:=1;
if Menu and Assigned(PopupMenu) then

with Mouse.CursorPosdo

PopupMenu.Popup(X,Y);
end;


procedure TCoolFlash.WMEraseBkgnd(var Msg: TWMEraseBkgnd);
begin

Msg.Result:=1;
end;


procedure TCoolFlash.WMReSize(var Msg: TWMSIZE);
begin

if Visible and FStrecth and (not (csDesigning in ComponentState)) then

do
ObjectVerb(-1);
end;


end.
 
顶部