onYouTubePlayerReady
is not a SWFObject method, it is an independent method supplied by YouTube's player API.
Your issue probably comes down to timing -- since onYouTubePlayerReady
is part of the YouTube player API, it will not be available until the SWF has finished loading and ExternalInterface has been initialized by Flash Player.
SWFObject's callbackFn
simply executes when the <object>
has been successfully added to the page's markup, and does not indicate the SWF has loaded. In fact, SWFObject does not pay attention to whether the SWF loads at all.
However with a little bit of extra JavaScript you can poll the SWF to detect whether it has finished loading, then execute your custom script (in this case onYouTubePlayerReady
).
This Stack Overflow thread discusses the polling, and here's a short tutorial explaining how to poll after embedding a SWF via SWFObject.