Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Flash 8 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-18-2005, 12:38 AM   #1
f3ar
Registered User
 
Join Date: Oct 2005
Posts: 9
Default Removing a button...

Is there any actionscript to remove a button from the timeline? I have an external preloader where I press "load" and it loads the flash page ON TOP of the button....unfortunately you can still access the load button once the page is loaded on top....is there a way to completely remove it from the timeline after it is pressed?

Thanks in advance,
F3ar
f3ar is offline   Reply With Quote
Old 10-18-2005, 04:34 AM   #2
madgett
is my last name...
 
Join Date: May 2004
Posts: 964
Default

You would use destroyObject():
Code:
btn.onPress = function() {
	destroyObject(this._name);
};
madgett is offline   Reply With Quote
Old 10-18-2005, 05:11 AM   #3
f3ar
Registered User
 
Join Date: Oct 2005
Posts: 9
Default

That didn't work, here is the AS I have for my button instanced movie1_btn...

movie1_btn.onPress = function(){
startPreload("home.swf");
destroyObject("movie1_btn");
}

I also tried

destroyObject(this._movie1_btn);

What gives?
f3ar is offline   Reply With Quote
Old 10-18-2005, 05:52 AM   #4
madgett
is my last name...
 
Join Date: May 2004
Posts: 964
Default

destroyObject() is for components. If you manually created a movieclip on the stage then you use movie1_btn.unloadMovie();. It must be a movieclip and not a button instance. If you have to have a button instance, then make sure it is inside a movieclip instance and you can unload the movieclip instance and it will take the button with it.
madgett is offline   Reply With Quote
Old 02-08-2007, 05:37 PM   #5
mekkfabrics
Registered User
 
Join Date: Feb 2007
Posts: 5
Default

Hi, Im new here, from sweden.
Quote:
then make sure it is inside a movieclip instance and you can unload the movieclip instance and it will take the button with it.
How exactly do you do that?
And yes I´m a beginner, almost anyway
mekkfabrics is offline   Reply With Quote
Old 02-08-2007, 08:01 PM   #6
Krisko
ascript noobster :)
 
Krisko's Avatar
 
Join Date: May 2006
Location: Bulgaria
Posts: 109
Send a message via Skype™ to Krisko
Default

I use 2 ways:
Quote:
movie_btn.onPress = function() {
delete this.movie_btn // this is the one way, it's not so good
this.movie_btn._x += 1000 // this is the dodger way
}
__________________
chaos is everywhere.
Krisko is offline   Reply With Quote
Old 02-13-2007, 02:38 PM   #7
mekkfabrics
Registered User
 
Join Date: Feb 2007
Posts: 5
Default

I´m sorry but I cant make it work, where should I put the code, on the timeline? What I want to do is, first to load a movieclip with a button on release that unloads the movieclip and the button at the same time, you know like an ordinary pop up window. my brain is about to explode soon
mekkfabrics is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:23 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.