List Info

Thread: Trouble importing packages




Trouble importing packages
user name
2008-01-08 16:58:56
Hello Flashr community!

I'm new to ActionScript and have been facing some trouble getting the Flashr package to import correctly into my project. Here's my current setup:

PhotoViewer
  + src
   ;    + aniv
        ;   + PhotoViewer.as
   ;        + Picture.as
       + com
   ;        + kelvinluck
           ;      + flashr .....


I'm trying to get the Picture.as and PhotoViewer.as files to import the flashr package using import com.kelvinluck.flashr.*; but I keep running into error 1046 (e.g. Type was not found or was not a compile-time constant: Flashr).

I'm wondering if this is the right approach to importing your package into my project. The examples worked slightly differently with an example sub-package defined within com.kelvinluck.flashr ... is this the way I should do it too?

I9;m using OS X Leopard, Flash CS3 and Actionscript 3.

Thanks for the help!
Ani
Re: Trouble importing packages
user name
2008-01-08 22:00:43
Hi,

By default the classpath is relative to wherever the fla you are compiling is - from the structure you outline(the fla is Photoviewer?), it looks like the flashr classes are in src, which means you'd have to do import src.com.kelvinluck.flashr to access them.
However, all of the flashr class files will be still set to com.kelvinluck etc. so, using this method, you'd have to change all the references in those too...

So, 2 ways to do this. The simple way is move the aniv and com folders into the same directory as the swf (ie out of the src folder) or you can set a classpath reference. Go to preferences->publish settings->flash from your fla, then click the 'settings button' next to Actionscript version. Click the target icon and select your src directory and that should fix it. 

Owen

On 9 Jan 2008, at 07:58, Anirudh Vemprala wrote:

Hello Flashr community!

I'm new to ActionScript and have been facing some trouble getting the Flashr package to import correctly into my project. Here's my current setup:

PhotoViewer
  + src
       + aniv
           + PhotoViewer.as
           + Picture.as
       + com
           + kelvinluck
                 + flashr .....


I'm trying to get the Picture.as and PhotoViewer.as files to import the flashr package using import com.kelvinluck.flashr.*; but I keep running into error 1046 (e.g. Type was not found or was not a compile-time constant: Flashr).

I'm wondering if this is the right approach to importing your package into my project. The examples worked slightly differently with an example sub-package defined within com.kelvinluck.flashr ... is this the way I should do it too?

I'm using OS X Leopard, Flash CS3 and Actionscript 3.

Thanks for the help!
Ani
_______________________________________________
Flashr mailing list
Flashrosflash.org">Flashrosflash.org

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )