6 Replies Latest reply on Dec 6, 2007 6:09 AM by evsPeart

    A file found in a source-path must have the same package structure '', as the definition's package??

    evsPeart Level 1
      How I can fix this bug with my class, I get this message:

      "A file found in a source-path must have the same package structure '', as the definition's package, 'photoviewer'."

      This is my source WindowedApplication:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:WindowedApplication xmlns:mx=" http://www.adobe.com/2006/mxml"
      xmlns="*"
      paddingBottom="0" paddingTop="0"
      paddingLeft="0" paddingRight="0"
      layout="vertical"
      pageTitle="Photo Viewer"
      creationComplete="init()" viewSourceURL="srcview/index.html">

      <mx:Script>
      <![CDATA[

      import mx.collections.ArrayCollection;
      import mx.rpc.events.*;

      import photoviewer.Gallery;
      import photoviewer.PhotoService;


      [Bindable]
      private var gallery:Gallery;

      [Bindable]
      private var service:PhotoService;

      private function init():void
      {
      service = new PhotoService("data/galleries.xml");
      }
      ]]>
      </mx:Script>

      This is my class Gallery source:

      package photoviewer
      {
      import mx.collections.ICollectionView;
      import mx.collections.ArrayCollection;
      import mx.collections.IViewCursor;

      [Bindable]
      public class Gallery
      {
      public var name:String;
      public var description:String;
      public var photos:ArrayCollection;
      public var selected:int;

      private var photo:Photo;

      public function Gallery(gallery:Object=null)
      {
      photos = new ArrayCollection();
      if (gallery != null)
      {
      fill(gallery);
      }
      }

      public function fill(gallery:Object):void
      {
      this.name = gallery.id;
      this.description = gallery.description;
      this.selected = 0;

      for (var i:int=0; i < gallery.photo.length; i++)
      {
      photo = new Photo(gallery.photo );
      photos.addItem(photo);
      }
      }
      }
      }

      Someone know how to fix this error????
      "A file found in a source-path must have the same package structure '', as the definition's package, 'photoviewer'."??????????

      Regards,
      EvsPeart