# Button.enable = false?

**URL:** <https://forum.kirupa.com/t/button-enable-false/21145>\
**Category:** Uncategorized\
**Created:** [May 16, 2003, 5:08pm UTC](https://forum.kirupa.com/t/button-enable-false/21145 "2003-05-16T17:08:21Z")\
**Posts on this page:** 15\
**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 16, 2003, 5:08pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/1 "2003-05-16T17:08:21Z")

</div>

I have an empty movieclip “loadswf” in which swf files are loaded. I also have a navigation bar that control this movieclip (returns and advances the loaded swf). How can I disable this buttons when there is no swf loaded inside my “loadswf”? Is there any code that checks if an movieclip is empty? Is there a way to do this? :q:

---

<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 16, 2003, 7:44pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/2 "2003-05-16T19:44:46Z")

</div>

cant u jsut use a variable? to check it  
… like if something is loaded… ( set a variabled and give it a true value ) and then put a code sayin if that variable is true then enable button otherwise disable button… or how ever u want it…

---

<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 16, 2003, 8:47pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/3 "2003-05-16T20:47:37Z")

</div>

Check this thread…

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23538](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23538)

---

<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 16, 2003, 10:02pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/4 "2003-05-16T22:02:06Z")

</div>

This is my first day on kirupa forum.  
Its wonderful to have people that like to help the others!

Thanks a lot

---

<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 16, 2003, 10:50pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/5 "2003-05-16T22:50:10Z")

</div>

The problem is that the external swf files load into an empty mc.  
The empty movieclip “loadswf” is loaded to the stage on startup.  
I have to check if something is loaded in the “loadswf”!!!  
Is this possible?

---

<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 16, 2003, 11:48pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/6 "2003-05-16T23:48:40Z")

</div>

Hmm, I don’t think there is a way to tell if there is a movie loaded to an empty clip. As jazzman said you would have to use a variable to determine that.

Something like creating a variable on the timeline called hasMovie and setting its default value to “false” (if no movie is loaded in to begin with).

[AS]var hasMovie = false;[/AS]

Then when you load a movie to the clip set the hasMovie variable to true. Then when you unload the movie from the clip reset the hasMovie variable back to false.

---

<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 17, 2003, 12:01am UTC](https://forum.kirupa.com/t/button-enable-false/21145/7 "2003-05-17T00:01:25Z")

</div>

yea it is… u can use the when totalbytes == loadedbytes set a variable to true… and thus u know that its loaded…

---

<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 17, 2003, 12:50am UTC](https://forum.kirupa.com/t/button-enable-false/21145/8 "2003-05-17T00:50:13Z")

</div>

I forgot to tell you that this is a cd-rom aplication.  
(I dont know if this matters. Maybe it does!)  
So it would check if the swf inside the mc has been loaded completely, and then would enable the buttons. I would have to use if conditions and I bad at this! Could u give me a code clue? Another question: the path to this loaded swf is the instance name of the empty mc, isn`t it?

Thankx for helping guys!

---

<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 17, 2003, 4:18am UTC](https://forum.kirupa.com/t/button-enable-false/21145/9 "2003-05-17T04:18:12Z")

</div>

If the files are on your always going to be loaded off of your computer, then chances are you don’t even need a preloader. When loaded locally on a system all the files should load instantaneously.

And I am not sure I understand, you say you have to check if the file loaded is complete before enabling the buttons? How is your movie set up if this is the case?

---

<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 17, 2003, 4:37am UTC](https://forum.kirupa.com/t/button-enable-false/21145/10 "2003-05-17T04:37:50Z")

</div>

First read jazzman121 post: “yea it is… u can use the when totalbytes == loadedbytes set a variable to true… and thus u know that its loaded…”  
What I need is - to check if there is a swf loaded into the empty mc on the stage. This way I could set a variable that would enable and disable the swf control buttons. I have a mc “nav\_content” that contains four buttons. This buttons control the swf that is attached to the “loadswf” mc. According to jazzman121 post, if I compair the totalbytes to loadedbytes I could control them. Is this right?

---

<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 17, 2003, 12:39pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/11 "2003-05-17T12:39:21Z")

</div>

ok … since its a cd rom u wont need to make a preloader … and for ur buttons… since u want the buttons to be disabled when a swf is not loaded…

can u explain or show us the setup of ur movie… if ur using the buttons to load ur movie clip and if its disabled how will the user load it?? if its being loaded using other buttons or onEnterFrame… then before the swf loads… just put a set a variable to “true”… and have a fuction on the buttons checking if the variable is true or false…

where the buttons are ( on that frame ) u can have a fucntion

onEnterFrame = function () {  
if (swfhasloaded = “true”) {  
button.enabled;  
}  
};

If that makes sense… if u could post ur swf … or a dummy one… then we can understand the way ur movie is setup…

hope this helps…

---

<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 17, 2003, 4:07pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/12 "2003-05-17T16:07:50Z")

</div>

There are two areas of naviagation.  
The bottom one (A) controls the main nav.  
The top one © controls the content loaded into the “loadswf”.  
If no swf has been loaded, I want the buttons in the top nav to be disabled.  
Thats all. I`ll make some changes in my swf and as soon as it`s finished, I`ll post it here ( but how do I attach a file?)

Thankx for the 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:** [May 18, 2003, 12:21am UTC](https://forum.kirupa.com/t/button-enable-false/21145/13 "2003-05-18T00:21:28Z")

</div>

Hi everybody:)  
This the continuation of button.enable = false?.. thread.  
I`m trying to attach a swf file in this thread but I receive a message alerting that the file has to be a gif or jpeg! It`s 16Kb only.  
Can someone help me attaching this file?

Thanks:player:

---

<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 18, 2003, 1:04am UTC](https://forum.kirupa.com/t/button-enable-false/21145/14 "2003-05-18T01:04:06Z")

</div>

try zipping it, if that doesn’t work, email it to me:

liam @ vmkdsn . com (remove spaces)

and i’ll attach it for you.

---

<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 18, 2003, 4:31pm UTC](https://forum.kirupa.com/t/button-enable-false/21145/15 "2003-05-18T16:31:07Z")

</div>

here is felipe’s file:

pretty slick, i might add 😉
