Why some function have been called
1 Create a project use flex sdk 3.4
2 Create a new mxml app Testadd.mxml
3 Add a source jpg Any.jpg
content of Testadd.mxml just two line.
[Embed(source="Any.jpg")]
public var NotUsedSource:Class;
I think this just defined a class which represent some data. And I never use it or initialize any instance of it in this app.
开发者_如何学编程4 Profile this app, when it is profiling I click the resize button of IE servral times.
5 From the profiled data a function named Testadd_NotUsedSource.flash.events:IEventDispatcher:dispatchEvent is been called
6 My question is why this function has been called.
I have the screenshot but can't add to this post.
If the application is resizing, it's dispatching resize events. If there are any controls inside it, they might also be dispatching resize or moving events.
If you're moving your mouse around, it's dispatching mouseMove events.
Events happen a lot, it's normal.
精彩评论