Flash - How To Make Synchronous URL Requests From AS

Sep 13, 2010

I have a big loop in actionscript that sends lots of data to an url:
for(var i=0;i<1000;i++) {
var request:URLRequest = new URLRequest();
request.url = url;
request.method = URLRequestMethod.POST;
request.data = data;
var loader:URLLoader = new URLLoader();
loader.load(request);
}

The problem is because URLLoader can make only asynchronous calls, it sends all those thousands requests at once which kills webserver. Also it acts a bit strange on top of that. Lets say the loop is running for 5 minutes. For whole 5 minutes there is no requests coming to web server, then at the end they all are sent at once. I already tried everything I could possibly think of (empty loops, callbacks, delays) - nothing works. All requests are sent at once no matter what. How to make requests synchronous, so it will send one request after another?

View 1 Replies


Similar Posts:


Actionscript :: Make HttpService Requests Synchronous In Flex?

Nov 24, 2009

Is it possible to make httpService Requests synchronous in Flex?

View 2 Replies

Actionscript :: Make A Synchronous Xhr Call From Flash?

Feb 7, 2012

Is it possible to make a synchronous xhr call from flash?How do you do this in actionscript?

View 1 Replies

Flex :: Can Do Conditional GET Requests From Flash / AS?

Feb 19, 2010

I have a Flex client that loads data from a server to display a chart. This data may change, so the client regularly repeats the request. Since the result may require some work to retrieve, I'm going to have the server detect if the result has changed, and issue a 304 status if it hasn't.I haven't seen any headers in the Flash Player's requests which would indicate that it's already handling conditional GETs. Also, the HTTPService API doesn't seem to provide anything, either. Does that mean, Flash can't do this, or how can I implement this myself?

With regards to cookies, which aren't supported in Flash, I have heard the suggestion to build my own HTTP client on top of the Socket class. This might solve this issue, too, but frankly, I'm really not keen on doing that.As an alternative, I could just cache the result page and send it again, but so far, the API tries to utilize semantics that are already built into HTTP, and I'd like to keep it that way.

View 2 Replies

Web Development / Flash Making AJAX Requests?

Dec 4, 2009

The main top section of the site is a little Flash thing that has buttons as links to different areas of the site. All of that is well and good, but whenever I click those links, it has to reload the entire page (including the Flash app) when only the bottom part changes. This isn't really a huge issue, since everything's real small, but it's kind of annoying.I vaguely remember "fixing" this behavior using AJAX during my web programming class, but that was just straight HTML and Javascript, no Flash players to muck around with.My question is, how do I overcome having to reload the entire page when someone clicks a link from the Flash object? Is there some nice way I can call something other than getURL() to achieve this effect?

View 2 Replies

Cross Domain Requests : Javascript Vs Flash?

Jan 25, 2010

As you might know, browser's security model does not allow a script loaded in a page from http:[url]... to make cross-domain requests (no AJAX calls to any other domain other than url...).The Javascript file itself could have been served from a different domain altogether (url....) and that is irrelevant. This is the Same-Origin Policy.

Flash also has something similar? But does Flash treat the origin to be the HTML page where the .swf file was loaded or origin is the domain which served the .swf file?

