在 C# 中将在线 Flash 客户端加载到 windows 表单中
Loading online flash client into windows form in C#
我正在尝试使用 C# 和 COM shockwave flash 对象将 flash 游戏的游戏客户端加载到 windows 表单中。我设法让客户端加载到表单中,但尽管试图尽可能模仿提供给客户端的变量,但似乎客户端设置不正确。
例如flash客户端在网站上加载使用:
swfobject.embedSWF("flash/qplay.swf", "qplay", "760px", "592px", "11.0.0",false, {qplaycookie:"cookiehashgoeshere", gamefile:"qplay_era_20140214.png"}, {allowFullScreen:"true", allowFullScreenInteractive:"true", wmode:"direct", seamlesstabbing:"false", scale:"noscale",salign:"tl"},false);
我试图通过使用以下参数在 C# 中加载 flash 对象来反映这一点:
flashClient.EmbedMovie = true;
flashClient.SetVariable("qplaycookie", "cookiehashgoeshere");
flashClient.SetVariable("gamefile", "qplay_era_20140214.png");
flashClient.SeamlessTabbing = false;
flashClient.SAlign = "t1";
flashClient.AllowFullScreen = "true";
flashClient.AllowFullScreenInteractive = "true";
flashClient.WMode = "direct";
flashClient.LoadMovie(0, "http://era.graalonline.com/flash/qplay.swf");
flashClient.Play();
没有效果。电影加载到表单 flash 对象中,但在第一个加载屏幕上保持休眠状态,就好像它没有被赋予上述变量或以某种方式初始化。我已经仔细研究了客户端托管网站 (era.graalonline.com) 上的 javascript 库,但没有发现任何似乎与客户端交互的内容,可以向其提供任何信息之外的任何信息在 embedSWF 调用中引用。
我也曾尝试更改 gamefile 变量以获得游戏客户端所在网站的正确 URI 路径,但没有成功。
我很茫然。我做错了什么?
事实证明,正确答案是使用 FlashVars 行并远程加载游戏文件路径。很简单的错误。
flashClient.FlashVars = "cookiehashgoeshere&gamefile=http://era.graalonline.com/qplay_era_20140214.png";
希望这对其他涉足类似事物的人有用。
我正在尝试使用 C# 和 COM shockwave flash 对象将 flash 游戏的游戏客户端加载到 windows 表单中。我设法让客户端加载到表单中,但尽管试图尽可能模仿提供给客户端的变量,但似乎客户端设置不正确。
例如flash客户端在网站上加载使用:
swfobject.embedSWF("flash/qplay.swf", "qplay", "760px", "592px", "11.0.0",false, {qplaycookie:"cookiehashgoeshere", gamefile:"qplay_era_20140214.png"}, {allowFullScreen:"true", allowFullScreenInteractive:"true", wmode:"direct", seamlesstabbing:"false", scale:"noscale",salign:"tl"},false);
我试图通过使用以下参数在 C# 中加载 flash 对象来反映这一点:
flashClient.EmbedMovie = true;
flashClient.SetVariable("qplaycookie", "cookiehashgoeshere");
flashClient.SetVariable("gamefile", "qplay_era_20140214.png");
flashClient.SeamlessTabbing = false;
flashClient.SAlign = "t1";
flashClient.AllowFullScreen = "true";
flashClient.AllowFullScreenInteractive = "true";
flashClient.WMode = "direct";
flashClient.LoadMovie(0, "http://era.graalonline.com/flash/qplay.swf");
flashClient.Play();
没有效果。电影加载到表单 flash 对象中,但在第一个加载屏幕上保持休眠状态,就好像它没有被赋予上述变量或以某种方式初始化。我已经仔细研究了客户端托管网站 (era.graalonline.com) 上的 javascript 库,但没有发现任何似乎与客户端交互的内容,可以向其提供任何信息之外的任何信息在 embedSWF 调用中引用。
我也曾尝试更改 gamefile 变量以获得游戏客户端所在网站的正确 URI 路径,但没有成功。
我很茫然。我做错了什么?
事实证明,正确答案是使用 FlashVars 行并远程加载游戏文件路径。很简单的错误。
flashClient.FlashVars = "cookiehashgoeshere&gamefile=http://era.graalonline.com/qplay_era_20140214.png";
希望这对其他涉足类似事物的人有用。