Relative Classpaths in AS3

I’ve been working in AS3 for about a year now and everyone in awhile I slip and use an AS2 property reference, for example ._alpha vs .alpha.  The other place I find myself slipping is with classpaths.  I work in a SVN development environment so it is important that all classpaths are defined relatively so they work across machines.  

For simplicity’s sake here’s a sample of a very basic small Flash project.

In AS2 I would set the classpath as “classes/” to have access to the MyClass.as file in my project.fla.

In AS3 that doesn’t fly and the classpath must be set as ”../myProject/classes” or “./classes”.  I’m not 100% clear on why “classes/” no longer works as all three paths seem the same to me, but suffice to say this caused a fair share of headaches when I first made the jump to AS3.

Share and Enjoy:
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • NewsVine
  • Propeller
  • Yahoo! Buzz

Tags: , ,

One Response to “Relative Classpaths in AS3”

  1. HaunGo Says:
    November 18th, 2008 at 12:41 pm

    Thank you for making a post on this.. .. I too was starting to get a headache. “./classes” is what I’m going with.
    -H

Leave a Reply