-
Farmer
Today's insane Flash bug
Hey guys,
So I'm writing some code that involves entities and subentities. Today i noticed a thing that, when i deleted my entity, the subentities were still on the screen.
I thought, "how strangely odd, i'd better check my destroying code".
so i ramble over to my Destroy() function and put in a simple trace("hello"); in the loop where i loop over my subentities to destroy them. Run the program again, lo and behold, the trace() gets called and my subentities are destroyed and removed from the screen.
I thought, "my, how perplexing".
I removed the trace() and reran the program. voila, the subentities are no longer destroyed and remain on screen.
So there you have it. code that only runs when there's a trace statement inside it. Thanks flash!
[footnote: this only happens to me when i'm running in debug, so i thought "fiddlesticks and daisies, i'm not fixing that"]
-
Senior Member
I hear that. I had an error yesterday that kept me working into the night. Turns out, flash didn't like to load a file the a certain string in the name. No code to tell it not to, it just didn't want to. Go figure.
-
Farmer
Back again like a renegade master with another insane bug.
I was trying to test a gui component that would scroll a list of items. as my list doesn't contain enough objects at the minute to make it scroll (and making the xml for the objects on the list takes some time), i decided to create some fake ones - essentially drawn squares of the right size.
So in my LoadItems() function, i add the following code to the start of the function:
Code:
for ( var i:int = 0; i < 15; i++ )
{
// create fake item
this._AddToShowingList( [fake item] );
}
return;
I run the code, and when i get to the section i want, bam! Reams of a stack trace in the output panel followed by the wonderfully informative error
VerifyError: Error #1058: Illegal operand type: * must be an int
Turns out from the Adobe runtime errors bible it actually means that the swf has been corrupted.
What could have corrupted the swf, i wonder? surely it couldn't have been that wonderfully complex if statement at the start? no actually, it was including a return statement after it.
I thought that perhaps you could only put a return statement at the end of a block of code (like an if, for etc), so i tried separating it out into it's own project to test this, but no joy. I've no idea why it's triggered here
\o/
-
Farmer
also, if i change the code slightly to:
Code:
for ( var i:int = 0; i < 15; i++ )
{
// create fake item
this._AddToShowingList( [fake item] );
if( i == 14 )
return;
}
it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|