ProfilerAgent Runtime Error when calling unload()
August 10th, 2008 — JimboA few days ago I found an error with the Flex Builder 3 profiling mode.
If you load in a file and in decide to unload it in the same frame (note this is at runtime, not Flash keyframes as this is a Flex Builder Error) you get a Runtime Error that points to the ProfilerAgent class, something I never knew existed until this bug showed up. If you run the code through in debug mode then it works fine, it is only when in profiling that this happens.
I have updated the code for people to see here:
http://www.happyjimbo.com/misc/loading.zip
If you run the Fail.as file in profiling then you will see what I am talking about. I have also included a file called WorkAround.as which stops the bug from happening.
The test waits until the next before it calls the unload() function, which seems to work fine. This is just simply done by an ENTER_FRAME event being run and then killed after it has run once. Not the most elegant of solutions, but it works.
Why is this important? Well you can just press the dismiss button and there does not seem to be any issues.. However I have no confidence at all that the results the profiler is showing are accurate anymore, and in my line of work I need them to be.
I have raised this issue on the Flex Bug and Issue Management System, and the post can be found below, hopefully with details of what Adobe find to be the issue…