I have a page with an some normal javascript, a swf file and some jquery.
I’m running my jquery code inside the $(document).ready(function() {}) function. But the code is being run before the Flex component (the swf file) has finished loading. Is there something I’m doing wrong?
Thanks for reading!
The whole point of the “ready” event is to run before elements like images and Flash load. If you don’t like that, use the “load” event instead.
Another approach would be to try and attach a “load” handler to your flex object directly, but I’m not personally sure that’d work properly, and it might be a race condition for the “ready” handler to get the “load” handler set before the content actually does load.