|
-
I'm stuck on document class
I have a preloader on frame 1 of the timeline.
this.addEventListener(Event.ENTER_FRAME, loading);
function loading(event:Event):void {
var total:Number = this.stage.loaderInfo.bytesTotal;
var loaded:Number = this.stage.loaderInfo.bytesLoaded;
if (total == loaded) {
gotoAndPlay("start");
this.removeEventListener(Event.ENTER_FRAME, loading);
}
}
stop();
I also have an example of a document class which I found on the forum from cancerinform(moderator).
package {
import flash.display.MovieClip;
public class classRoot extends MovieClip {
public function classRoot() {
}
}
}
When I test the movie I get this message:
Discription
1046: Type was not found or was not a compile-time constant: Event.
Source
function loading(event:Event):void {
If I take the document class away then the swf plays fine.
I just need to understand why this is happening.
-
You need to let the compiler know that you're going to be using the Event class, just like you're using the MovieClip class, add this:
import flash.events.Event;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|