Let's go on to the previous tutorial to briefly explain how to compile JavaCodeTo achieve simple interaction with the background.
Let's take a look at the example:
<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <mx: Application xmlns: MX = "http://www.adobe.com/2006/mxml" <br/> layout = "absolute" <br/> xmlns: code = "http://code.google.com/p/flexcoffee/"> <br/> <mx: SCRIPT> <br/> <! -- [CDATA [<br/> Import MX. controls. alert; <br/> Public VaR value: String = "beanshell"; <br/> private function showbeanshellresult (value: Object ): void <br/> {<br/> alert. show (string (value); <br/>}< br/>] --> <br/> </MX: SCRIPT> <br/> <code: beanshell id = "beanshell" <br/> Object = "{This}" <br/> Autorun = "off" <br/> method = "{showbeanshellresult}"> <br /> <code: code> <br/> string result = "Java println" + # value #; <br/> system. out. println (result); <br/> </code: code> <br/> </code: beanshell> <br/> <mx: button label = "testbeanshell" <br/> click = "{beanshell. run ()} "/> <br/> </MX: Application> <br/>
Java code is dynamically executed during the running process.
String result = "Java println" + # value #; <br/> system. Out. println (result );
Accelerated development to a certain extent, making flex and the background more closely integrated