# Attach mc and load swf at same time?

**URL:** <https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291>\
**Category:** flash\
**Created:** [May 20, 2003, 12:37am UTC](https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291 "2003-05-20T00:37:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felipe\_Bastos](https://avatars.discourse-cdn.com/v4/letter/f/f05b48/32.png) [@Felipe\_Bastos](https://forum.kirupa.com/u/Felipe_Bastos)\
**Post date:** [May 20, 2003, 12:37am UTC](https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291/1 "2003-05-20T00:37:25Z")

</div>

Hy guys!  
Does anyone knows if its possible, just in one button click, to attach a mc and loads a swf into this attached mc?  
😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 20, 2003, 1:05am UTC](https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291/2 "2003-05-20T01:05:24Z")

</div>

Hey.  
This is myself 🙂  
Yesss, I love when I can program by myself.  
A little help from the debuging aaand…done!!!  
Here it is:

on(release) {  
\_root.attachMovie(“loadswf”, “content”, 1);  
setProperty(\_root.content, \_x, 0);  
setProperty(\_root.content, \_y, 20);  
\_root.content.loadMovie(“arte/arte\_trial.swf”, 1);

Now is the following question:  
(this is still the button.enable = false doubt)  
How can I check if the mc is loaded and then enable the buttons?

Now I know I can use the:  
myMovieClip.onLoad

But I really need some help building the if statement.  
If mc is loaded, enable buttons. If it`s not, disable them

Love Kirupa  
Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 20, 2003, 10:33pm UTC](https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291/3 "2003-05-20T22:33:24Z")

</div>

[AS]mymovieClip.onLoad = function(){  
//set loaded variable  
clipLoad = true;  
//if statement  
if(clipLoad){  
myButton.enabled = true;  
}else{  
myButton.enabled = false;  
}   
}[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 21, 2003, 12:01am UTC](https://forum.kirupa.com/t/attach-mc-and-load-swf-at-same-time/21291/4 "2003-05-21T00:01:22Z")

</div>

Hi Liam!  
Is this correct?  
I`m not sure where to put the code!?

- “content” is the newName for the attached movieclip “loadswf”;
- “this” refers to the movieclip I put the code (in this case, it`s the movieclip that contains all the buttons);
- “avanca” is on of the buttons;

\_level0.content.onLoad = function(){  
//set loaded variable  
clipLoad = true;  
//if statement  
if(clipLoad){  
this.avanca.enabled = true;  
}else{  
this.avanca.enabled = false;  
}  
}
