We all know that a beautiful web page is inseparable from flash, which makes the web page shine. So can we apply Flash to winform?
The answer is yes. Macromedia is very considerate for our winform programmers.
Let's take a look. If Flash is used to send commands to winform
Create a simple example
First open the FLASH application (I use the simplified Chinese Flash MX) and create a new one. Fla.
2. I want to create a button, so add a button that comes with the flash library, window-> Public Library-> button, select a favorite button, and drag it to the Flash scenario, the size of the modified FLA document is the same as that of the button,
3. Right-click the button and select "action" in the pop-up menu. The action panel of Flash is displayed,
4. Find the action-> Browser/network-> fscommand. This is the fscommand command. Double-click this command and enter A and B in the "command" and "parameter" text boxes on the right.
Wujia Save the document and export the album button.swf
Simple flash, the following is an application (vs.net 2003 C #)
Start vs.net and create a C # application.
2. Add a flash component in the toolbox, Flash. ocx, which is a flash container. Drag it to form1 and rename it flashmain.
3. Double-click form1 and add the following code:
Private void mainform_load (Object sender, system. eventargs E)
{
Flashmain. loadmovie (0, application. startuppath + "// button.swf"); // depending on the storage location
}
Find the flashmain event fscommand and add the code
Private void flashmain_fscommand (Object sender, axshockwaveflashobjects. _ ishockwaveflashevents_fscommandevent E)
{
MessageBox. Show (E. Command. tostring () + "|" + E. args. tostring ());
}
Finally, the program is run. click the button on flash. Haha, is there a dialog and "A | B" displayed ",
This shows that we have captured the information sent from flash. It depends on how you play this role.