Button script please

hi guys

can some please help me out with a action script.
it so that when hit a button it will display the file that sits in the the libary. but if they hit anthor button then that file go away and the other file will apper.

thanks guys

me wrong

On the main timeline …

[AS]
button1.onRelease = function(){
holder.removeMovieClip();
holder.attachMovie(“linkageID1”,“movie1”,1);
}
button2.onRelease = function(){
holder.removeMovieClip();
holder.attachMovie(“linkageID2”,“movie2”,1);
}
[/AS]

thanks for the reply but i will need a bit more help as i dont know how to place action script or what the script is tell what to do.

should i put this srcipt on each button and then how will it know what file in the libary to open in the movie.

then also if u open button 2 will the file for button 1 go away or will it load on top

thanks

Wouldn’t it be easier just to make your buttons, then put an empty movieClip on the stage and put this action on the button?


on(release){
_root.movieClipName.loadMovie("file.swf");
}
//then on the other button
on(release){
_root.movieClipName.loadMovie("otherfile.swf");
}

movies will automatically unload themselves when another is loaded in…
:stuck_out_tongue:

Yes Freddy, that would indeed be easier, but he asked from the library … Though robbie, Freddy is right, it would be better to load them externally, especially for your filesize.

Here’s another way to do it. On the main timeline …
[AS]
this.createEmptyMovieClip(“holder”,1);
//creates an empty movieclip on the main timeline
holder.loadMovie(“file1.swf”);
//loads the initial file
mc = 1;
//sets a var to check the current mc
button1.onRelease = function(){
if(mc==2) {
holder.loadMovie(“file1.swf”)
mc=1;
}
}
button2.onRelease = function(){
if(mc==1){
holder.loadMovie(“file2.swf”)
mc=2;
}
}
[/AS]

*Originally posted by robbie star *
**thanks for the reply but i will need a bit more help as i dont know how to place action script or what the script is tell what to do.

should i put this srcipt on each button and then how will it know what file in the libary to open in the movie.

then also if u open button 2 will the file for button 1 go away or will it load on top

thanks **

I think it’s time to hit the basic AS tutorials.

hi guys

i have tryed but cant get it to work. ok i know im dum but i am trying. i thought i would post the fla file see if u guys could help me a bit more. what i need is when click on the button that says (QUEM SOMOS) it will load (TEXT 1) that is in the libary. but also i need it to go away when they press any of the other buttons.

Please Please help i have been all day pulling my hair out with this. im nearly bold

Thanks

FLA ? Where ? :wink:

how do you add a fla file on the message thread

Ahhh…I didn’t see the library thing, my bad…
Robbie, hit post reply and then at the bottom of the post form there’s a ‘browse’ button - hit it, click on the fla. (-:

he sorry im in such a mess that i didnt even see that

thanks

heres the fla

It’s still not there :-\

it will not send as its too big

I got your PM and I don’t mind, however, you never said which way you want to do. Did you want to load from the library, or externally? Because if you want to load the pics externally, you won’t have to send anybody anything. There’s a tut here on how to do it and about a thousand threads to show you how - it’s fairly simple.

Voetsjoeba? What’s going on with your footer? Server down? My SQL’s down too. :m:

Realises Yes ! I knew it was down but I didn’t think of my footer since I browse these forums with signatures off. Thanks for reminding me =)

Removes footer