Whoops - I'm being dim. These will work just as well:

import sk.sowhat.linuxPlayer.play4dogs.Test;
var dummyVar:Function=Test;

or

var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; (with no import)

Ian

On 2/2/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
>
> Hi Franto,
>
> As far as I understand it, 'import' isn't enough to get a class compiled
> into your .swf.
>
> The line:
> import sk.sowhat.linuxPlayer.play4dogs.Test;
> just tells the compiler that any mention of the word Test in your code
> will refer to that class.
>
> If the class isn't compiled into the SWF, ClassFinder won't find it. You
> actually need to access  or instantiate the class somewhere in the code to
> make Flash include it. From memory I think just referring to the class
> constructor is enough e.g.
>
> import sk.sowhat.linuxPlayer.play4dogs.Test;
>
> var dummyVar:Function=sk.sowhat.linuxPlayer.play4dogs.Test; // somewhere
> later in the code
>
> I also have a vague memory that you might be able to force MTASC to
> include classes, but not being a user of MTASC (yet!) I'm not certain on
> that one.
>
> HTH,
>   Ian
>
> P.S.
> You may just get away with
> import sk.sowhat.linuxPlayer.play4dogs.Test;
>
> sk.sowhat.linuxPlayer.play4dogs.Test; // refers to the constructor, so
> Flash includes the code
>
> I seem to remember reading that somewhere... although syntactically it's
> odd.
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to