0

So I have this shell script that compiles my AS3 classes to the SWF format.

Today I wanted to add a fancy timestamp to the "date" parameter on the metadata list. I'm trying to use the compiler option -raw-metadata but everytime I try to compile it gives me this error:

Adobe Flex Compiler (mxmlc)
Version 4.6.0 build 23201
Copyright (c) 2004-2011 Adobe Systems, Inc. All rights reserved.

command line: Error: default arguments may not be interspersed with other options

Use 'mxmlc -help' for information about using the command line.

Do you guys have any idea of why this is happening at all? Am I doing something stupid? It works fine if I don't use -raw-metadata but set every single parameter individually.

Here is my build process (Makefile):

# 
# Rafael Rinaldi (rafaelrinaldi.com)
# Feb 20, 2013
# 

# Flex compiler.
mxmlc=/Users/rafaelrinaldi/Code/Flash/SDK/flex_sdk_4.6/bin/mxmlc

# Flash player.
player=/Applications/Adobe\ Flash\ CS6/Players/Debug/Flash\ Player\ Debugger.app

# Setup.
main=./src/Main.as
libraries=./libs
swc=./swc
source-path=./src
output=./bin/static/Main.swf
run=$(output)

# .swf settings.
fp=11.1
fps=60
bg=0xFFFFFF
dimension=865,720

# Flags.
as3=true
debug=true
strict=true

# Application info.
title=Main
creator=Rafael Rinaldi (rafaelrinaldi.com)
publisher=Rafael Rinaldi (rafaelrinaldi.com)
description=My application.
language=en-US
date=$(shell date +'%B %d, %Y')
timestamp=$(shell date +'%D %T')

# SWF meta data.
define swf_metadata
<metadata>
    <title>$(title)</title> 
    <description>$(description)</description> 
    <publisher>$(publisher)</publisher> 
    <creator>$(creator)</creator> 
    <language>$(language)</language>
    <date>$(timestamp)</date>
</metadata>
endef

export swf_metadata

all: compile run

# Compile main file into a .swf
compile:
    @echo "\nCompiling '$(main)'...\n"
    @$(mxmlc) \
    -as3=$(as3) \
    -debug=$(debug) \
    -strict=$(strict) \
    -target-player=$(fp) \
    -default-frame-rate=$(fps) \
    -default-background-color=$(bg) \
    -default-size=$(dimension) \
    -static-link-runtime-shared-libraries=true \
    -source-path=$(source-path) \
    -source-path+=$(libraries) \
    -library-path=$(swc) \
    $(main) \
    -raw-metadata=$$swf_metadata \
    -o $(output)
    @echo "\nCompiled '$(output)' at `date "+%H:%M of %d/%m"`."

# Runs the application.
run:
    @echo "\nRunning '$(run)'\n"
    @open -a $(player) $(run)

# Aliases.
c: compile
r: run

.PHONY: all
  • Show the compiler command you are using. The error says the order of your params you're specifying is not allowed (ie: try to group the "default" options so they are contiguous and put the optional ones at the end). I'm not sure what the default options are, off hand. – Sunil D. Mar 14 '13 at 06:40
  • @SunilD. Jus edited my post with the build script I'm using. –  Mar 14 '13 at 18:09
  • My suggestion would be to put the `-raw-metadata=$$swf_metadata` line at the end of the compile command's options. So just move it after the `-o $(output)` line, but it's just a shot in the dark based on the error message you got. Also, I'm not sure how it will handle the multi-line XML string you're passing it ... you might try testing with just a small one line XML snippet and see if you can get that to work first. – Sunil D. Mar 14 '13 at 18:26

0 Answers0