A couple corrections:
1. Use && instead of || in the "if" conditional statement
2. In the "else" block, change "in" identifier to a name that isn't a
keyword (e.g. "tempInst").
function removeMofo(mc)
{
var theD = mc.getDepth();
if ( theD > -1 && theD < 1048576)
{
mc.removeMovieClip();
}
else
{
var tempInst = mc._parent.getInstanceAtDepth(100);
mc.swapDepths(100);
mc.removeMovieClip();
if ( tempInst != null)
{
// put it back
tempInst.swapDepths ( 100 );
}
}
}
Francis
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:flashcoders-
> [EMAIL PROTECTED] On Behalf Of JesterXL
> Sent: Thursday, February 09, 2006 10:14 AM
> To: Flashcoders mailing list
> Subject: Re: [FlashCoders] textfield swapDepths
>
> function removeMofo(mc)
> {
> var theD = mc.getDepth();
> if ( mc.getDepth() > -1 || mc.getDepth() < 1048576)
> {
> mc.removeMovieClip();
> }
> else
> {
> var in = mc._parent.getInstanceAtDepth(100);
> mc.swapDepths(100);
> mc.removeMovieClip();
> if ( in != null)
> {
> // put it back
> in.swapDepths ( 100 );
> }
> }
>
> }
>
> ...untested... only works in F7
>
> ----- Original Message -----
> From: "Tom Rhodes" <[EMAIL PROTECTED]>
> To: "'Flashcoders mailing list'" <[email protected]>
> Sent: Thursday, February 09, 2006 12:51 PM
> Subject: RE: [FlashCoders] textfield swapDepths
>
>
> someone posted a function the other day on here that means you can
remove
> clips on a negative depth. the basis of it was a swapdepths before the
> remove as I recall, have a look. might even have been yesterday...
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Scott
> Fanetti
> Sent: 09 February 2006 18:38
> To: Flashcoders mailing list
> Subject: Re: [FlashCoders] textfield swapDepths
>
> WOW!
>
> I never knew Flash would not remove _mcs with negative depth. I just
> tried it and it and it won't work. I guess you learn something new
> every day.
>
> import flash.geom.Rectangle
> import flash.display.BitmapData
>
> _mc = _root.createEmptyMovieClip("rect_mc",30000);
> _bdm = new BitmapData(300,200,false,0xFF0000);
> _mc.attachBitmap(_bdm,0);
>
> _mc.onPress = function(){
> trace("removing")
> this.removeMovieClip();
> }
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com