0

I have an HTML page that contains the flash game Club Penguin. I'm trying to make a Desktop client for my website that allows the user to get and set flash variables. How can I access the Flash COM Object using a WebBrowser Control?

Here's what I have tried so far:

object o = webBrowser1.Document.InvokeScript("return document['cp_flash']");
ShockwaveFlash flash = (ShockwaveFlash)o;
Console.WriteLine(flash.FlashVars);

I expected to get FlashVars logged to the console, but instead got a NullReferenceException on line 3.

What am I doing wrong? Is this even possible in 2019?

Hawkeye111
  • 37
  • 1
  • 8
  • **(1)** Does this _"my website"_ have a link (for our testing)? Share it... **(2)** Show minimum code that recreates your problem and can be put in C# compiler to test and suggest a solution... **(3)** I don't know Club Penguin (am too old for games) so you tell me, does it work if you skip browser component and just directly load the Flash app (a `.swf` file) using `axShockwaveFlash` component? – VC.One Feb 04 '19 at 16:18
  • @VC.One I am not allowed to share the link. The website is very similar to https://old.cponline.pw/ It works fine if you skip browser component, but we want the user to be able to see and interact with our website. – Hawkeye111 Feb 06 '19 at 08:24
  • 1
    @Hawkeye111 any update about that? I am facing the same problem – Michael280 Oct 30 '20 at 18:32
  • @Michael280 Nope, didn't work. Flash is shutting down anyway. – Hawkeye111 Nov 07 '20 at 22:39

0 Answers0