ActionScript 3.0 :: Call A Servlet From Flash?
Aug 1, 2009how to call (or) pass access to a Java servlet using Flash [i.e., ActionScript 3.0 code]?
View 1 Replieshow to call (or) pass access to a Java servlet using Flash [i.e., ActionScript 3.0 code]?
View 1 RepliesI'm using Flash 4.0 as UI tier, and I'm trying to send data to the server side, which runs on Tomcat. I wrote a servlet that the calls are directed to it. But I do not understand how can I see the data that was sent from the flash tier. to clarify, hereby example:
Flash tier:
<fx:Declarations>
<s:HTTPService
id="setCustomerDataService"
[Code]....
how can I retrieve "data" from Flash, in my Servlet?
My .fla/.swf file is unable to load the data from server. Instead, it is displaying the below error: Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: [URL] cannot load data from [URL]. at MiniHumanAp_fla::MainTimeline/MiniHumanAp_fla::frame1() the reply for root-cause of this error...
View 4 RepliesMy .fla/.swf file is unable to load the data from server. Instead, it is displaying the below error:
Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://www.mymdworld.com:8082/MiniHumanAp.swf cannot load data from http://localhost:8082/getviews?category=OB%2FGYN. at MiniHumanAp_fla::MainTimeline/MiniHumanAp_fla::frame1()
The instructions I read for using AC_FL_RunContent, say to leave off the file extension of the swf file, e.g.: AC_FL_RunContent(..., 'movie', 'some'); So that it will embed some.swf. However, I need to serve the swf from a servlet, e.g. /blah/SomeServletName. How can I do that? I tried changing the javascript of AC_RunActiveContent.js, so it doesn't manipulate the file extension. In other words, so I could use:
AC_FL_RunContent(..., 'movie', 'some.swf'); But, it displays nothing if I use the servlet path, instead of a path that looks like a file name, e.g.: AC_FL_RunContent(..., 'movie', '/blah/SomeServletName');
I have an ActionScript File sending XML to my servlet. I am only getting empty arrays on output.output is:
java.io.StreamCorruptedException: invalid stream header
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:764)
at java.io.ObjectInputStream.(ObjectInputStream.java:277)
at myDungeonAccessor.myDungeonAccessorServlet.doPost(myDungeonAccessorServlet.java:82)
[code]....
I have an ActionScript File sending XML to my servlet. I am only getting empty arrays on output. Anyone know what Exactly I'm doing wrong? output is:
[Code]...
I have developed a Flex application. I have also developed a Java servlet program for an Access database using Tomcat. How can I use that servlet backend for my Flex application using HTTPService ?
View 1 Repliessyntax for calling a servlet with parameters in query string to load an XML file into flash?
Current code (Not Working):
xml.load("<project_name>/<servlet_name>?parametr1="+variable1+"¶metr2=" +variable2+"¶metr3="+variable3+"",)
Is there any way to connect Java servlet to FMS?I would like to send comand from servlet via HTTP to FMS?(Something like communication to Flash media server using administration API)The best way for me would be connecting (writing) to SharedObjects, but I would be happy with any connection at all.(I read some about ColdFusion, but there would be too much modification on my servlet.)
View 4 Repliesread a local shared object with a servlet even if there is no flash present on a page? I want to set a local shared object like a cookie, and then access it again from a page that doesn't have a flash movie.If I can't do this, is it standard to have the initial flash movie call an external javascript to set a traditional cookie that can later be read?
View 1 RepliesI have a problem using Flex with BlazeDS on a Tomcat 5.5 through a Proxy (Apache). I already searched for it but didn't find answers which solved my problem. I hope you guys can help me out. Our scenario is the following: Flex-App using BlazeDS to communicate with our Dataservice on a Tomcat 5.5.The Webapp is balze enabled and the services config contains channel definitions like the following:
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://xxx.xxx.xxx.xxx:8180/myDataService/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint">
</channel-definition>
[Code]...
This is my method in actionscript
var urlVars : URLVariables = new URLVariables();
urlVars.myname = byteArr;
var urlReq : URLRequest = new URLRequest('MyServlet');
[Code].....
How do I recieve the byte array on servlet ?
Also the byteArr above comes from java side,
byte[] byteArr = aMethodWhichReturnsaPDFByteArray();
HttpServletResponse response = FlexContext.getHttpResponse();
ServletOutputStream os = null;
[Code].....
The is my first attempt to build an air app, so the solution to my problem may hopefully be simple.
I need to send a byteArray to my servlet via a post request. In my original code, the byteArray is containing a png pic.
I'm running flash cs 4 demo...
When i'm running this code as an Air 1.1 file, i'm getting Error #2044: unhandled IoError:..text=Error #2032: Stream Error URL localhost
import flash.net.*;
import flash.events.*;
import flash.events.HTTPStatusEvent;
[Code].....
But if i'm running the same file as an as3 file flashplayer 10, everything is perfect, and no errors occurs...
I am new to Flex. I am just wondering how to manage session and cookies for logging in, logging off in Flex? I am using Flex HttpService and Java servlet.
View 1 RepliesI have a collection of Objects in an ArrayCollection in my flex page.
What is the best approach to send this data to a Java Servlet?
The object in the ArrayCollection is a VO that consists of an id and message for now. I want a solution that is scalable in case more properties are added later on.
I am passing some parameters as POST to a Servlet from my Flex WebApplication. I am able to pass and retrieve strings properly. I used new Date().getTime() in my flex code and tried passing the timestamp variable hoping to parse it at the servlet and convertit into a java.util.Date object. But i am getting a NumberFormatException when i try to parse the variable from the string that i got from request.getParameter.
View 1 RepliesI'm working on a flex application and I need to call some data with a synchonous method. After some research, I've found a code from adobe that use ajax and external interface. That great. the code from adobe
When I send data with the GET method, the servlet read the parameters and print some infos (to check). But when I send data with the POST method, the servlet recieve the request, but the parameters disappeared.
[CODE]...
Can you make httprequests in flex the same way one does with AJAX? I would like my flex page to access a database on the web or a servlet.
View 2 RepliesI use fileReference.download() to download files. The fileReference send request to java servlet.In servlet, some error may be checked. For example error - 'File not found'. I want to send the error to flex side. I tried lots of methods,but fileReference in flex can't receive them.Such asresponse.sendError(HttpServletResponse.SC_NOT_FOUND, "File not found");r PrintWriter out = resp.getWriter(); out.print("File not found");It seems fileReference can't triggers event 'DataEvent.UPLOAD_COMPLETE_DATA' and'HTTPStatusEvent.HTTP_STATUS'.
View 1 RepliesI wrote a small Adobe Air server socket app for a small client/server application. Aside from getting a dedicated server, are there any companies out there that would ...
1. Allow running Adobe AIR on the server
2. Grant permissions on ports for socket sending/listening
I need to get a javascript var in my Flash application. I like to be able to just set a variable in the javascript (client constraints) rather than define a function.
Can this be done? I am trying to use the ExternalInterface.call()
AS:
ExternalInterface.call("function(){return window.someVar}", null);
JS:
var someVar = "Test";
This does not work and I suspect it is because the ExternalInterface.call() does not like the anonymous function.
I have a function defined in JavaScript like so:
function fadeBack() {
alert("fadeBack called");
};
I call that function from my Flash file like so:
import flash.external.*;
flash.external.ExternalInterface.call("fadeBack");
This works in both Safari and Chrome, but for some reason Firefox won't ever call the function. Still, I can't figure this out. How can I fix it?
i have some actionscript that makes a
ExternalInterface.call('someFunction');
call.is it possible to reference the html object that made the call to someFunction directly using the ExternalInterface.call call?
Assume that the object that makes the call also has some Callbacks (via ExternalInterface.addCallback) that are accessible via javascript.
Currently:
Actionscript source
ExternalInterface.call("someFunction");
ExternalInterface.addCallback("someCallback",someASfunction);
[code]....
We have been given some code that does a URLRequest call which is really slow to respond, so I was looking to make it pull the data from the page, as it is already on the page.[code]I have tried to replace it with this (actionscript is definitely not my forte):[code]I am using addCallBack as that is what the editor suggested via autocomplete, unfortunately it doesn't seem to work. Unfortunately I cannot go back to the developer at this time.The error message is:Call to a possibly undefined method addCallback through a reference with static type flash.external:ExternalInterface
View 3 RepliesFlex having any init(), destroy() method. Like Servlet init()method will run at Application initialize and never call it again if Refresh the Page also.
View 2 RepliesI want to know how to write "Intercepting Filter Pattern" like Java's servlet filter in Flex.
And I want to insert it into the classes which have a role of server communicating.
I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:
AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);
[Code]....
I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.
I'm trying to get the AS3 Flash remoting example found here: [URL]. and I keep getting this error: Code: Select allError #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.BadVersion at amfphp1_fla::MainTimeline/frame1() Here's the code I'm trying:
[Code]....
I'm having trouble simulating a click call to a button(displayObject) thats generated via an API call( youtube as3 API). I have not seen any mention of security reasons as to why I can not simulate a click as long as something is registered with a click handler. Basically I checked to make sure the button made is listening to a mouse click event with:
trace(generatedButton.hasEventListener(MouseEvent.CLICK)) which returns true
I proceed to than call this:
generatedButton.dispatchEvent( new MouseEvent(MouseEvent.CLICK, true) );
And nothing happens yet if I physically click the button it works. Is there some security measure that prevents something from being fake clicked unless its origin is strictly from the system mouse?
I even set a timeout call on the click function and moved my cursor over the button and let it fire in case it was an issue of the mouse having to over the object but still nothing. I am kind of stumped at this point.