So http:[url]... loads a .swf file from http:[url].... Now .swf can load resources only from [url].... or only [url....? I'm assuming there are no cross-domain.xml files setup on either [url]....

View 1 Replies

Flash :: HTTP Requests Won't Work On Localhost

Jun 11, 2010

First off, I'm trying to fix something that I didn't build to begin with and the guy who's project it was assures me it was working fine when he left, although a version I haven't touched since he left seems to have the same issues. I'm also a bit new to programming in general so let me know if I've left out important information in my first post and I will try to add more info.

I have a flash application hosted on-line that acts as a client for a server application written in Delphi. Most of the communication is done using sockets, which work fine. Uploading data files and downloading results files is done using HTTP requests, which work fine as long as the user is making use of an instance of the server on another computer. However, if the user has the server application installed on their own computer and attempts to use it specifying localhost as the url, the socket communication still works, but the HTTP requests don't.

All the socket based communication works fine and, when it is not on the localhost, all the HTTP requests work fine as well, which is why this is so mystifying to me. I've tried changing the flash cross-domain policy file that the server dispatches to be completely permissive, all ports, all domains, all http-request-headers, and still no luck. The Flash app will sit waiting for localhost indefinitely most of the time until I close the server application, and then give this error message:

[Code]...

View 1 Replies

Actionscript 3 :: HTTPS Vs HTTP Requests From Flash

Oct 16, 2011

I am finding that if I load Flash from a HTTPS page [URL] and try to make a request within ActionScript 3 to [URL] the request does not go through. Same goes for the opposite (accessing https from a http-loaded flash script).

The request is failing, the requested data (passed from a PHP script) is not loading.

Now at first I assumed the trouble was with cross-domain policy files, but I have fixed that issue (I think).

Is there any security policy in Flash (CS5 btw) on HTTP vs HTTPS requests based on where the script is loaded from?

View 1 Replies

Php :: Avoiding CSRF When Serving AJAX Or Flash Requests?

Sep 14, 2010

I have a Flash based game for the browser which sends users' scores to a php backend script which stores the score and the user id in the database.

Now I have a url like www.example.com/update.php?score=200&uid=234

The problem is that this is very much exposed to an intelligent user, and he can use this url to store whatever score he wants in the DB. Also there's no real user authentication, and I don't intend to have one either, because it's really a tiny game.

How can I stop someone from calling the above url and updating his score on his own.

View 2 Replies

Flash Uploader - Requests Host/crossdomain.xml File?

Jan 24, 2011

I'm using YUI file uploader based on flash, and the flash requests host/crossdomain.xml file. I'm requesting localhost and it requires this file. I was using this before and I have never had this problem and I've never had this file on my server.I've never used any adobe technologies, could please anybody tell me if it is possible to turn it off somehow ?The problem is that I can't have the file on my server, at least at root location...

View 2 Replies

Actionscript 3 :: Making Requests From Flash For URLs With + Signs In Them?

Aug 20, 2011

I am hosting images on Amazon S3 and using them in my Flash application. My application receives signed S3 urls that point to the images in S3. The URL looks something like this (line breaks added for clarity):

[Code]...

The problem here is with the + sign that can occur in the Signature. If I send the + sign as-is, then the browser thinks that it's a space, as it should according to the URL specs. Really, S3 shouldn't use + signs for this reason, but it seems to be something they overlooked. Normally this isn't a problem since you just replace the + sign with a %2B. However, Flash has some default behavior that makes this difficult.

From what I can see, the URLRequest object is setup to always encode URLs as if it was passed through the encodeURI function. I don't see any way to turn this off. Unfortunately, encodeURI doesn't encode + signs, but it does encode % signs.

This means that if I leave the + sign in there then Flash leaves it alone and S3 thinks I have a space in my URL. If I use %2B then Flash turns it into %252B, due to encoding the

View 1 Replies

Flash :: IE Requests SWF Using HEAD Instead Of GET In Facebook IFrame Application

Dec 18, 2011

By far the weirdest thing I've ever seen. On some machines (!) IE (!!) attempts to load an SWF file via HEAD request instead of GET. This happens only when the page is running in Facebook IFRAME application - when running solo works fine. Naturally, on FF and Chrome everything works just fine. The SWF is embedded using jSWFObject. There's no visible common feature to the machines which experience this problem - laptops, desktops, XP, Vista, 7.

View 1 Replies

Networking - How Can Flash Open A Port To Listen For Server Requests

Apr 27, 2010

Is it possible for flash to open ports to listen for messages from the remote server? If so, how?

View 2 Replies

Ajax :: View Response Content Of Flash HTTP Requests?

Aug 28, 2010

I'm interested if there is some tool (preferably a firefox addon) that allows you to record http requests and view their response header and content.

View 3 Replies

Flex :: RemoteObject Synchronous Call?

Oct 1, 2009

In the code below when I call chkAuthentication function from another function the remoteObj.login (login function in my service file (.php)) is called after the remaining code in that function. i.e., the loginStatus is returned from the function before the result-handler function loginResult is called. but my loginStatus is supposed to be set in loginResult function. It seems that the asynchronous behaviour is the culprit. what should I do in order to get the loginResult function to complete first?

[Code]...

View 2 Replies

Flex3 :: Synchronous And Asynchronous Call

Jan 12, 2010

what is synchronous and asynchronous call in flex. Why Httpservice is asynchronous and how to make a call to asynchronous call.

View 3 Replies

Flex :: Synchronous Calls Using RemoteObject?

Apr 2, 2009

Is there a way to make synchronous calls using RemoteObject in Flex?

Solution: Add the second call to the result handler of the first call, having a token check for multiple originating calls.

View 9 Replies

ActionScript 3.0 :: Synchronous Loader For My AIR Application?

Jan 11, 2011

I need a Synchronous loader for my AIR application.The URLLoader class does not meet my needs because of its asynchronous nature.It continues the execution of code. I need to stop the code until the loader loads the Html text.

View 5 Replies

Python :: Flash - Handle Faults/exception In Flex In Http Requests?

Mar 15, 2012

Here is an issue i'm struggling to solve for quit some time now.I have a python + GAE backend with a flex client that communicates via JSON. I'm using flex's HttpService bound to a Responder with result and fault callbacks. When python raises an exception, I don't seem to get it in flex. I did some research and found out that the problem probably lies in the fact that the flash runtime cannot handle http responses with status code other than 200.

View 1 Replies

ActionScript 3.0 :: Can Requests From Flash Create An Infinite Loop That Crashes The Server

May 18, 2009

a client hosts numerous sites at MT, I've built a few Flash sites that exist on his server. For some reason, the server is over-running due to an internal loop that is basically the domain requesting itself over and over. can this potentially happen via the player itself somehow making numerous requests.

View 2 Replies

Flex :: Programming Synchronous Web Service Calls

Aug 19, 2009

Web service calls are asynchronous in flex, but I wanted to wrap a web service call in a class to provide synchronous encapsulation. Something like the below - the user could call getMyMethodResult and get the result returned by the web service. I expected the thread that recieved the soap response would populate the variable _result and mean that getMyMethod would, after a time, find _result is not longer null. But it doesn't! Can anyone explain why this does not work?[code]

View 1 Replies

Actionscript 3 :: Treat Flex' Events In A Synchronous Way?

Aug 10, 2010

I'm using flex4 and actionscript, and need to treat an event in a synchronous mode. Is it possible that? More exactly, i want to execute some queries in a database, and need to be synchronously.

View 1 Replies

ActionScript 3.0 :: Turning Asynchronous Calls To Synchronous?

Aug 27, 2008

Is there a way to have a synchronous call to a URL to retrieve the HTML code? If not, is it possible to turn an asynchronous call into a synchronous one using some trick? I can't believe Adobe wouldn't implement this option. I tried looping until the result is back but then the status function never fires making my loop infinite.

ranting.turn("ON");

I'm a ColdFusion developer and recently started working on a project in Flex. I am getting more and more frustrated with AS and Flex lately. It seems that whatever I'm trying to do is either really hard or impossible while it usually can be done with one line of code in ColdFusion. I'm still learning these languages and I'm sure my lack of knowledge is the reason but for some reason I can't get ahead with my project. It looks like the learning curve is much steeper than it should be.

ranting.turn("OFF");

Anyways, here's my code for testing this functionality. The main application file looks like this:

Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()">
<mx:Script>

[code]....

This works OK except the function returns false before the HTTP call returns its result. If I un-comment the while loop the onStatus function will never be called and therefore end up with an infinite loop. Not sure why this happens.

View 14 Replies

Flex :: Synchronous - Action Wait For Network Response?

Jun 22, 2011

I have small Flex web based util with single button. On this button click a request is sent to server and the response must be read in the same call.This is important not to wait for response with event handler (which is trivial).Basically this is synchronous call.I am ok with blocking ui and so on.

View 1 Replies

Actionscript 3 :: Isn't Supposed To Be A Simple Synchronous Architecture Language?

Feb 4, 2012

A simple piece of code that should trace [code] and I get something completely far away from that,[code]Is the trace function that bad? that slow? is it the fact that passing an argument to the function take so much time compare to the other one?is there something I can do to avoid this type of weirdness ?(For the record, my project is not to trace {rien, done and test}... I have 15k lines of codes that react completely differently if I compile them with "Omit trace statements" or not.

View 2 Replies

Actionscript 3 :: Sound Performance In Loop - Stop And Play Again For Synchronous

Jun 2, 2011

i am using soundmanager to order sounds. my site preview, in home page, square shapes comes into stage and you can drag drop them, all shapes binded its own sound. if they are colliding binded song will play.

the problem is i have 3 second timer to control sounds. every timeout i have to stop sound and play again for synchronous issue, that is my solution for that part. but sometimes before loop, there is an annoying little silence.

View 1 Replies

Actionscript 3 :: Http Web Requests From Flash Are Timing Out Or Or Never "returning"

Feb 21, 2011

I run a facebook game that makes http web requests to my server using AS3's URLRequest and URLLoader classes, then takes the json data that the server spits back and and processes it it, etc etc.. Lately I've had users complaining about server requests that never come back. They perform and action and the game just kinda hangs there waiting for a response indefinitely. If it were just every now and again I would blame it on the server just dropping the ball every so often, but some users complain about having this problem consistently at the same exact spot, while others don't get it at all.

The part that bothers me the most is that no matter what I do I cant reproduce the issue that they are having. How can I diagnose this issue without being effected by it? I'm stumped. what might be going on, or anything that I can do to get more information on what might be happening?

View 1 Replies

Php :: Flash HTTP Requests URL Containing RTMPE URL - Get A Local Copy Or A Copy With Content?

Oct 7, 2011

A web channel streaming service streams to a certain IP range, it only checks the IP in example.com/cmd.php?id=xxx (channel number) and outputs an rtmpe stream URL, nothing else.How do I trick it to get my local URL instead of the one on their server? I have considered squid proxy, but is there some way to do it with a firefox plugin or greasemonkey script?

Edit:I will try to specify:It's a streaming service from an ISP and cable provider. They stream for free to people on their IP's. On their webtv page, which is called webtv.example.com, there is a flash player. If you are not on an IP from their ISP, you can't stream anything but the test channel.When you try to change channel via. javescript:videoplayer_changechannel(xxx) it makes this HTTP request:

[URL]

If you are on one of their IP's you will get an RTMP URL, like this:

[URL]

This is what the flash player requests, and if it get's this response it load the channel requested. There is no HTML on the php page, just the URL. Note that the rtmp URL is static.If you are not on one of their IP's it will return a random sentence (something stupid, the programmers having fun).I wan't to trick the flash player into getting the right value, even though it's not on one of the ISP's IP's.

View 1 Replies

See Network Requests Made By A Swf?

Jun 30, 2010

I have a swf (flash file) who is making http request.

Which is the easiest way to see what request the flash application is doing?

P.S. I do not have the program as a fla file

View 4 Replies

Actionscript 3 :: GET Requests With HTTP?

Oct 11, 2011

Unfortunately, Flash Player doesn't support using request headers with GET requests, as noted here, due to what Adobe terms "browser limitations": Due to browser limitations, custom HTTP request headers are only supported for POST requests, not for GET requests. That means I need to create my own HTTP socket class from scratch and find a way to run a policy server on the machine I'll be querying. Hooray.If I want to make a simple GET HTTP request with HTTP-Basic auth headers, what do I need? I'd need something like

socket.write("HTTP GET REQUEST PAYLOAD HERE");
socket.flush();

What do I put in the write method to compose a GET request?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved