# Enabled Button from a load SWF

**URL:** <https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627>\
**Category:** Uncategorized\
**Created:** [February 25, 2004, 3:58pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627 "2004-02-25T15:58:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![lessmari](https://avatars.discourse-cdn.com/v4/letter/l/ebca7d/32.png) [@lessmari](https://forum.kirupa.com/u/lessmari)\
**Post date:** [February 25, 2004, 3:58pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/1 "2004-02-25T15:58:10Z")

</div>

I am trying to turn buttons off and back on from a loaded SWF.

When loading an external SWF into an empty MC, the bottons on the root are still active underneath the loaded SWF.

I am using the following code on the button which loads the external SWF  
on (release) {  
loadMovie(“1005.swf”,\_root.location);  
}

and then from the first frame of the the loaded SWF I have  
\_root.compact.enabled = false  
\_root.compact.enabled = true

this is not working; the buttons are still active…Can anyone please help.

---

<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:** [February 25, 2004, 4:24pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/2 "2004-02-25T16:24:17Z")

</div>

Is compact the instance name of your button?

---

<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:** [February 25, 2004, 5:11pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/3 "2004-02-25T17:11:43Z")

</div>

yes

---

<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:** [February 25, 2004, 5:13pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/4 "2004-02-25T17:13:30Z")

</div>

Why not use  
[AS]on (release) {  
loadMovie(“1005.swf”, \_root.location);  
compact.enabled = false;  
}  
[/AS]  
?

scotty(-:

---

<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:** [February 25, 2004, 5:19pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/5 "2004-02-25T17:19:49Z")

</div>

Scotty I tried that bit when I unload the external SWF the button is still disabled

I enabled it =false  
and then enabled = true

Im I placing the enabled = true in the wrong location

too unload the swf I have…  
on (release) {  
unloadMovie(this);  
}  
on a button within the external SWF

---

<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:** [February 25, 2004, 5:33pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/6 "2004-02-25T17:33:04Z")

</div>

I was afraid of that:)  
On the button to unload:  
[AS]on (release) {  
unloadMovie(this);  
\_root.compact.enabled = true;  
}[/AS]

scotty(-:

---

<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:** [February 25, 2004, 5:45pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/7 "2004-02-25T17:45:31Z")

</div>

Scotty, I tried that also, and I just tried it again…  
when the SWF unloads the button is not active.

By your comment I am assuming that it is not wise to unload via a button is there a better way and will it help solve my problem.

---

<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:** [February 25, 2004, 6:12pm UTC](https://forum.kirupa.com/t/enabled-button-from-a-load-swf/102627/8 "2004-02-25T18:12:55Z")

</div>

No, that comment was a joke, when I post the code for disabling the button I thought “and if he needs that button again”.

The code I gave you worked here.  
Skip all the code concerning disabling/enabling.  
to load/disable  
[AS]on (release) {  
loadMovie(“1005.swf”, \_root.location);  
compact.enabled = false;  
}  
[/AS]  
to unload/enable  
[AS]on (release) {  
unloadMovie(this);  
\_root.compact.enabled = true;  
}  
[/AS]

If that still don’t work, post your fla and I’ll have a look

scotty(-:
