In the Adobe bug system (http://bugs.adobe.com/jira/browse/FP-444) i
found promising solution by Pavel Simek
>>
Please add an "onerror" parameter to Flash Player parameters that can be
assigned by a javascript function name. Any error is then passed to this
function (only if "allowscriptaccess" is set to true, of course). Then,
developer can pass the error object back to Flash via ExternalInterface.
Simple, sufficient. Inspired by Silverlight.
<<
I think tat onerror is error event handler of <object/> tag. I'm
testing but plashplayer nothing executes. Below my code. I think that
someone tested with maybe with success
<object height="100%" width="100%" allowscriptaccess="always"
onerror="onFlashPlayerError" name="swf" id="swf"
data="ErrorInSpriteTest.swf" type="application/x-shockwave-flash"><param
value="ErrorInSpriteTest.swf" name="movie"/><param value="always"
name="allowScriptAccess"/><param value="debug=true"
name="flashvars"/></object>
package {
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.external.ExternalInterface;
import flash.utils.setTimeout;
[SWF(width=500, height=500, backgroundColor=0x000000)]
public class ErrorInSpriteTest extends Sprite {
public function ErrorInSpriteTest() {
super();
ExternalInterface.call('onFlashPlayerError', 'test js
handle')
var s:Sprite=new Sprite()
addChild(s)
s.graphics.beginFill(0xffffff)
s.graphics.drawCircle(100, 100, 50)
s.graphics.endFill()
s.addEventListener(MouseEvent.MOUSE_DOWN,
function(e:MouseEvent):void {
triggerError('trigger 3')
})
setTimeout(triggerError, 1000, 'trigger 2')
}
private function triggerError(msg:String):void {
throw new Error(msg)
}
}
}
firebug console traces 'test js handle' but nothing more