Question

Here's what I'm doing:

amxmlc -load-config obj\config.xml

Here's what I'm getting:

Error: Missing builtin type Object

Error: Unable to build SWF C:\Users\m\work\project\bin\ApplicationName.swf


Here are the contents of config.xml:

<?xml version="1.0" encoding="utf-8"?>
<!--This Adobe Flex compiler configuration file was generated by a tool.-->
<!--Any modifications you make may be lost.-->
<flex-config>
  <target-player>11.8</target-player>
  <benchmark>false</benchmark>
  <static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
  <compiler>
    <define append="true">
      <name>CONFIG::debug</name>
      <value>false</value>
    </define>
    <define append="true">
      <name>CONFIG::release</name>
      <value>true</value>
    </define>
    <define append="true">
      <name>CONFIG::timeStamp</name>
      <value>'11/26/2013'</value>
    </define>
    <define append="true">
      <name>CONFIG::air</name>
      <value>true</value>
    </define>
    <define append="true">
      <name>CONFIG::mobile</name>
      <value>true</value>
    </define>
    <define append="true">
      <name>CONFIG::desktop</name>
      <value>false</value>
    </define>
    <optimize>true</optimize>
    <omit-trace-statements>true</omit-trace-statements>
    <verbose-stacktraces>false</verbose-stacktraces>
    <source-path append="true">
      <path-element>C:\Users\m\work\project\src</path-element>
      <path-element>C:\Program Files (x86)\FlashDevelop\Library\AS3\classes</path-element>
    </source-path>
  </compiler>
  <file-specs>
    <path-element>C:\Users\m\work\project\src\com\client\ApplicationName.as</path-element>
  </file-specs>
  <default-background-color>#FFFFFF</default-background-color>
  <default-frame-rate>30</default-frame-rate>
  <default-size>
    <width>1920</width>
    <height>1080</height>
  </default-size>
</flex-config>

And here's ApplicationName.as:

package com.client {
    
    import flash.display.MovieClip;
    import flash.desktop.NativeApplication;
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.ui.Multitouch;
    import flash.ui.MultitouchInputMode;
    
    public class ApplicationName extends MovieClip {
        
        public function ApplicationName () {
         
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP_LEFT;
            stage.addEventListener(Event.DEACTIVATE, deactivate);
            Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
        }
        
        private function deactivate(e:Event):void 
        {
            // make sure the app behaves well (or exits) when in background
            //NativeApplication.nativeApplication.exit();
        }
    }
    
}

I can build this fine from Flash, Flash Builder, and FlashDevelop - but whenever I try the command line I get an error. And idea what's up with that?

Was it helpful?

Solution

You missed playerglobal.swc in your config. The minimal compiled config should be:

Flex 4:

<flex-config>
<target-player>11.1.0</target-player>
<default-frame-rate>40</default-frame-rate>

<compiler>
    <locale>
        <locale-element>en_US</locale-element>
    </locale>

    <external-library-path>
        <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}/playerglobal.swc</path-element>
    </external-library-path>

    <library-path>
        <path-element>${flexlib}/libs/player</path-element>
    <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}.{targetPlayerMinorVersion}</path-element>    
    </library-path>

    <optimize>true</optimize>
</compiler>
</flex-config>

Flex 3:

<flex-config>
<target-player>10.0.0</target-player>
<default-frame-rate>40</default-frame-rate>

<compiler>
    <locale>
        <locale-element>en_US</locale-element>
    </locale>

    <external-library-path>
        <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}/playerglobal.swc</path-element>
    </external-library-path>

    <library-path>
        <path-element>${flexlib}/libs/player</path-element>
        <path-element>${flexlib}/libs/player/{targetPlayerMajorVersion}</path-element>    
    </library-path>

    <optimize>true</optimize>

    <warn-no-constructor>false</warn-no-constructor>
</compiler>
</flex-config>

You need to add path to the playerglobal.swc from this example.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top