Beautify winform with Flash

Source: Internet
Author: User

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.

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.