Create and use flashdll [translation]

Source: Internet
Author: User

Flashdll technology has been widely used since As2, because it is not only used in flex projects, but also in pure as projects, RSL can only be used in flex projects. The following briefly describes how to establish and use flashdll.

1. It is easy to create a flashdll DLL using the library file. Here we use aswing. SWC

(1) first, create a pure as project, for example, a project named aswingdll.

(2) The main document class can be empty, for example, class aswingdll extends sprite {// do nothing}

(3) Add a compilation parameter. Right-click the project and choose Properties -- ActionScript compiler -- Additional compiler arguments to enter the include-libraries path to the aswing. SWC, for example, enter-include-libraries E: \ worktools \ libs \ aswing-Src \ bin

(4)compile the project and output an aswingdll.swf File

2. Use flashdll

 

Code

      1 package {
2
3  import flash.display.Sprite;
4
5  import flash.events.Event;
6
7  import org.aswing.AsWingManager;
8
9 import org.aswing.JFrame;
10
11 import org.flashdll.DLLLoader;
12
13 import org.flashdll.DLLLoaderUI;
14
15 [SWF (width=800, height=600)]
16
17 public class FlashDLlTest extends Sprite {
18
19 public function FlashDLlTest() {
20
21 var loader:DLLLoader = new DLLLoader();
22
23 loader.addEventListener(DLLLoader.ALL_COMPLETED, this.init);
24
25 var ui:DLLLoaderUI = new DLLLoaderUI(this, loader);
26
27 loader.addDLL("http://www.flashdll.org/AsWingDLL_1_1_0.swf", "AsWing A3 1.0");
28
29 loader.notify();
30
31 }
32
33 protected function init(e:Event) :void {
34
35 AsWingManager.initAsStandard(this);
36
37 var frame:JFrame = new JFrame(this);
38
39 frame.setSizeWH(400, 300); frame.show();
40
41 }
42
43 }
44
45 }
46

 

 

During compilation, set the link type attribute of the External library file (aswing. SWC) to "external". At this time, we will find that the program is reduced from more than 100 K to 6 K.

Original http://www.aswing.org /? P = 214

Http://www.flashdll.org/

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.