I've made a little progress but also bumped into a problem so I wanted
to share what I have learned. Thanks to Josean's blog (linked by
Fabrice3D) I was able to create a .swc file on linux using using the
following approach.
I cloned the away3d-core-fp10 repo from github. Traverse into the src
directory,
cd $HOME/away3d-core-fp10/src
>From here I created Josean's script with a couple of small changes,
echo '#!'$SHELL > compile_away3d
echo '/opt/flex/bin/compc -compiler.source-path . -output ./away3d.swc
-include-classes \' >> compile_away3d
find . -name '*.as' | grep -v 'away3d/test' | sed -e 's/\.as/ \\/g' -e
's/\.\///g' -e 's/\//\./g' -e '$s/ \\//g' >> compile_away3d
chmod +x compile_away3d
Then just execute the script,
./compile_away3d
and this will create the away3d.swc.
I then started working on the first examples from the book "away3d 3.6
essentials". I created the Away3DTemplate and SphereDemo classes in
chapter 1. I don't really understand the mxml compiler so I was just
trying to get something that compiled and seemed reasonable (let me
know if what I'm doing makes no sense). To create SphereDemo.swf I
have away3d.swc, Away3DTemplate.as, and SphereDemo.as in an empty
project directory (i.e. not in the away3d source tree now). To compile
SphereDemo.swf I use,
mxmlc -compiler.include-libraries away3d.swc -compiler.source-path . -
static-link-runtime-shared-libraries SphereDemo.as
This appears to compile without much trouble and creates the
SphereDemo.swf. However, when I open it with the fp10 debugger I get
the following message:
An ActionScript error has occurred:
ReferenceError: Error #1065: Variable _init is not defined.
at away3d.core.utils::Init/getBoolean()
at away3d.containers::View3D()
at Away3DTemplate/initEngine()
at Away3DTemplate()
at SphereDemo()
So I took a look at the Init.as code and it looks fine. There is even
a null check on the _init variable in getBoolean(). So I tried to get
a little more information out of the compiler by adding -
compiler.debug=true when I build SphereDemo.as (in hindsight this was
unlikely to provide any helpful info), however when I do that I do not
get any error message but I also do not get a sphere.
So this is the point I'm at. I've made a little progress but now I'm
blocked by an error that doesn't look like it should occur.
-Josh
On May 23, 10:15 am, josh <[email protected]> wrote:
> Hi,
>
> I'm pretty new to ActionScript and Flex, mostly I work with C++. But
> I'm working on a project where we would like to use Away3D to leverage
> 'molehill'. The main problem I have at the moment is that I'm really
> confused about how to get started on linux. Most of the tutorials I've
> come across online use FlashBuilder or similar on windows. Ultimately
> what I want is to be able to rendering 3D meshes produced in 3D studio
> max. But right now I would just like to figure out how to build away3d
> and get an example running.
>
> I know this is a very elementary question. I am more comfortable with
> the actual coding side of things, rather than building. So if anyone
> can point me in the direction of a linux-specific tutorial that covers
> the basics and building and organizing a flex project, it would be
> greatly appreciated.
>
> -Josh