I am calling this javascript function via ActionScript3 using
ExternalInterface.call()

function writePhotoDB(path) {
        var fo, fso; 
        alert("path="+path);    
        
        // cannot create ActiveX object from Flash
        fso = new ActiveXObject("Scripting.FileSystemObject"); 
        alert("file="+path+"myGallery.xml");
        fo = fso.CreateTextFile(path+"myGallery.xml", true);
        fo.WriteLine(getFileList(path));
        fo.Close();
        return "successful";
}

I get the first alert messagebox, which means that my flex app
successfully called the javascript function, but then it dies. I never
get the IE ActiveX control security warning.

The same function called directly from javascript in a separate page
does the right thing.

my flash is embedded as follows:

<script language="JavaScript" type="text/javascript">
<!--
                AC_FL_RunContent(
                                        "src", "PhotoViewer",
                                        "width", "100%",
                                        "height", "100%",
                                        "align", "middle",
                                        "id", "PhotoViewer",
                                        "quality", "high",
                                        "bgcolor", "#869ca7",
                                        "name", "PhotoViewer",
                                        "allowScriptAccess","always",
                                        "type", "application/x-shockwave-flash",
                                        "pluginspage", 
"http://www.adobe.com/go/getflashplayer";
        );
// -->
</script>
<noscript>
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
                        id="PhotoViewer" width="100%" height="100%"
                
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab";>
                        <param name="allowNetworking" value="all" />
                        <param name="movie" value="PhotoViewer.swf" />
                        <param name="quality" value="high" />
                        <param name="bgcolor" value="#869ca7" />
                        <param name="allowScriptAccess" value="always" />
                        <embed src="PhotoViewer.swf" quality="high" 
bgcolor="#869ca7"
                                width="100%" height="100%" name="PhotoViewer" 
align="middle"
                                play="true"
                                loop="false"
                                quality="high"
                                allowScriptAccess="always"
                                type="application/x-shockwave-flash"
                                
pluginspage="http://www.adobe.com/go/getflashplayer";>
                        </embed>
        </object>
</noscript>

What am I doing wrong?

Reply via email to