Question

How does one get a project setup in Flash Builder 4 with Adobe AIR 3 that uses Stage3D?

Whenever I add "-swf-version=13" to the compiler options, I get the following error:

Process terminated unexpectedly.

error while loading initial content

Launch command details:  "/Applications/Adobe Flash Builder 4/sdks/4.5.1.21328/bin/adl" -runtime "/Applications/Adobe Flash Builder 4/sdks/4.5.1.21328/runtimes/air/mac" "/Users/joverton/Documents/Prototyping and Testing/Virtual Library AIR/bin-debug/Main-app.xml" "/Users/joverton/Documents/Prototyping and Testing/Virtual Library AIR/bin-debug" 

I have gpu mode enabled in my App.xml file, and am using the newest Flex SDK (4.6).

Similar question was asked here:

AIR 3.0 and Stage3D

but the solution is no longer valid! The link in the accepted answer just annoyingly redirects to the home page, and you can't even get to it by looking at Google's cached version of the page.

Also here:

http://www.dreaminginflash.com/2011/10/12/adobe-flex-adobe-air-3-alternativa-3d-real-3d-engine/

does not work for me.

Was it helpful?

Solution 2

Got it! The solution turned out to be building from the command line, rather than using Flash Builder (4, can't speak for 4.5/6). Here is the sequence of commands:

I. axmlc compile the application (Main.as) file, with all the correct options:

$FLEX_4.6_SDK/bin/amxmlc -static-link-runtime-shared-libraries=true -library-path+='$ALTERNATIVA/Alternativa3D.swc' -debug=true -swf-version=13 -load-config $FLEX_4.6_SDK/frameworks/air-config.xml -- Main.as

(where $FLEX_4.6_SDK and $ALTERNATIVA are the locations of the Flex SDK and Alternativa3D SWC, naturally)

II. adl run the application

$FLEX_4.6_SDK/bin/adl Main-app.xml

which for convenience I setup in my .bash_profile like so:

alias run_virtual_library="cd '/Users/joverton/Documents/Prototyping and Testing/Virtual Library/src/' && /Applications/Adobe\ Flash\ Builder\ 4/sdks/4.6/bin/amxmlc -static-link-runtime-shared-libraries=true -library-path+='/Users/joverton/Documents/Libraries & Tools/Alternativa3D/Alternativa3D_8.17.0/Alternativa3D.swc' -debug=true -swf-version=13 -load-config /Applications/Adobe\ Flash\ Builder\ 4/sdks/4.6/frameworks/air-config.xml -- Main.as && '/Applications/Adobe Flash Builder 4/sdks/4.6/bin/adl' Main-app.xml &"

Note that in my AIR application descriptor file I set the renderMode to "gpu", but "direct" will also work. Also, in the amxmlc command you needn't set the debug compiler option to true; I only do for the sake of testing.

EDIT: Additional note is that - because I was building from the command line rather than from Flash Builder - I had to explicitly set the value of in my AIR Descriptor file (in this case to "Main.swf"), else I received "content not found" errors when trying to run the application.

OTHER TIPS

You can not use "gpu" mode and Stage3D. You need to specify "direct". Hope this works. Confusing, I know :) If not, try making a regular flash player project first, and run with all debug flags on. AIR is usually more complicated with all the SDKs and stuff.

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