# Getting a "Error #2136 myfile.swf contains invalid data" error and I'm not sure why

**URL:** <https://forum.kirupa.com/t/getting-a-error-2136-myfile-swf-contains-invalid-data-error-and-im-not-sure-why/249135>\
**Category:** Uncategorized\
**Created:** [January 15, 2008, 7:08pm UTC](https://forum.kirupa.com/t/getting-a-error-2136-myfile-swf-contains-invalid-data-error-and-im-not-sure-why/249135 "2008-01-15T19:08:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![caraticus](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/caraticus/32/4195_2.png) [@caraticus](https://forum.kirupa.com/u/caraticus)\
**Post date:** [January 15, 2008, 7:08pm UTC](https://forum.kirupa.com/t/getting-a-error-2136-myfile-swf-contains-invalid-data-error-and-im-not-sure-why/249135/1 "2008-01-15T19:08:22Z")

</div>

I’m getting this error:

Error: Error #2136: The SWF file file:  
myfile.swf contains invalid data.  
at Classes.Buttons::MainMenuBtns/passBtnIndex()

when trying to load external swfs. This issue deals with two classes:

Interface (this is the Document Class)  
MainMenuBtns (this Class is applied to simple buttons on the external swf)

I’ve posted the two classes below:

```auto
<CLASS 1: Interface (The document class)>
 
<INTERFACE CODE STARTS HERE>
package Classes{
        import flash.display.*;
        import flash.events.*;
        import flash.net.*;
        import Classes.Buttons.ButtonSetup;
 
        public class Interface extends MovieClip {
 
                public function Interface() {
                        loadMainMenu();
                        
                }
                public function loadMainMenu():void {
                        var _buttonSetup:ButtonSetup = new ButtonSetup();
                        _buttonSetup.disableBtns();
                        loadContent(0,0);
                }
                public function loadContent(lNum, pgNum):void {
                        var loader:Loader = new Loader();
                        var req:URLRequest = new URLRequest("screenContent/lesson"+lNum+"/content_L"+lNum+"Sc"+pgNum+".swf");
                        loader.load(req);
                        loader.x = 6;
                        loader.y = 45.5;
                        addChild(loader);
                }
        }
}
<INTERFACE CODE ENDS HERE>
 
 
 
<CLASS 2: MAINMENUBTNS (class applied to external swf buttons);
 
<MAINMENUBTNS CODE STARTS HERE>
package Classes.Buttons{
        import flash.display.*;
        import flash.events.*;
        import Classes.Interface;
 
        public class MainMenuBtns extends SimpleButton {
                public var btnIndex:int;
                public var btnName:String;
                public function MainMenuBtns() {
                        addEventListener(MouseEvent.CLICK, passBtnIndex);
                }
                public function passBtnIndex(event:MouseEvent) {
                        btnName = this.name;
                        btnIndex = Number(btnName.charAt(6) + btnName.charAt(7));
                        var _interface:Interface = new Interface();
                        _interface.loadContent(btnIndex, 1);
                        //trace(btnIndex);
                }
        }
}
<MAINMENUBTNS CODE ENDS HERE>

```
