Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UnloadMovieClip VS removeClip

Status
Not open for further replies.

fireburner69

Programmer
Aug 22, 2002
108
0
0
GR
Hello,
my problem is that:
I am playing around with some buttons and I use one to duplicate a mc with this code.
var mc_name:String = "demo";
duplicateMovieClip(_level0.target_mc,mc_name,_level0.getNextHighestDepth());

Everything is smooth and working fine.
Inside this target_mc I have a close button.
And I have stored this code:
on(press){
unloadMovie(this);
//removeMovieClip(this);
}

Well the unloadMovie is not working!!
When I try the 2nd one it is fine but after that I can not recreate the mc with the duplicate.

What I am doing wrong?

Have in mind that with the same method I have used it to create a button and its working ok!

I can not understand why this is not working!?

Thanks in advance for your help.
 
1st of all sorry to the title I know its wrong!
And second
I have made a mistake.
The command that is NOT working is removeMovieClip(this);
And the one that works but not exacly how I wanted it to is unloadMovie(this);

Thanx again!
 
Have you tried...

_level0.mc_name.removeMovieClip();

mc_name being the name you gave the duplicate when creating it?

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
on(press){
_level0[this._parent].removeMovieClip();
trace(this._parent);
}
also tried
on(press){
_level0[this._parent._name].removeMovieClip();
trace(this._parent);
}

And again its not working.

You see I create hte movie with dynamic names and thats why I do not use direct reference to the mc!

Nothing is working! :(
 
Can you post a link to a MX only (not MX2004) small mockup .fla replicating the problem?

You'd have a better chance of getting an answer if your .fla was in a MX only format, and zipped up.

You would have to save a copy of your MX2004 .fla, (using Save as...) and changing the Document type to MX only in the Save as... window.


Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top