I can not yet understand how to learn 3.0

I had a complete interactive application built in ActionScript 2.0 and now need to revise and update - which means the conversion of the former code 3.0.

The first scene is a preloader for the whole application that loads and animation of intro before launching the application. I went to the help section, thinking that once I had a few actionScript in the file, I could delete and experiment the code until I began to understand (I took a semester has retained the long courses in Java, but not much). If you couldn't already tell, I'm a designer, not a programmer.

I copied the help section ActionScript code and pasted in my Flash document. I went to test the movie and got the following error message: "1037: packages cannot be nested" I can't even understand what it means! I have nothing else in my document.

Here is the ActionScript code that copied from the help page:

package {}
import flash.display.Loader;
import flash.display.Sprite;
import flash.events. *;
import flash.net.URLRequest;

SerializableAttribute public class LoaderExample extends Sprite {}
private var url: String = "Image.gif";

public void LoaderExample() {}
var loader: Loader = new Loader();
configureListeners (loader.contentLoaderInfo);
loader.addEventListener (MouseEvent.CLICK, clickHandler);

var request: URLRequest = new URLRequest (url);
Loader.Load (request);

addChild (loader);
}

private void configureListeners(dispatcher:IEventDispatcher):void {}
dispatcher.addEventListener (Event.COMPLETE, completeHandler);
dispatcher.addEventListener (HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener (Event.INIT, initHandler);
dispatcher.addEventListener (IOErrorEvent.IO_ERROR, ioErrorHandler);
dispatcher.addEventListener (Event.OPEN, openHandler);
dispatcher.addEventListener (ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener (Event.UNLOAD, unLoadHandler);
}

private void completeHandler(event:Event):void {}
trace ("completeHandler:" + event);
}

private void httpStatusHandler(event:HTTPStatusEvent):void {}
trace ("httpStatusHandler:" + event);
}

private void initHandler(event:Event):void {}
trace ("initHandler:" + event);
}

private void ioErrorHandler(event:IOErrorEvent):void {}
trace ("ioErrorHandler:" + event);
}

private void openHandler(event:Event):void {}
trace ("openHandler:" + event);
}

private void progressHandler(event:ProgressEvent):void {}
trace ("progressHandler: bytesLoaded =" + event.bytesLoaded + "bytesTotal =" + event.bytesTotal);
}

private void unLoadHandler(event:Event):void {}
trace ("unLoadHandler:" + event);
}

private void clickHandler(event:MouseEvent):void {}
trace ("clickHandler:" + event);
var loader: Loader = Loader (event.target);
Loader.Unload ();
}
}
}

You can simply extend MovieClip, instead of Sprite:

SerializableAttribute public class LoaderExample extends MovieClip

and then import them MC thus:

import flash.display.MovieClip;

Tags: Adobe Animate

Similar Questions

Maybe you are looking for

  • HORRIBLE 38.3.0! Problems with lightning (bug 1211291)

    HelloThunderbird set itself updated 38.3.0 today and I have several questions: 1. When you have selected the Inbox, rather than see, the sender, the date sent etc. on the half top of the pane and the body of the email in the background, I see a page

  • My Favorites display on my desktop PC but not on my laptop

    I use Mozilla to access my Yahoo email on my desktop computer. I also use Mozilla to access my Yahoo email on my laptop. But do not show the bookmarks I have on my desk on my laptop. How can I get to synchronize bookmarks?

  • Is there a download of the software (not install) that we install on machines without an internet connection.

    Is there a way to download firefox for a USB key without the installation program, so I can install it on more than one PC?We use Oracle Forms in the House. No internet connection because it is safe from outside.Internet Explorer works well, if we wa

  • I have 2 different synchronization data

    OK, I have 2 different synchronization data, one on my mac on my pc they are totally different, they have different 2 story etc... I was wondering if I sync two devices on one account will be the second unsynchronized data mmain be changed to main? o

  • I need drivers for win7 z370

    Hello just unpacked my new z370 entered without bones. Just installed win7 Home premium and searched here full driver package... but there is only video drivers! can u tell me where I can find the full driver package? Thanks in advance XSnailX