Re: [Flashcoders] What don't I understand about the display list?

2007-02-26 Thread Tim Consolazio
If you're doing this in the same frame, the fact that the object is no 
longer on the displaylist may not have been updated yet.


Try moving the code throwing the error into the childRemove event.

Daniel Thompson wrote:

Why will the following error be thrown? Shouldn't the displayObject be null?


  try {
removeChild(getChildByName(background));
  } catch (typeError:TypeError) { 
// do nothing

  }

  var displayObject:DisplayObject = getChildByName(background);
  if (displayObject) {
throw new Error(Why!?!);
  }


___
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] What don't I understand about the display list?

2007-02-25 Thread Daniel Thompson
Why will the following error be thrown? Shouldn't the displayObject be null?


  try {
removeChild(getChildByName(background));
  } catch (typeError:TypeError) { 
// do nothing
  }

  var displayObject:DisplayObject = getChildByName(background);
  if (displayObject) {
throw new Error(Why!?!);
  }


___
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