Including the Shu Commands

Overview

To make use of the Shu commands in your AIR project, you will need to include the Shu.swc.
This process varies depending on what type of project you are creating.

Flex builder

  1. With a project selected in the Flex Navigator view, select
    Project > Properties > Flex Build Path.
  2. Select the Library tab.
    The core library (SWC) files, such as frameworks.swc and playerglobal.swc, appear.
  3. Select 'Add SWC' to add the Shu.swc.
  4. After adding, select the Shu.swc and double-click the Link Type option.
    The Library Path Items Options dialog box appears.
  5. Select the 'Merged into Code' option, and click OK.

Flex SDK comand-line compiler

Simply add:

  • -library-path+=path/to/Shu.swc

Flash CS3

  1. Place the Shu-cs3.swc in your Components folder. Eg:

    Windows:
    C:\Program Files\Adobe\Adobe Flash CS3\en\Configuration\Components
    Mac:
    /Application/Adobe Flash CS3/Configuration/Components
  2. Restart Flash.
  3. Drag the Shu component from the Components Panel onto the stage.
  4. You can then initialize and access Shu via:
    import com.cjt.shu.Shu; var shu = Shu.GetInstance();

HTML and JavaScript based AIR file

  1. Make a copy of the Shu.swc and rename it Shu.zip
  2. Extract the file library.swf from the zip and place it in a folder named lib.
  3. In your html code:
    <script src="lib/library.swf" type="application/x-shockwave-flash"></script>
  4. You can then initialize and access Shu via:
    var shu = runtime.com.cjt.shu.Shu.GetInstance();
  5. Make sure the lib directory and library.swf file are also included when the AIR file is created.