Copy link to clipboard
Copied
I try this code
package {
import flash.display.SimpleButton;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.Loader;
import flash.events.Event;
import flash.system.ApplicationDomain;
import flash.net.URLRequest;
import flash.system.LoaderContext
public class load2 extends SimpleButton {
var loadit:Loader;
public function load2() {
this.addEventListener(MouseEvent.MOUSE_DOWN, loadfile);
}
private function loadfile(event:MouseEvent):void {
trace("you clicked me");
loadit = new Loader();
this.parent.addChild(loadit);
var _lc:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
loadit.load(new URLRequest("s02.swf"), _lc);
}
}
}
but I got compiler error
Copy link to clipboard
Copied
I don't see where that error applies to the load2 file but might instead be pointing to another file that calls upon the load2 class, as though it were being instantiated without it being imported.
Copy link to clipboard
Copied
How we can solve this problem?
Copy link to clipboard
Copied
Show the code from any other file involved, maybe the main.fla?
Copy link to clipboard
Copied
I didn’t use any other scrip only stop action in my all files
Copy link to clipboard
Copied
Any suggestion how we can solve this problem?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now