AS3: Export a MovieClip or Canvas to swf

前端 未结 2 1829
臣服心动
臣服心动 2020-12-18 13:15

I\'m having an app where the user can edit a simple greeting card and should be able to send it to another user. We are currently doing it by exporting to a graphic file an

相关标签:
2条回答
  • 2020-12-18 13:33

    Deep copy the MovieClip object to a ByteArray and dump it to a file.

    var buffer:ByteArray = new ByteArray();
    buffer.writeObject(MOVIE_CLIP_HERE);
    buffer.position = 0;
    buffer.writeBytes(...);
    
    0 讨论(0)
  • 2020-12-18 13:39

    server side flex sdk compiles actionscript or flex from the command line on any linux/unix/windows machine

    I use the flex command line compiler to develop flash apps from my linux desktop, will work great on a server and is scriptable from your web app.

    here are the steps

    1.) download the flex sdk from adobe, and unzip it on the server

    2.) generate the actionscript *.as file or flex *.mxml file for the card

    3.) run this in a linux shell on the server to generate the SWF

    SOURCE_FILE=/dir/with/flex_sdk/
    
    OPTS='-use-network=false'
    # note this is a relative path to the flex sdk
    CONFIG_FILE='flex-config.xml'
    
    if [ -f $CONFIG_FILE ]; then
        OPTS=$OPTS' -load-config='$CONFIG_FILE
    fi
    
    OPTS=$OPTS' -output /path/to/ouput/swf'
    
    /path/to/flex_sdk/bin/mxmlc $OPTS $SOURCE_FILE
    

    the sdk works on windows also but I'm not sure what the command line arguments are

    0 讨论(0)
提交回复
热议问题