How to include the protobuff classes to the as project

27 views
Skip to first unread message

Christen Lorensen

unread,
Mar 13, 2012, 8:05:25 AM3/13/12
to protobuf-actionscript3
Hi

When I have made the as3 protobuffer classes I am using them in the
project by getDefinitionByName and a string returned by the server, as
there are a lot of classes.

Is there a smart way of including all the generated files into the
flash project so they can be used runtime. The solution so far is to
make a dummy reference to them, but this is a bit tedious.

Rytis Alekna

unread,
Mar 13, 2012, 8:22:14 AM3/13/12
to protobuf-ac...@googlegroups.com
Hi Christen,

you can compile those classes into SWC using compc.exe using argument -include-classes.It's VERY boring stuff to tell compiler by hand what you want to include, so I would recommend using FlexAntTask for AntTask - so the job can be done immediately. If you don't want to use compc.exe, then you can write Ant task, that generates a class that includes (your current way) all the needed classes.

Regards,
Rytis

Christen Lorensen

unread,
Mar 13, 2012, 9:07:58 AM3/13/12
to protobuf-ac...@googlegroups.com
Hi Rytis

Thanks, do you think you can explain using compc.exe a bit more? I'm a bit blank, tried looking it up on google, but I did not get mush wiser.

Christen

Christen Lorensen

unread,
Mar 13, 2012, 10:32:27 AM3/13/12
to protobuf-actionscript3
I figured it out, compc.exe is the flex compiler. So I could use a
commandline tool to compile and include the files.

Or I can create a flexLib project that compiles out to a SWC with the
files that I can link to.

Christen


On Mar 13, 2:07 pm, Christen Lorensen <c...@reto.dk> wrote:
> Hi Rytis
>
> Thanks, do you think you can explain using compc.exe a bit more? I'm a
> bit blank, tried looking it up on google, but I did not get mush wiser.
>
> Christen
>
> Den 13-03-2012 13:22, Rytis Alekna skrev:
>
>
>
>
>
>
>
> > Hi Christen,
>
> > you can compile those classes into SWC using compc.exe using argument
> > -include-classes.It's VERY boring stuff to tell compiler by hand what
> > you want to include, so I would recommend using FlexAntTask for
> > AntTask - so the job can be done immediately. If you don't want to use
> > compc.exe, then you can write Ant task, that generates a class that
> > includes (your current way) all the needed classes.
>
> > Regards,
> > Rytis
>
> > On 13 March 2012 14:05, Christen Lorensen <c...@reto.dk

Rytis Alekna

unread,
Mar 13, 2012, 11:01:10 AM3/13/12
to protobuf-ac...@googlegroups.com
I think a good idea is to compile those classes to a separate SWC and than later merge it into main SWF. Yes, you can create FlexLib project in Flash Builder or Flash Develop but if those classes will change often you will find it time consuming anyway. My advice (from my own experience) is to allocate some time on investigating AntTask and create your own build script.

Rytis.
Reply all
Reply to author
Forward
0 new messages