Flexcoffee is a fast framework of flex and Java, which allows seamless integration of flex and Java. There are few introductions, but here we will show you how to use it.
First download the related package from Google,
Http://code.google.com/p/flexcoffee/
Flexcoffee_3.0_1.1.rar
Create a project,
Now we need to encode the code after creating the project. We need to create a Java class first.
Package test; <br/> public class testflexcoffee {<br/> Public String testcoffee (string Arg) {<br/> return "test:" + Arg; <br/>}< br/>
Then the class and the method of calling it are implemented in flex.
<? 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/> private function returnmethod (value: Object): void <br/>{< br/> alert. show (string (value); <br/>}< br/> private function click (): void <br/>{< br/> testflexcoffee. run (); <br/>}< br/>] --> <br/> </MX: SCRIPT> <br/> <code: classload id = "testflexcoffee" <br/> classpath = "test. testflexcoffee "<br/> classmethod =" testcoffee "<br/> method =" {returnmethod} "<br/> value =" {['ken']} "<br/> Autorun = "off"/> <br/> <mx: button label = "test" <br/> click = "{Click ()}"/> <br/> </MX: Application>
The result is as follows:
Note: The flexcoffeewar package is already integrated with all functions of blazeds.