1 Reply Latest reply on Nov 21, 2006 5:53 PM by ntsiii

    Confused about paths with Actionscript Projects

    thup
      First off, background: I'm an experienced AS developer. I do primarily web games and see very little of use to me in MXML, but I have been using Eclipse/FDT to do game development for a while, and I wanted to check out Flex Builder 2 as a replacement. Off to a very rocky start so far :(.

      I have an extremely basic question -- how do folders work now with actionscript packages?

      I create a new actionscript project called Test, actionscript builder spits out a class file that looks like this:
      quote:


      package {
      import flash.display.Sprite;

      public class Test extends Sprite
      {
      public function Test()
      {
      trace("hello world...");
      }
      }
      }



      (hello world being my own addition, natch). This works fine, but I don't want my class sitting out there outside a package.

      So let's say I want my class in com.foo.test instead? I can not figure out how to do this at all, I've been flailing for hours.

      1. I changed the code to the following:
      quote:


      package com.foo.test {
      import flash.display.Sprite;

      public class Test extends Sprite
      {
      public function Test()
      {
      trace("hello world...");
      }
      }
      }


      2. I moved this file into a subfolder com/foo/test, so it currently resides as com/foo/test/Test.as with the code above.
      3. When I tried to debug this, it gave me an error that Test-debug.html wasn't in bin/com/foo/test. I moved this generated html file over, which solved this error.
      4. If I try to build then, I get this error instead:
      "A file found in a source-path must have the same package structure ", as the definition's package, 'com.foo.test'. This refers to the Test.as file I pasted in above.

      Any idea what's wrong here?