How to specify swc when building swf?

I have implemented some utility classes in Flex that I want to use in several AIR projects. I created swc that contains these classes. I am working on a Linux machine and do not have FlashBuilder. Therefore, I use compc and mxmlc command line SDK tools. My problem is that I could not find a way to tell swc when creating a stand-alone project. In the book the following command has been proposed: mxmlc -load-config /opt/flex/4.1.0/frameworks/air-config.xml -library-path=/path/to/utility.swc hello.mxml. However, using this, I get an error hello.mxml: Error: Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'hello'. Everything works fine if I move all the code from swc to one monolithic project. Can anyone help me here? Code for stand-alone project:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" windowComplete="completeHandler();">
<mx:Script>
<![CDATA[
import com.example.Ext;
private function completeHandler():void
{
    var e: Ext = new Ext();
    e.hi();
}
]]>
</mx:Script>
<mx:Label text="Hello World" />
</mx:WindowedApplication>

The type Ext is contained in the .swc utility.

UPDATE: . mxmlc -load-config /opt/flex/4.1.0/frameworks/air-config.xml -library-path+=/path/to/utility.swc hello.mxml. swc . . hello.mxml(10): Error: Type was not found or was not a compile-time constant: Ext. .swc:

package com.example {
    public class Ext {
        public function Ext {
            // do something
        }   
        public function foo( ): void {
            return;
        }   
    }   
}
+3
1

-library-path+=/path/to/my.swc. = +=, .

+1

Source: https://habr.com/ru/post/1753541/


All Articles