Re: [FlashCoders] textfield swapDepths
I have a DepthManager that will take care of this. It adds the .swapDepths() method to TextField and Button. More specifically, it replaces the MovieClip.removeMovie() and TextField.removeTextField() methods so that they work at whatever depth. The DepthManager is self-instantiating, but you have to refer to is somewhere in your code or Flash won't include it when you publish. So instead of just doing an import (which doesn't force the class to be included) you can refer to it directly: var dmClass = xt.core.managers.DepthManager; These methods aren't dirty, they're just necessary to overcome some of Flash's shortcommings. See http://codext.com/code/6 Tyler ___ Flashcoders@chattyfig.figleaf.com 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
Re: [FlashCoders] textfield swapDepths
Accidentally discovered a workaround: although you could not apply swapDepth to textField directly, you could do it with help of mc dummy: //text_txt - text field on a timeline var newTFdepth = 1; mc = this.createEmptyMovieClip(dummy, newTFdepth); trace(1 t: + text_txt.getDepth())//traced: -16383 trace(1 mc: + mc.getDepth()) //traces: 1 var oldTFdepth = text_txt.getDepth(); mc.swapDepths( oldTFdepth ); trace(2 t: + text_txt.getDepth());//traces: 1 trace(2 mc: + mc.getDepth());//traced: -16383 - Original Message - From: Dimitrios Bendilas [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 10:51 AM Subject: [Bulk] [FlashCoders] textfield swapDepths Hello everyone, I'm using .swapDepths() on a textfield on the stage, that was not created dynamically, but was placed there from iside the Flash IDE. It's depth doesn't change and it remains negative. Is this how it should work? Thanks, Dimitrios ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com 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
Re: [FlashCoders] textfield swapDepths
Right, this is not what I'm trying to achieve. The issue is only for textfields, not movieclips. I finally managed to find a workaround that works. I used the TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; approach and it worked great! Thanks everyone for the suggestions and discussion. Regards, Dimitrios - Original Message - From: Tareq AlJaber [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 8:56 PM Subject: RE: [FlashCoders] textfield swapDepths So this code is not what you are trying to do,correct? import flash.geom.Rectangle import flash.display.BitmapData _mc = _root.createEmptyMovieClip(rect_mc,-3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } Can you send me a sample file that reproducing the bug? ___ Flashcoders@chattyfig.figleaf.com 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
Re: [FlashCoders] textfield swapDepths
swapDepths can only be applied to movieclips. Put the textfield inside a movieclip and then apply swapdepths to that. -sarah Hello everyone, I'm using .swapDepths() on a textfield on the stage, that was not created dynamically, but was placed there from iside the Flash IDE. It's depth doesn't change and it remains negative. Is this how it should work? Thanks, Dimitrios ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [FlashCoders] textfield swapDepths
Hi Sarah, Thanks for your answer. Unfortunately this is not an option. So, I thought I'd create a dynamic textfield in the depth I want, copy all properties from the original textfield to the new one and set .text = for the original textfield (unfortunately removeMovieClip doesn't work either). I'm having some trouble making an exact duplicate of the first field, but I think I'll manage it. Thanks again. Regards, Dimitrios - Original Message - From: [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 6:44 PM Subject: Re: [FlashCoders] textfield swapDepths swapDepths can only be applied to movieclips. Put the textfield inside a movieclip and then apply swapdepths to that. -sarah Hello everyone, I'm using .swapDepths() on a textfield on the stage, that was not created dynamically, but was placed there from iside the Flash IDE. It's depth doesn't change and it remains negative. Is this how it should work? Thanks, Dimitrios ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [FlashCoders] textfield swapDepths
Dimitirios, Have you considered loading a blank movieclip into the textfields depth then removing the movieclip? Loading the mc into that depths should clear that depth then removing the mc should clear that memory ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [FlashCoders] textfield swapDepths
i dont think removeMovieClip or swapDepths works if the object is on a negative level On 2/9/06, Scott Fanetti [EMAIL PROTECTED] wrote: Dimitirios, Have you considered loading a blank movieclip into the textfields depth then removing the movieclip? Loading the mc into that depths should clear that depth then removing the mc should clear that memory ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [FlashCoders] textfield swapDepths
Hey, Thanks everyone for your suggestions. Tom, in order to remove the textfield, as you say, you will have to swapDepths() first, which unfortunately doesn't work on TextFields. That's why I started this thread in the first place. I just found this suggestion in a forum: TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; A little hack that lets you swap textfields. Didn't try it yet but I guess it works. Do you all think it's something I wouldn't mind putting in? Or is it too dirty? I think it's ok. Dimitrios - Original Message - From: Tom Rhodes [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 7: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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com Unsubscribe, set options at 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
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' flashcoders@chattyfig.figleaf.com 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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com 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
RE: [FlashCoders] textfield swapDepths
oops, sorry, I'd wrap it in a clip then... -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Bendilas Sent: 09 February 2006 19:04 To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths Hey, Thanks everyone for your suggestions. Tom, in order to remove the textfield, as you say, you will have to swapDepths() first, which unfortunately doesn't work on TextFields. That's why I started this thread in the first place. I just found this suggestion in a forum: TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; A little hack that lets you swap textfields. Didn't try it yet but I guess it works. Do you all think it's something I wouldn't mind putting in? Or is it too dirty? I think it's ok. Dimitrios - Original Message - From: Tom Rhodes [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 7: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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com Unsubscribe, set options at 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [FlashCoders] textfield swapDepths
Why in the first place you want to use negative depth? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Bendilas Sent: Thursday, February 09, 2006 10:04 AM To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths Hey, Thanks everyone for your suggestions. Tom, in order to remove the textfield, as you say, you will have to swapDepths() first, which unfortunately doesn't work on TextFields. That's why I started this thread in the first place. I just found this suggestion in a forum: TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; A little hack that lets you swap textfields. Didn't try it yet but I guess it works. Do you all think it's something I wouldn't mind putting in? Or is it too dirty? I think it's ok. Dimitrios - Original Message - From: Tom Rhodes [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 7: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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com Unsubscribe, set options at 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [FlashCoders] textfield swapDepths
I don't have the option to create the textfield dynamically. So I have to put it there from the Flash IDE and it automatically gets a negative depth, like all instances that are created this way. Dimitrios - Original Message - From: Tareq AlJaber [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 8:28 PM Subject: RE: [FlashCoders] textfield swapDepths Why in the first place you want to use negative depth? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Bendilas Sent: Thursday, February 09, 2006 10:04 AM To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths Hey, Thanks everyone for your suggestions. Tom, in order to remove the textfield, as you say, you will have to swapDepths() first, which unfortunately doesn't work on TextFields. That's why I started this thread in the first place. I just found this suggestion in a forum: TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; A little hack that lets you swap textfields. Didn't try it yet but I guess it works. Do you all think it's something I wouldn't mind putting in? Or is it too dirty? I think it's ok. Dimitrios - Original Message - From: Tom Rhodes [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 7: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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com Unsubscribe, set options at 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [FlashCoders] textfield swapDepths
So this code is not what you are trying to do,correct? import flash.geom.Rectangle import flash.display.BitmapData _mc = _root.createEmptyMovieClip(rect_mc,-3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } Can you send me a sample file that reproducing the bug? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Bendilas Sent: Thursday, February 09, 2006 10:34 AM To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths I don't have the option to create the textfield dynamically. So I have to put it there from the Flash IDE and it automatically gets a negative depth, like all instances that are created this way. Dimitrios - Original Message - From: Tareq AlJaber [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 8:28 PM Subject: RE: [FlashCoders] textfield swapDepths Why in the first place you want to use negative depth? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dimitrios Bendilas Sent: Thursday, February 09, 2006 10:04 AM To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths Hey, Thanks everyone for your suggestions. Tom, in order to remove the textfield, as you say, you will have to swapDepths() first, which unfortunately doesn't work on TextFields. That's why I started this thread in the first place. I just found this suggestion in a forum: TextField.prototype.swapDepths = MovieClip.prototype.swapDepths; A little hack that lets you swap textfields. Didn't try it yet but I guess it works. Do you all think it's something I wouldn't mind putting in? Or is it too dirty? I think it's ok. Dimitrios - Original Message - From: Tom Rhodes [EMAIL PROTECTED] To: 'Flashcoders mailing list' flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 7: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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com Unsubscribe, set options at 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [FlashCoders] textfield swapDepths
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 -1theD 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' flashcoders@chattyfig.figleaf.com 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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [FlashCoders] textfield swapDepths
Tag team baby! Thanks Francis. - Original Message - From: Francis Cheng [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 3:55 PM Subject: RE: [FlashCoders] textfield swapDepths 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 -1theD 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' flashcoders@chattyfig.figleaf.com 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,3); _bdm = new BitmapData(300,200,false,0xFF); _mc.attachBitmap(_bdm,0); _mc.onPress = function(){ trace(removing) this.removeMovieClip(); } ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [FlashCoders] textfield swapDepths
Ah, gotcha -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of JesterXL Sent: February 9, 2006 4:52 PM To: Flashcoders mailing list Subject: Re: [FlashCoders] textfield swapDepths Although you can put mc's in depths higher than 1048575, you cannot remove them, just like negative depths, so you have to use that as the ceiling. - Original Message - From: Scott Hyndman [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Thursday, February 09, 2006 4:40 PM Subject: RE: [FlashCoders] textfield swapDepths if ( theD -1theD 1048576) Is there ever a case where theD would be higher that -1 and not lower than 1048576? Seems to me the extra comparison isn't even necessary. Scott ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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