1 Reply Latest reply on May 28, 2008 10:04 PM by Gregory Lafrance

    Package Woes

    durgle
      Here is my directory structure:

      src-main.mxml
      -com/preloaderOverride.as

      Here is my import lines in the main.mxml file:
      --------------------------------------------------------------------

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="vertical"
      verticalAlign="middle"
      preloader="preloaderOverride.DPBSubclass"
      >

      <mx:Script>
      // Import Classes
      import com.preloaderOverride.*;

      --------------------------------------------------------------------
      here is my package: preloaderOverride.as
      --------------------------------------------------------------------

      /* Custom Preloader */
      package preloaderOverride {
      import flash.events.Event;
      import flash.events.ProgressEvent;
      import flash.geom.Rectangle;
      import mx.preloaders.DownloadProgressBar;

      public class DPBSubclass extends DownloadProgressBar {

      public function DPBSubclass() {
      super();
      // Minimum display time after download
      MINIMUM_DISPLAY_TIME = 3000;
      // Set the default text during initialization
      // Progress
      initializingLabel = "Download Complete!\nInitializing...";
      }

      // Override label area to display custom text
      override protected function get labelRect():Rectangle {
      return new Rectangle(14, 5, 150, 30);
      }

      // Override download progress handler to display
      // Custom Text
      override protected function progressHandler(event:ProgressEvent):void {
      super.progressHandler(event);
      label = Math.round(event.bytesLoaded / 1000).toString()
      + "k of " + Math.round(event.bytesTotal / 1000).toString()
      + "k";
      }

      // Override to ensure display of progress bar during init and download
      override protected function showDisplayForDownloading(elapsedTime:int, event:ProgressEvent):Boolean {
      return true;
      }
      }
      }
      --------------------------------
      this is my error: 1172: Definition com.preloaderOverride could not be found

      I really need help and cannot figure this out....