macromedia jrun flash remoting:
I am using Flash remoting, Flash mx 2004 and JRun 4 server I am having a problem with my java instances. When I test my movie in flash mx 2004 (using Ctrl enter) the test movie does not refresh the java instance it uses. For example: if I run it once, and I set a java variableto (which is set to 2 in the constructor) to 5, and then run the movie again (after closing the first test movie) the variable in the java class will still be 5. Therefore it is using the same java instance as it did for the first test movie. It does this repeatidly until I close flash mx 2004 and open it again, in which case it makes a new instance. I have tried a aso cache cleaner but no luck. I am starting to think it may be something with my server !!! Any ideas, any help would be much appreciated, as I am out of ideas. Thanks
Here is my code if anyone is interested !!! Oh and my java class implements Serializable. Also a point I failed to mention was that when I publish my movie, and run it repeatidly it works fine, even when I use F12 command. It uses a new java instance everytime. It has me totally baffled !!!!! // Include NetServices library. #include "C:\Program Files\Macromedia\Flash MX 2004\en\First Run\Include\NetServices.as" #include "NetDebug.as" if (inited == null) { // do this code only once inited = true; // Set the default gateway URL. NetServices.setDefaultGatewayUrl("http://localhost:8100/gateway"); // Connect to the gateway. gatewayConnection = NetServices.createGatewayConnection(); trace ("Gateway Connection ==> " + gatewayConnection); // Get reference to JavaBean: //flashtestService = gatewayConnection.getService("flashgateway.samples.FlashJavaBean", this); flashtestService = gatewayConnection.getService("testJava.testingRemoteEight", this); trace (flashestService); } //Initialize var's and function's var myVar = 0; var resultMessage = "resultMessageInit"; function Run (){ getMessage(); } function getMessage() { flashtestService.getMessage(); } function getMessage_Result( result ) { resultMessage = result; setTxt(); trace ("resultMessage ==> " + resultMessage); } stop(); txtBox2_txt = resultMessage + " - " + myVar; added_btn.onRelease = function () { myVar ++; Run(); }; function setTxt () { txtBox2_txt = resultMessage + " - " + myVar; }
Cheers for the suggestion. I checked the file and they are set to true (both of them). Anymore ideas would be welcome....
Don't see what you're looking for? Try a search.
|