Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Load swf file, AS3 Class (for windows, IOS and android)

Explorer ,
Aug 15, 2013 Aug 15, 2013

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

07.jpg

TOPICS
ActionScript
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 15, 2013 Aug 15, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

How we can solve this problem?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 15, 2013 Aug 15, 2013

Show the code from any other file involved, maybe the main.fla?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 15, 2013 Aug 15, 2013

I didn’t use any other scrip only stop action in my all files

08.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 16, 2013 Aug 16, 2013
LATEST

Any suggestion how we can solve this problem?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines