8 Replies Latest reply on Jun 17, 2009 8:04 AM by Cr99

    Library Project script files

    Cr99 Level 1

      I want to create a Library project that I can use with multiple Flex applications.  I am in the process of moving over the files from one of my apps into this new Library.  However one of the files I brought over is an actionscript file that I use in several files.  It is a bunch of generic utility methods that are nice to have.  I include it in files like this:


      <mx:Script source="utilityScripts/UtilityScript.as"/>


      Here is a little sample of code from that file:


      import mx.rpc.events.FaultEvent;

      import mx.controls.Alert;



      public function handleFault(event:FaultEvent):void {

      Alert.show(event.toString(), "Error");



      In the original file, I did not even declare it as part of a package and it worked fine.  But now in the library project it gives me this error at first:


      1114: The public attribute can only be used inside a package.


      So if I give it a package name:


      package utilityScripts


      it then gives me a new error:


      1037: Packages cannot be nested.



      How can I get this file to work in the Library project?