# AS2 to AS3 - loading external SWFs to main SWF

**URL:** <https://forum.kirupa.com/t/as2-to-as3-loading-external-swfs-to-main-swf/277485>\
**Category:** flash\
**Created:** [December 12, 2008, 1:35pm UTC](https://forum.kirupa.com/t/as2-to-as3-loading-external-swfs-to-main-swf/277485 "2008-12-12T13:35:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![IngJure](https://avatars.discourse-cdn.com/v4/letter/i/ac8455/32.png) [@IngJure](https://forum.kirupa.com/u/IngJure)\
**Post date:** [December 12, 2008, 1:35pm UTC](https://forum.kirupa.com/t/as2-to-as3-loading-external-swfs-to-main-swf/277485/1 "2008-12-12T13:35:07Z")

</div>

Hey!

I have one problem 🙂

I have a swf file, it is in AS2, but I would like to use it in AS3 page. So I would like to remake it for AS3.

In the main SWFs AS layer I have thi code:  
**\_root.currMovie = “section1”;  
container.loadMovie(\_root.currMovie+".swf");**

(section1 is one of the swfs I want to load in main swf.)

This is the AS for first button that calls swf section1:  
**on (release) {  
if (\_root.currMovie == undefined) {  
\_root.currMovie = “section1”;  
container.loadMovie(“section1.swf”);  
} else if (\_root.currMovie != “section1”) {  
if (container.\_currentframe \>= container.midframe) {  
\_root.currMovie = “section1”;  
container.play();  
}  
}  
}**

In swf section1 that loads in main SWF and is called by first button in main SWF, I have a MC on three sections (with 3 keyframes).  
In first keyframe there is AS:

**midframe=78**

In second keyframe: stop();

And in third:

**\_root.container.loadMovie(\_root.currMovie+".swf")**

Sooooo, can anyone pleaseeee help me to change this code to work in AS3??

THANK YOU,  
Jure
