Running SWF file from Windows Forms
-
Hi! I've added an ShockwaveFlashObject inside my Windows Form. I've used the following code to run an SWF file:
this->axShockwaveFlash1->BringToFront(); this->axShockwaveFlash1->Movie::set(gcnew System::String(StringToWString(spath).c\_str())); //this->axShockwaveFlash1->CallFunction("<invoke" + "name=\\"UserInformation\\"returntype=\\"void\\"></invoke>"); //this->axShockwaveFlash1->SetVariable("file", "index.swf"); this->axShockwaveFlash1->Play();
This code is inside the form load event. But when I run the application, the movie is not playing. What to do to run the swf file from Windows forms?
-
Hi! I've added an ShockwaveFlashObject inside my Windows Form. I've used the following code to run an SWF file:
this->axShockwaveFlash1->BringToFront(); this->axShockwaveFlash1->Movie::set(gcnew System::String(StringToWString(spath).c\_str())); //this->axShockwaveFlash1->CallFunction("<invoke" + "name=\\"UserInformation\\"returntype=\\"void\\"></invoke>"); //this->axShockwaveFlash1->SetVariable("file", "index.swf"); this->axShockwaveFlash1->Play();
This code is inside the form load event. But when I run the application, the movie is not playing. What to do to run the swf file from Windows forms?
I would suspect it doesn't play because the form hasn't been shown yet and may not have a window handle. Put a button on the form and move the play code to the Click event of that button. Try that and see what happens.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
I would suspect it doesn't play because the form hasn't been shown yet and may not have a window handle. Put a button on the form and move the play code to the Click event of that button. Try that and see what happens.
A guide to posting questions on CodeProject[^]
Dave KreskowiakNow also the same thing. What to do to run the SWF file? I've also added a split container to the form. Is that may be cause for this problem?
-
Now also the same thing. What to do to run the SWF file? I've also added a split container to the form. Is that may be cause for this problem?
Not unless you put the player behind the panels of the player instead of IN one of the panels.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Not unless you put the player behind the panels of the player instead of IN one of the panels.
A guide to posting questions on CodeProject[^]
Dave KreskowiakHi! Can you tell me if any thing else has to be done in the coding part to run a SWF file from windows forms?
-
Hi! Can you tell me if any thing else has to be done in the coding part to run a SWF file from windows forms?
Nope, you've already done it all.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak