animatorgeek
02-12-2008, 02:55 AM
I'm getting a weird error on a command I'm developing. I'm iterating through all the elements in a frame and acting on just the SymbolInstance elements. As such, I've got this line in my code:
if(foo instanceof SymbolInstance)
It works fine, right up until foo is a Shape rather than a SymbolInstance. When that happens the script stops running without any indication that it has (I only tracked it down with trace calls and figured out that it's halting on that line). Then the stage stops updating properly -- the selection boxes don't get refreshed when I click on a new object, though it does show up in the properties box. The display updates correctly only if I drag the display such that the selection is off-screen and then I drag it back on. Eventually, after I've run into this error, Flash will freeze up and crash.
So the question is, why would this cause an error like this? I would expect it would be a foolproof test to make -- it either is or isn't an instance of SymbolInstance. I'm not even dealing with subclasses here.
Any ideas?
if(foo instanceof SymbolInstance)
It works fine, right up until foo is a Shape rather than a SymbolInstance. When that happens the script stops running without any indication that it has (I only tracked it down with trace calls and figured out that it's halting on that line). Then the stage stops updating properly -- the selection boxes don't get refreshed when I click on a new object, though it does show up in the properties box. The display updates correctly only if I drag the display such that the selection is off-screen and then I drag it back on. Eventually, after I've run into this error, Flash will freeze up and crash.
So the question is, why would this cause an error like this? I would expect it would be a foolproof test to make -- it either is or isn't an instance of SymbolInstance. I'm not even dealing with subclasses here.
Any ideas?