Added functionality to verify that the swf is loaded and ready and that the js api is ready

change this to `element.eventName === eventName && element.callback` rather than 2 separate `if`s.