Nelp Help with loading movies from a Button

Ok…Here goes…

I have I have about 5 buttons on the page and I want each of them to load seperately in a little window underneath. I can make them load inside then window but after it loads, the button is still active and if I click it, it loads the movie again. How do I make it so that the button, when clicked, loads the movie once and then becomes inactive, so that i can’t click it again, then when another button is clicked, becomes active again?

Can anybody please help me with my problem???!

On the button I am using this…

on (release) {
_root.contents.loadMovie
(“home.swf”)
}

That is for the first button. HELP!!!

couple ways to do it. You could just stick on the button
[AS]
on (release) {
_root.contents.loadMovie;
this.enabled = false;
(“home.swf”)
}
[/AS]
but then once you click it, you cant click it again. You would need another few staments enabling all the other buttons. Unless you want to create some new variables to check which movie in in contents, i would reccomend doing it this way.

[AS]
on (release) {
_root.contents.loadMovie;
this.enabled = false;
button2.enabled = true;
button2.enabled = false;
//etc etc for all other buttons buttons
(“home.swf”)
}
[/AS]

This will disable the one you click and enable the others
[AS]buttons_array = [“home”, “profile”, “contact”];//your buttons instance names
function enableButton() {
this.enabled = false;
for (var i in buttons_array) {
if (this._parent[buttons_array*]._name != this._name) {
this._parent[buttons_array*].enabled = true;
}
}
}
for (var j in buttons_array) {
this[buttons_array[j]].onPress = enableButton;
}[/AS]

Ops, i didnt pay attention to your question… place the buttons onstage and an empty movie clip with an instance name of contents. Now if you press home, home.swf will be loaded into contents. Same for other buttons.[AS]buttons_array = [“home”, “profile”, “contact”];
function enableButton() {
this.enabled = false;
this._parent.contents.loadMovie(new String(this).substring(8, this.length)+".swf");
for (var i in buttons_array) {
if (this._parent[buttons_array*]._name != this._name) {
this._parent[buttons_array*].enabled = true;
}
}
}
for (var j in buttons_array) {
this[buttons_array[j]].onPress = enableButton;
}[/AS]
Hope it helps.
:slight_smile:

It didn’t work…maybe its because I am doing something wrong somewhere else or something, but… I really need to get this to work. I just need AS for each button to load a its own movie in a small window. I am using the empty movie clip. but I need the button that the user clicks on to become inactive after clicked. So if someone could write the AS out for me or anything. I don’t care…anything can help. Thank you very much!!!

The buttons are…
Home
Downloads
Events
Speak Your Mind

THANK YOU VERY MUCH FOR HELPING!!! :goatee:

Can you post the fla?

[edit] my code should work :-\ [/edit]

Not attached…
Paste this code on the main timeline.
Remember to use the same instance names for your buttons as it is inside the array:[AS]buttons_array = [“Home”, “Downloads”, “Events”, “Speak Your Mind”];//your buttons INSTANCE names
function enableButton() {
this.enabled = false;
this._parent.contents.loadMovie(new String(this).substring(8, this.length)+".swf");
for (var i in buttons_array) {
if (this._parent[buttons_array*]._name != this._name) {
this._parent[buttons_array*].enabled = true;
}
}
}
for (var j in buttons_array) {
this[buttons_array[j]].onPress = enableButton;
}[/AS]

Wow hey It worked now…Thank you…

welcome :stuck_out_tongue: