How to control a swf in html via a firefox extension?

I want to click a button in a swf file via a firefox extension, and i have tried a method like this(GitHub – schellingb/SWFAutomation: Flash Automation in a Browser with JavaScript, C++, Python or AutoHotkey ), the process is just like below:(in firefox)

  1. install flash_debug version;
  2. download SWFAutomationPreload_Interactive.swf from github;
  3. create mm.cfg file (maybe some parameters are unnecessary, it doesn’t matter…);

    AssetCacheSize=20
    AutoUpdateDisable=0
    AutoUpdateInterval=-1
    AVHardwareDisable=0
    DisableDeviceFontEnumeration=0
    DisableProductDownload=0
    ErrorReportingEnable=1
    FileDownloadDisable=0
    FileUploadDisable=0
    FullScreenDisable=0
    LocalFileReadDisable=0
    LocalStorageLimit=6
    MaxWarnings=500
    PolicyFileLog=1
    PolicyFileLogAppend=1
    ProtectedMode=0
    SuppressDebuggerExceptionDialogs=1
    TraceOutputFileEnable=1
    TraceOutputFileName=C:Users....flashlog.txt
    AllowUserLocalTrust=1
    PreloadSwf=C:Users....SWFAutomationPreload_Interactive.swf

    Then I can send a click event in firefox web console like this:
    firefox web console

  4. next develop my extension, I call the function like this ( in a .js file ):

    function updateBg(request, sender, sendResponse) {
    document.getElementsByTagName('object')[0].inj_click('toggle_btn');
    }

but it doesn’t work, then I find that function ink_click is active in the web console while not active in my extension:
(1) in web console, run:
var aa = document.getElementsByTagName('object')[0];console.dir(aa.inj_get);
result like this: call in web console

(2) in my extension:
result like this: call in extension

you can see the function is not define or could not found. And maybe this is a clue,run:
var bb = document.getElementsByTagName('object')[0];alert(bb.inj_get);
result like this: alert “native code”

native code ???

About the SWFAutomationPreload_Interactive.swf, core code is like this:as3 code

private function init(e:Event = null):void 
{
    //mylog('[init]');
    if (e) removeEventListener(Event.ADDED_TO_STAGE, init);
    stage.addEventListener("allComplete", allCompleteHandlerMain);
    addEventListener("allComplete", allCompleteHandlerMain);
}

private function allCompleteHandlerMain(e:Event):void 
{
    //mylog('[allCompleteHandlerMain]');
    if (!e || !e.target || !(e.target is LoaderInfo)) { mylog('[allCompleteHandlerMain] NO TARGET ' + e.target); return; }
    if (!e.target.url) { /*mylog('[allCompleteHandlerMain] NO URL ' + e.target + ' (loaderURL: ' + e.target.loaderURL + ')');*/ return; }
    try
    {
        var loader:LoaderInfo = (e.target as LoaderInfo);
        if (!loader.content) { mylog('[allCompleteHandlerMain] NO CONTENT IN TARGET ' + e.target + '(url: ' + e.target.url + ' - loaderURL: ' + e.target.loaderURL + ')'); return; }
        if (!loader.content.stage) { /*mylog('[allCompleteHandlerMain] NO STAGE IN TARGET ' + e.target + '(url: ' + e.target.url + ' - loaderURL: ' + e.target.loaderURL + ')');*/ return; }
    }
    catch (ex:*) { mylog('[allCompleteHandlerMain] EXCEPTION IN TARGET ' + e.target + '(url: ' + e.target.url + ' - loaderURL: ' + e.target.loaderURL + ') [' + ex + '][' + ex.getStackTrace() + ']'); return; }
    if (loader.content.stage == loaderstage) { /*mylog('[allCompleteHandlerMain] SKIPPING ' + loader.url + ' (BY ' + loader.loaderURL + ' )');*/ return; }
    loaderstage = loader.content.stage;
    loaderdomain = loader.applicationDomain;
    Security.allowDomain("*");
    ExternalInterface.addCallback("inj_click",       inj_click);
    CONFIG::interactive { debug_setup(); }
    mylog('[allCompleteHandlerMain] ADDED CALLBACKS TO ' + e.target + '(url: ' + e.target.url + ' - loaderURL: ' + e.target.loaderURL + ')');
}

it listens “allcomplete” event, and add callback function.

So, how can i call inj_click in my extension ???
Maybe it is a question about flash privacy settings….
Hope some one can help me. Thank u.