3 Replies Latest reply on Jun 23, 2007 1:50 PM by kglad

    Getting error from book code

    NoRefund17 Level 1
      hey everybody, trying to figure out how to load an external movie into another movie and the code given to me in the book "Actionscript 3.0 Cookbook" is pasted below. However when i run it, it gives me this error message

      Description Source
      "1037: Packages cannot be nested." package{

      not sure what i could be doing wrong, i copy'ed it exactly as it is in the book to get a feel for the code before i started messing with it to actually figure out the inner workings and customize it. Thank you for your time :)



      package{
      import flash.display.*;
      import flash.net.URLRequest;
      import flash.events.Event;

      public class LoaderExample extends Sprite {

      private var _loader:Loader;

      public function LoaderExample() {
      _loader = new Loader();
      addChild( _loader );

      _loader.contentLoaderInfo.addEventListener( Event.INIT, handleInit );

      _loader.load( new URLRequest( "flashLoadTestMovie.swf" ));
      }

      private function handleInit( event:Event ):void{
      var movie:* = _loader.content;

      trace( movie.getColor() );

      movie.setColor( 0xFF0000 );
      }
      }
      }