C # play a flash animation, that is, a swf File

Source: Internet
Author: User

1. Right-click the toolbox and select "select items." From the shortcut menu. In the displayed window, select the "COM Settings" tab,
Select Shockwave Flash Object, check it, and click "OK.
2. shockwave Flash Object appears in the toolbox. Drag it to the form to use it.
 

01 using System;
02 using System. Collections. Generic;
03 using System. ComponentModel;
04 using System. Data;
05 using System. Drawing;
06 using System. Text;
07 using System. Windows. Forms;
08 using System. IO;
09
10 namespace FlashDemo
11 {
12 public partial class Form1: Form
13 {
14 public Form1 ()
15 {
16 InitializeComponent ();
17}
18
19 private void Form1_Load (object sender, EventArgs e)
20 {
21 axShockwaveFlash1.Movie = Directory. GetCurrentDirectory () + "/demo2.swf"; // note that the full path must be used.
22}
23
24 private void button#click (object sender, EventArgs e)
25 {
26 axShockwaveFlash1.StopPlay ();
27}
28
29 private void button2_Click (object sender, EventArgs e)
30 {
31 axShockwaveFlash1.Play ();
32}
33}
34}

 
Author: Jungle listening rain

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.