macromedia.coldfusion.flash_integration
[Top] [All Lists]

Re: Flash Form and Navigation Button Issue (DoFSCommand)

Subject: Re: Flash Form and Navigation Button Issue (DoFSCommand)
From: "bryn50" <webforumsuser@xxxxxxxxxxxxxx>
Date: Thu, 9 Aug 2007 19:45:53 +0000 (UTC)
Newsgroups: macromedia.coldfusion.flash_integration

Try the attached script.

 I remain convince that for some reason Adobe have nobbled (technical term) the 
functiningf of the external interface in flash forms  Dont know why, but 
unexplained.
 Neither externalinterface nor fscommand seem to work as best I can tell. (see 
attached).

 Cheers,
 BP

 <html>
 <head>
 <title>my test page</title>
 <cfajaximport tags = "cfform">
 <script language="JavaScript" charset="utf-8">
 <!--

     function callApp() {
                alert("Hello ?");
         var x = myflashform.myFlexFunction();
         alert(x);
     }
        function myJavaScriptFunction() {
                alert("Hello World");
        }
        
        function myflashform_DoFScommand(command, parameters) {
                alert("Flash called me" + command);
        }

 //-->
 </script>

 </head>
 <body> 

 <cfform action="p2action.cfm" method="POST" name="myflashform" height="100" 
width="500" format="Flash" style="themeColor:##2B52FF;" skin="haloBlue" 
id="myflashform" wmode="transparent">
 <cfformitem type="script">
    import mx.external.*;
    public function myFunc():Number {
         return 42;
    }
    
    function initApp() {
                alert("Hello from initApp" + myFunc() );
                if (mx.external.ExternalInterface.available) {
                        alert("external interface is available..");
                    var f:String = "myJavaScriptFunction";
                    var m:String = mx.external.ExternalInterface.call(f);
                
mx.external.ExternalInterface.addCallback("myFlexFunction",myFunc);
                } else {
                    // Handle failure here.
                        alert("external interface is not available..");
                    
                }

     }
        
        function myClick() {
                alert("Calling Javascript Now");
                fscommand("fred", 1);
                fscommand("showmenu", true);
        }
 </cfformitem>
 <cfinput type="Text" name="fred" value="12" label="myFlashformitem" 
required="No" visible="Yes" enabled="Yes" size="10">
 <cfinput type="Button" name="mybutton" visible="Yes" enabled="Yes" 
onclick="initApp();" value="Clickme">
 <cfinput type="Button" name="mybutton2" visible="Yes" enabled="Yes" 
onclick="myClick();" value="fscommand">
 </cfform>

 <form>
 <button onclick="callApp();">Call App</button>

 </form>
 </body>
 </html>


<Prev in Thread] Current Thread [Next in Thread>