So… Here’s the problem. I need just a bit of help figuring out why I’m getting an illegal override error. I’m sure it has to do with the fact that I’m importing an external swf that is a subclass of the importer swf, but I’m not sure how to proceed.
4 files involved - Shell.as, Shell.fla, Page.as, Page.fla
the error is:
VerifyError: Error #1053: Illegal override of frame1 in xxx.Page.
ReferenceError: Error #1065: Variable Page is not defined.
(xxx being the package name I don’t want known)
This error only occurs when running the Shell.fla. If I run Page.fla, I can click the hitMe moviclip and Peter counts up… (name is peter So here it is…
Shell.as:
//////////
package xxx {
import flash.display.;
import flash.events.;
import flash.net.*;
public class Shell extends MovieClip{
private var peter:String = "Peter";
private var peterCalls:int = 0;
public function Shell() {
//trace(this.peter);
}
internal function tracePeter() {
this.peterCalls++;
trace(this.peter + this.peterCalls);
}
}
}
First frame of Shell.fla:
/////////////////////////
var swfLoader:Loader = new Loader();
var swfURL:URLRequest = new URLRequest(“Page.swf”);
swfLoader.load(swfURL);
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
this.addChild(swfLoader);
function swfLoaded(e:Event):void{
trace(trace(“Page Loaded”));
}
Page.as:
////////////
package xxx {
import flash.display.;
import flash.events.;
public class Page extends Shell{
public function Page() {
trace("opened Page");
}
internal function traceShellPeter() {
tracePeter();
}
}
}
First frame of Page.fla:
/////////////////////// - just a simple movieclip on first frame w/instance name hitMe
hitMe.addEventListener(MouseEvent.MOUSE_DOWN,hitMeClick);
function hitMeClick(e:Event):void{
traceShellPeter();
}
So, am I allowed to do this? My goal here is to create a way to import multiple swfs onto the Shell stage and are all Page objects. Then I want these Page objects to be able to use the Shell’s methods and variables… Any help appreciated, thanks