With flash beautify your winform (rpm)

We all know that beautiful page can not do without flash, which allows web shine. It can be applied to winform to flash it up?

The answer is yes, macromedia company is still very winform programmer for our sake.

Let's look at, to send commands if flash winform

Make a simple example

First, open the flash application (I use the Simplified Chinese Flash MX), create a new .fla .

Second, I will be a button, so to add a flash library that comes with buttons, windows -> Public Library -> button to select a favorite button, drag the flash scene, modify fla document size and button rather,

Third, this time right click button to select the pop-up menu in the "action", then you will see the flash of action (Action) panel,

Fourth, to find action -> Browser / Network -> fscommand fscommand is this command. Double click and enter a command and the "command" and the right of the "parameter" text box, respectively b.

Fifth, save the document and Export Movie button.swf

Simple flash is complete, do the following application (vs.net 2003 C #)

First start vs.net, create a C # application

Second, add a flash component in the toolbox, flash.ocx, it is a flash container, put it onto Form1 renamed FlashMain

Third, double-click Form1 add the following code

private void MainForm_Load(object sender, System.EventArgs e)

{

    FlashMain.LoadMovie (0, Application.StartupPath + "\\ button.swf"); // accordance with the storage location

}

To find an event FSCommand FlashMain, and add code

private void FlashMain_FSCommand(object sender, AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEvent e)

{

       MessageBox.Show(e.command.ToString()+"|"+e.args .ToString());

}

The final step is to run the program, click the button on the flash, ha ha, is not there a dialogue and show "a | b",

This shows that we have captured send a message to the flash, how to play his role Here's looking at you.

Reproduced in: https: //www.cnblogs.com/zhangchenliang/archive/2008/10/20/1315099.html

Guess you like

Origin blog.csdn.net/weixin_34174132/article/details/93495973
rpm