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:
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…
Check this thread…
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=23538
This is my first day on kirupa forum.
Its wonderful to have people that like to help the others!
Thanks a lot
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?
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.
yea it is… u can use the when totalbytes == loadedbytes set a variable to true… and thus u know that its loaded…
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!
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?
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?
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…
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. Ill 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
Hi everybody:)
This the continuation of button.enable = false?.. thread.
Im 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:
try zipping it, if that doesn’t work, email it to me:
liam @ vmkdsn . com (remove spaces)
and i’ll attach it for you.
here is felipe’s file:
pretty slick, i might add