Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resolving Component libs with Flex SDK mxmlc

I'm new to Flex SDK and trying to implement a simple project using Doug Mccune's CoverFlow widget. Most of the documentation out there on how to do this assumes that one is using Adobe's FlexBuilder product, which is a $250 Eclipse plug-in that I'd rather avoid buying. The problem I'm having is simply getting Doug's swc file, which is the binary version of his component lib, to be recognized by mxmlc, the Flex SDK project compiler. I keep getting error messages such as

Error: Could not resolve to a component installation

and

Error: Type was not found or was not a compile-time constant: CoverFlow.

I have also tried the type "VideoCoverFlow" as I am pretty sure that these types are defined in Doug's lib. Alas, I am stuck on figuring out where I've gone wrong.

The following is the full text for my mxml project file, called coverflow.mxml.

<?xml version="1.0" encoding="utf-8"?>

<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:local="*"
    height="100%"
    width="100%"
    layout="absolute">

    <local:CoverFlow
        id="CoverFlow"
        horizontalCenter="0"
        verticalCenter="0"
        borderThickness="10"
        borderColor="#FFFFFF"
        width="100%"/>

</mx:Application>

I am trying to compile it with the following command:

c:\flex_sdk_3\bin\mxmlc.exe -compiler.source-path=lib coverflow.mxml

I have also tried moving the CoverFlow_lib.swc file into the same dir as the mxml file instead of using the source-path argument, but that does not seem to make a difference.

I would gladly go RTFM if somebody could be so kind as to point me in the direction of the proper docs. There are related Stack Overflow questions here and here.

Thank you!


Update: I have changed my build command to the following:

mxmlc -library-path+=lib coverflow.mxml

And I also tried the following:

mxmlc -library-path+=CoverFlow_lib.swc coverflow.mxml

With the swc file in the same dir as the mxml file. However, I'm still getting the same errors.

There's also a video here showing the same library that I'm trying to use, but in Flex Builder. Unfortunately, it doesn't show how to use mxmlc.

I've also tried stripping down my mxml to simply,

<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:local="*" >

    <local:VideoCoverFlow />

</mx:Application>
like image 781
Parappa Avatar asked Oct 11 '08 21:10

Parappa


2 Answers

Here is a link to the mxmlc command line tool docs from Adobe and a direct link to the command line options reference. I also find mxmlc -help list to be a good place to start.

As another poster recommended, you really want to use library-path to add the path to the directory that contains the swc file. Use the += operator to make sure you don't overwrite the previous values

e.g.)

c:\flex_sdk_3\bin\mxmlc.exe -library-path+=lib coverflow.mxml
like image 59
James Fassett Avatar answered Sep 22 '22 00:09

James Fassett


If it is an swc shouldn't you be using library-path rather than source-path and referencing the swc?

like image 20
Simon Avatar answered Sep 20 '22 00:09

Simon