Alternativa3d 7.7.0 Compiling With flex 4.1

David Jones
@david3jones
avatar-davidejones

Something I had to remind myself of just today was how to compile a swf using flex. Its probably an everyday task for alot of developers out there but I primarily use a nice ide like Flash, FlashDevelop or even Flash Builder that does most of the work for me so i’m a little rusty. Anyway my reason for this is because I wanted to try out the demos from the alternativa3d 7.7.0 release. I’m sure there was some posts about how to do this over at the alternativa forums but i couldn’t seem to find them. So i downloaded the flex 4.1 sdk and saved it to my computer at C:\flex once i had that i found a nice little tutorial for creating batch files for flex from the legendary Senocular. I used his tutorial and modified it slightly for my own use to include the alternativa3d swc, heres my batch file code.

SET mxmlcPath="C:flexbinmxmlc.exe"
SET opts=-benchmark=true -creator="David E Jones" -include-libraries="C:as3libsAlternativa3D 7.7.0.swc" -static-link-runtime-shared-libraries=true -target-player="10.0.2"
ECHO @ECHO OFF ^& (IF EXIST "%%~dp0%~n1.swf" (DEL "%%~dp0%~n1.swf")) ^& %mxmlcPath% %opts% -file-specs "%%~dp0%~n1%~x1" ^& (IF EXIST "%%~dp0%~n1.swf" (CALL "%%~dp0%~n1.swf") ELSE (PAUSE)) > "%~dp1%~n1.bat"

Note you will need to change the mxmlcPath to where your mxmlc.exe file is and you will also want to define where the alternativa3d swc is by setting the include-libraries to the file. Save this as make-alternativa.bat and put it in your flex directory in my case its now at C:\flex\make-alternativa.bat Then to make use of this open up your folder with the alternativa3d 7.7.0 demos and drag the Alternativa3DExamples.as over on to the make-alternativa.bat file and it will now create a new batch file at the location where the Alternativa3DExamples.as file is. It should name it Alternativa3DExamples.bat, run this batch file and it should compile and run the default demo. Easy! now in the future you can just drag and drop any alternativa actionscript you like to the batch file to try it out.

Comments

    Comments are currently closed