# as2 unable to load as3 into container

**URL:** <https://forum.kirupa.com/t/as2-unable-to-load-as3-into-container/273505>\
**Category:** Uncategorized\
**Created:** [October 16, 2008, 7:41am UTC](https://forum.kirupa.com/t/as2-unable-to-load-as3-into-container/273505 "2008-10-16T07:41:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gallium](https://avatars.discourse-cdn.com/v4/letter/g/8e8cbc/32.png) [@gallium](https://forum.kirupa.com/u/gallium)\
**Post date:** [October 16, 2008, 7:41am UTC](https://forum.kirupa.com/t/as2-unable-to-load-as3-into-container/273505/1 "2008-10-16T07:41:19Z")

</div>

I’ve got a main.swf(as2.0) which loads individual swfs into it.  
However, some of the external swfs are written in as3.0 due to usage of the some text effs and preloader.

I have the following codes in my main.swf that require help to rephrase them into as3.0 so that all can be loaded proper.

as for btns:

```auto
_root.currMovie = "sense"; 
container.loadMovie(_root.currMovie+".swf"); 

button1.onPress = function () {
container.loadMovie("sense.swf");
resetAll(1);
this.myFlag = 1;
};
button2.onPress = function () {
container.loadMovie("work01.swf");
resetAll(2);
this.myFlag = 1;
};
button3.onPress = function () {
container.loadMovie("team.swf");
resetAll(3);
this.myFlag = 1;
};
button4.onPress = function () {
container.loadMovie("credentials.swf");
resetAll(4);
this.myFlag = 1;
};
button5.onPress = function () {
container.loadMovie("careers.swf");
resetAll(5);
this.myFlag = 1;
};
button6.onPress = function () {
container.loadMovie("contact.swf");
resetAll(6);
this.myFlag = 1;
};  

```

as

```auto

var i:Number;
for (i = 1; i < 7; i++) 
{
    var temp:Object = this["button"+i];
    
    temp.myName = i;
    temp.myFlag = 0;
    
    temp.onRollOver = function()
    {
        if (this.myFlag != 1)
        {
            this.gotoAndPlay("in");
        }
        else
        {
            //
        }
    };
    
    temp.onRollOut = function()
    {
        if (this.myFlag != 1)
        {
            this.gotoAndPlay("out");
        }
        else
        {
            //
        };
    };
    
    //temp.onPress = function()
    //{
        //resetAll(this.myName);
        //this.myFlag = 1;
    //};
};

function resetAll(a)
{
    var i:Number;
    for (i = 1; i < 7; i++) 
    {
        var temp:Object = this["button"+i];
        
        temp.myFlag = 0;
        
        if (temp._currentframe == 7 && a != i)
        {
            temp.gotoAndPlay("out");
        };
    };

   
    };

```

Please advise. 😕 😕 😕 😕
