Thread: Playing Flash in C#

  1. #1
    Registered User
    Join Date
    Nov 2004
    Posts
    18

    Playing Flash in C#

    Hi,

    I'm developing a program which will use Flash Movies (.swf) to display a character on the screen. I've heard that the ActiveX controls in C# make this easy to do, and I have Visual Studio .NET, but I can't seem to get the Flash movie to load and play.

    Can anyone help me out with this? I think it may be something to do with the properties of the Flash object, as I'm not sure what they should be.

    I'm using the lines
    Code:
    String swfPath = "C:/flash.swf";
    flashObject.LoadMovie(0, swfPath);
    to load the .swf file, but it doesn't seem to be working, as when I run the compiled file and right click where the movie should be, there is a menu which has "movie not loaded..." at the top.

    Suggestions?

    Richard.

  2. #2
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    the flash animation must be created with mix-FX

    then you can follow these steps:
    1. You need to include the Flash component in your project. In VB6 you would just navigate to Project|Components|Browse, and then select Flash.ocx
    2. Now you can create a ShockwaveFlash control on your form
    3. You should tell the Flash component to load and play an SWF file by setting the Movie property
    4. The player will raise FSCommand events (named ShockwaveFlash1_FSCommand in VB6 if your control was named ShockwaveFlash1)
    5. The command string indicates with button was pressed. The command will look like "on_releaseb1_1", where the 2 numbers separated by the underscore indicates the row and column of the button that was pressed
    6. If you distribute your application, make sure you distribute Flash.ocx as well and run regsvr32 to register the component

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  3. #3
    Registered User
    Join Date
    Nov 2004
    Posts
    18
    I have seen that before, when I Googled for information... However I don't think it's very helpful!

    the step :
    3. You should tell the Flash component to load and play an SWF file by setting the Movie property
    is incredibly vague!

    Setting the Movie property to what?! And also that's more aimed at adding Flash to VB rather than C#.

    And I'm also getting conflicting advice as to whether to add a Shockwave Flash Object or a control... at one stage I thought I would need to add both, but nowhere have I seen this mentioned.

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    4

    Playing Flash in C#

    This link should help provide you a better idea of how to do it.

    http://www.macromedia.com/devnet/mx/...history03.html

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Playing Flash files(swf) in Win32 window
    By maxorator in forum Windows Programming
    Replies: 16
    Last Post: 11-29-2005, 11:00 PM
  2. which flash product?
    By iain in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 03-21-2005, 01:55 PM
  3. playing flash or putting in Internet Explorer
    By AtomRiot in forum Windows Programming
    Replies: 3
    Last Post: 02-13-2003, 01:04 PM
  4. Flash Flash Revolution
    By Esparno in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 12-09-2002, 12:43 PM
  5. Flash <--> c++
    By c-- in forum C++ Programming
    Replies: 7
    Last Post: 09-13-2002, 11:26 PM