Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows Forms
  4. Running SWF file from Windows Forms

Running SWF file from Windows Forms

Scheduled Pinned Locked Moved Windows Forms
databasewinformsquestion
6 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pix_programmer
    wrote on last edited by
    #1

    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?

    D 1 Reply Last reply
    0
    • P pix_programmer

      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?

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      P 1 Reply Last reply
      0
      • D 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 Kreskowiak

        P Offline
        P Offline
        pix_programmer
        wrote on last edited by
        #3

        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?

        D 1 Reply Last reply
        0
        • P pix_programmer

          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?

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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

          P 1 Reply Last reply
          0
          • D 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 Kreskowiak

            P Offline
            P Offline
            pix_programmer
            wrote on last edited by
            #5

            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?

            D 1 Reply Last reply
            0
            • P pix_programmer

              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?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Nope, you've already done it all.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups