Button loadMovie question

Okay, I have a Button outside the MC,

When You click it… it loads something in the the MC. Can I have the button disapear once I click it and it loads the new movie?

So far the code is:

on (release){
entrance.loadMovie (“bio.swf”)
}

Or if there is no way to do this, can I have the buttons IN the MC, and when clicked it loads the new MC in the same ‘entrance’ mc but from inside it… ?

yes. just put a delete in front of it

[AS]
delete this.myButtonName;
[/AS]

Should do it. Replace this with the location of you button on the timeline. _root etc

use [AS]this._visible = false[/AS]

If it is a movie clip symbol acting as a button you can swap it to a removable depth then use removeMovieClip() on it to remove it for good, but as far as I know, button symbols can’t be removed via AS, on hidden.

grandsp5: delete is used for deleting variables and dynamic event handlers, etc, etc. You can’t use it to delete a clip from the stage.

If I am wrong about any of this, sorry, the cold medication has kicked in :hangover:

oh ok.

Didn’t we talk about this already, Shane? :-
[AS]Button.prototype.removeButton = MovieClip.prototype.removeMovieClip;
Button.prototype.swapDepths = MovieClip.prototype.swapDepths;
//
myButton.swapDepths(100);
myButton.removeButton();[/AS]
Right… the Tylenol. :wink:

Yeah, we did, and we also talked about me being an idiot before too, so we see that is true too :wink:

So, I use the one above?
And where do I apply it?

Just a bit more info please?

Hey kax, can you explain what that code does real fast? It turns the button into a movie clip, swaps the depth, and them removes it?

  • RussianBeer
    Paste this code in the first frame of the movie:
    [AS]Button.prototype.removeButton = MovieClip.prototype.removeMovieClip;
    Button.prototype.swapDepths = MovieClip.prototype.swapDepths;[/AS]
    It doesn’t necessarily have to be first frame, just make sure you put before you call those methods.

To remove the Button, use this code:
[AS]myButton.swapDepths(100);
myButton.removeButton();[/AS]
Where myButton is the instance of the Button you’d like to remove.

  • grandsp5
    No, it doesn’t turn the Button into a MovieClip. I’m just copying the MovieClip methods, removeMovieClip and swapDepths, to the Button object. After that, yes, it swaps the Button to a removable depth (0 to 1048575) and removes it.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=16877