Call JavaScript function to get the result : JavaScript « Development « Flex






Call JavaScript function to get the result

         

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" initialize="initializeHandler(event)" width="175" height="180">

    <mx:Script>
        

            private function initializeHandler(event:Event):void {
                var dates:Array = ExternalInterface.call("getDates");
                calendar.disabledRanges = dates;
                ExternalInterface.addCallback("setEnabled", setEnabled);
            }

            public function setEnabled(value:Boolean):void {
                calendar.enabled = value;
            }

      
    </mx:Script>
    <mx:DateChooser id="calendar" enabled="false" />

</mx:Application>

   
    
    
    
    
    
    
    
    
  








Related examples in the same category

1. block calls the JavaScript changeDocumentTitle() function in the enclosing wrapper by using the call() method<fx:Script> block calls the JavaScript changeDocumentTitle() function in the enclosing wrapper by using the call() method
2.If you pass an object, you can access the properties of that deserialized object in the JavaScriptIf you pass an object, you can access the properties of that deserialized object in the JavaScript
3.Is JavaScript method call ready
4.Call from JavaScript
5.Send to JavaScript
6.Call JavaScript with ExternalInterface
7.Call JavaScript method and pass in parametersCall JavaScript method and pass in parameters