Actionscript Classpath Problem
- Started
- Last post
- 29 Responses
- noiseisthis0
publish setting > flash > settings > souce path > click folder and add the classes folder
- Did that already. See the screen shot in my original post. http://talesfromtheh…CyBrain
- juskin0
I also need the navBtnMC, and Section classes, the only erros Im getting are related to those classes...
- juskin0
and with this are you creating instances of your three imported classes?
private var intro_mc:introMC;
private var home_mc:homeMC;
private var nav_mc:navMC;if so I think they should be a new instance of the imported class... like :
private var nav_mc:NavButton;
- juskin0
or are those clips in your fla?
- CyBrain0
That's the nav button class
http://pastebin.com/d1ec38a97
and here's the section class
http://pastebin.com/f405190ab
- cuke4260
cybrain ping me if you want me to send a basic set of files to break down the structure of how to set it up. probably easier to begin that way.
- noiseisthis0
in document class (line 16-18):
private var intro_mc:MovieClip;
private var home_mc:MovieClip;
private var nav_mc:MovieClip;
- cuke4260
hey man, i looked at your files - it looks like it can't find the gs/ directory - if you put that in the same directory as your document class everything else should work fine. also I would avoid using gs.* and explicitly enter each class, it helps to be more verbose in that sense.
- CyBrain0
I'll try putting the tweenlite classes in the same folder as the document class. I was hoping to set this up at the application level. Oh well.
- cuke4260
no you want them in their own folder, but put the gs folder in the same directory as your doc class.
get that to work and then you can work on moving stuff around.
i just set up a simple as3 example taht might help, i'm emailing it to you now.
- CyBrain0
I put the gs folder in the same folder as my fla and document class and the issue is dead. I just wish I could have got it working at an application level so I didn't have to do this every time I started new project. I'll have to fight this war another time, if I have the stomach for it.
- juskin0
well here is the thing, your importing all the classes in the gs directory via your classpath, however on line 7 your importing it in a path, something.otherSomething.*; I think you need to get rid of your last classpath, or just import gs.*;
personally I have created a folder in my home folder called class, inside that folder, I have two folders AS2 and AS3 and I put all of my classes in there, then all you have to do is set the classpath once, and home/class/AS3 then becomes the root for importing classes, with it set up like this, I would import like such:
import gs.*;
hope this makes sense...
- cuke4260
i see what you're trying to do, but tbh i have found that it's easiest to just paste all class files (other than native flash ones) with the other classes; tween engines / papervision / third-party classes update so often you'll have less of a problem just copying it over.
it makes it way less complicated handing off files to other developers or working off a thumbdrive or a different computer.set it up in a template structure if you really use it that often.
my 2 cents, but I've never worked at a shop that did it on the application level like you're trying to do.
- cuke4260
another reason to keep it at the project level is for svn. merging projects from different svn repos is messy, so you can strip it out and then just keep one copy in your docs folder connected to the orig repository
- cuke4260
i know it's frustrating, but you're over the worst part now. it gets way better from here on out!
- CyBrain0
I think that got me closer, but I'm still getting two errors.
1120: Access of undefined property Quad.
- juskin0
also, your using packages, since you have no package name, everything is at that root level, so I dont think the classes prefix is necessary, especially since your explicitly importing everthing in the classes folder. your classpaths are importing everything for you automatically, and since your last classpath is already importing gs, either get rid of that, or you should import each class individually. I would get rid of the last classpath and also get rid of classes.gs.*; and just use :
import gs.*;
here is a the explanation which is more important than just fixing the problem.....
with classpaths when you navigate to a directory on your drive, that is your root level of where you begin your import statements.
so, your classes directory, if you had a single class called greenButton IN your classes directory, the way you would import that would simply be:
import greenButton;if you had the gs folder IN your classes directory the way you import that would be:
import gs.nameOfClass;
and of course to import ALL of the classes you would use:
import gs.*;now lets say there is a folder INSIDE of your gs folder, the way to import that would be:
import gs.nameOfFolder.nameOfClass;
or to import all of the classes in the subfolder:
import gs.nameOfFolder.*;hope this helps...
- That completely helps. I never found this explanation elsewhere. Still getting errors though.CyBrain