0

Anyway, I am developing a very large scale JSFL system. It's over 2,000 lines of code (Uncompressed).

In my application I have a line of code looks like that:

fl.componentsPanel.addItemToDocument({x:pos.left, y:pos.top}, 'User Interface', type);

You can figure out that this line is creating dynamically components and injecting them in a specified position on the stage.

When I create 4-5 components (using a for loop), this line makes my flash CS5.5/CS5 IDE almost crash. My flash gets stuck for a minute almost, but to be fair it's only when i am running my code on a AS3 document only.

I present a time measurement of the execution time:
4 components in AS2 document: 0.49 Seconds
4 components in AS3 document: 61.422 Seconds

Note: When i execute all the 2,000+ lines of code but that exact line i put in comment the JSFL execution time is less than 1 second in AS2 and AS3 versions of the document.

Does anyone have an idea why this line of code has such an evil behavior?

4

0 に答える 0