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


Similar Posts:


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

Flex :: Flash Builder Conditional Compilation

Apr 6, 2011

how can I do the following in a Flex project?[code]then flash builder gives me a compile error:1018: Duplicate class definition: Main

View 2 Replies

Flex :: Multiple HTTPService Requests With AIR

Nov 17, 2009

I am developing an AIR application with Flex Builder that requires me to make two HTTPService requests at the same time. They both use different instances of the HTTPService AS3 class. Both services are calling a RESTful API which is currently running on my localhost (XAMPP) and takes a few seconds to respond (much quicker on live server). The problem is that most of the time one of the calls fails, however occasionally they do both work. Its also random as to which call will fail. Both calls use code something like this. This code is basically repeated in two classes.

[Code]....

View 3 Replies

Flex :: Blazeds - RemoteObject - Handling Multiple Requests?

Jul 11, 2009

I have a couple of remote object methods that I want to respond to in different ways depending on the context, but I'd rather not set up a bunch of different RemoteObject aliases.Some background: Let's say I have an admin application that displays sales stats in different ways. The remote method looks like:

<mx:RemoteObject id="rpt" destination="AMFServer">
<mx:method name="getSalesStats" fault="getSalesStatsFault(event)"
result = "getSalesStatsSuccess(event)" />[code]........

The getSalesStats method takes an employee ID and a sales type as its arguments. You'd call it like:

rpt.getSalesStats(120, "peanuts");
public function getSalesStatsSuccess(e:ResultEvent):void {
salesdata:ArrayCollection = e.result.rows as ArrayCollection;[code]......

I'd like to pass something through the remote method to the responding function, like:

rpt.getSalesStats(120, "peanuts", "clicked button one");

but that of course throws an error because the server doesn't want that last argument.

View 6 Replies

Actionscript :: Make HttpService Requests Synchronous In Flex?

Nov 24, 2009

Is it possible to make httpService Requests synchronous in Flex?

View 2 Replies

Flex :: Block Http Requests To Some Web-pages From Adobe Air

Jan 20, 2010

Is it any way to prevent user to go to specific web-pages using Adobe AIR framework.I want this software to run at startup and not allowing user to surf some web parts.I want to use Adobe AIR beacause of its crossplatform capabilities.

View 1 Replies

Flex :: In Mate, Sending Two Or More Requests To The Server Simultaneously?

Sep 29, 2010

I'm using Mate's RemoteObjectInvoker to call methods in my FluorineFX based API. However, all requests seem to be sent to the server sequentiality. That is, if I dispatch a group of messages at the same time, the 2nd one isn't sent until the first returns. Is there anyway to change this behavior?

View 1 Replies

Flex :: Multiple Async Webservice Call Requests?

Jul 26, 2011

I am using Flex and Actionscript 3, along with Webservices, rpc and a callResponder. I want to be able to, for example, say:

loadData1(); // Loads webservice data 1
loadData2(); // Loads webservice data 2
loadData3(); // Loads webservice data 3

However, Actionscript 3 works with async events, so for every call you need to wait for the ResultEvent to trigger when it is done. So, I might want to do the next request every time an event is done. However, I am afraid that threading issues might arise, and some events might not happen at all. I don't think I'm doing a good job of explaining, so I will try to show some code:

private var service:Service1;
var cp:CallResponder = new CallResponder();
public function Webservice()[code]....

I could ofcourse save the actions in an arraylist, but whose to say that the addToArrayList and the check if other calls are available do not mess eachother up, or just miss each other, thereby halting execution? Is there something like a volatile Arraylist?

View 2 Replies

Flex :: Duplicate Sessions Caused Multiple Requests With Different JSESSIONIDs?

Jul 7, 2011

I think I inherited bad code, here's the deal: In my command, I create a local var for the remote object and then call a method on it. In the result, if there's no data, I start a timer. This timer broadcasts an event every 2 seconds that continually calls this command until data is returned. Then the timer is stopped.

What we're seeing is that the method returns data once, and then the next time it doesn't (dupe Flex sessions error). It basically alternates. If we click really fast, sometimes we'll get two to work in a row. At times, the Java dev is seeing these requests returned with different JSESSIONIDs. I believe this is causing the duplicate Flex sessions error. I'm using Cairngorm; here's the execute command.

public function execute(event:CairngormEvent):void
{
ruleName = (event as FetchReportEvent).ruleName;
var ro:RemoteObject = ServiceLocator.getInstance().getRemoteObject("quantRemoteObject");
if (model.guid != null)

[code]....

View 1 Replies

Actionscript 3 :: Capture And Alter All Outgoing Requests From A Flex Application?

Feb 22, 2012

Currently in my flex application, I've got all of the app's assets being served from my local server, but I want to be able to serve all of the assets from a CDN (URL...)

the application has quite a bit of components so rather than going to each component and changing the source of the asset, is there a way to capture all of the outgoing request from my flex application and run some logic where I can change the request from [URL]...

View 1 Replies

Flash :: Flex Conditional Compilation "else"?

Apr 29, 2010

In AS3 you can pass a constant to the compiler -define+=CONFIG::DEBUG,true And use it for conditional compilation like so:

CONFIG::DEBUG {trace("This only gets compiled when debug is true.");}

I'm looking for something like #ifndef so I can negate the value of debug and use it to conditionally add release code. The only solution I've found so far was in the conditional compilation documentation at adobe and since my debug and release configurations are mutually exclusive I don't like the idea of having both DEBUG and RELEASE constants.

Also, this format works, but I'm assuming that it's running the check at runtime which is not what I want:

if (CONFIG::DEBUG) {
//debug stuff
}
else {

[Code]...

View 2 Replies

Flex :: Conditional Data Binding?

Oct 8, 2009

first one shows playheadtime of videodisplay and another is also used for same purpose. the difference is that when we are in add mode(decided from a flag variable) both should show current playheadtime using binding. but when we are in edit mode(again decided from flag) the latter label should remain static, to be more specific, the value retrived from database.how can I do that using actionscript. I tried ChangeWathcer but I found it a bit tricky. Is there any other simpler way or am I missing something. following is my code.

private function init():void
{
if (queFlag == 'a')

[code].....

View 2 Replies

Flex :: Use Conditional Operator In Checkbox Using It?

Oct 21, 2009

I want to fill color based on condition so I used conditional operator for the checkbox. But it's shows the error Implicit coercion of a value of type String to an unrelated type Array. What did I do wrong ? How can I dynamically change the color of a checkbox ?[code]...

View 2 Replies

Flex :: Conditional Embedding Of Images?

Apr 26, 2011

We are working on a flex project where we want to balance two challengesa) want to ensure that there is minimal need to be connected to internet- so it can be used offline. This will be used in rural locations with flaky connectionsb) Reduce file size by only embedding those assets in compile mode as is requiredBroadly, the project will go down one of three flows in the module called, based on user choice- Path A, Path B and Path C, which will require image set-A, set-B & set-C respectively (based on settings in the module)We want to send over all images in Set-A or set-B or set-C right upfront in the module called, based on choice made in primary project, to minimize need for connectivity once accessed. At the same time I want to avoid sending all three sets and bloating up download size three times.

View 2 Replies

Flex 3 - Conditional Statements For A Repeater

Jul 12, 2011

I have an xml file that has a start date and length of a project... I use a repeater to load each project. The users' screen only shows 2 weeks at a time. I would like to make it so that if a project doesn't fall within the two weeks on screen, that the project isn't loaded. I could do this by sorting through the XML and finding the correct projects to load, and putting them into an array collection, but there's a "move date" button which allows the user to change the two weeks that are showed. Once the two weeks are changed, I would need the projects that fit into that new 2 week window to show.

[Code]...

View 1 Replies

Flex :: Set Conditional Locale Strings

Oct 21, 2011

I'm trying to localize my Flex app, I have been able to setup the locale specifics and all the stuff inside MXML tags, that works pretty well, my question is, what about if I have for example:

[Code]....

How can I change with ActionScript those two strings to an other locale?

View 1 Replies

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

Flex :: Use Conditional Operator In Combo Box Dataprovider Using It?

Dec 7, 2009

In my Combo box i have to shows team names condition based . So i will try like

dataProvider="{usersXML.users.user.(id=10).name}" but shows some errors . but if i tried

dataProvider="{usersXML.users.user.name}" display all name . It's working .

How can i condition based to display the list . In combobox . Plz refer me . is it possiable to check array of id on the dataProvider ?

View 2 Replies

Flex :: Set Static Constants Using Conditional Compilation?

Aug 4, 2010

I am trying to set some public static constants on a class conditionally by passing variables to the compiler e.g. -define=CONFIG::ENVIRONMENT,'testing_server'

[Code]...

Obviously this means I have to tinker with long command line setting each time. I thought my initial approach was possible given the documentation and various tutorials I have read.

View 2 Replies

Flex :: Conditional Color Change <s:SolidColor>?

Apr 26, 2011

I am unable to get the DataGridItemRenderer to pass a color value to <s:SolidColor based on the function containing an if statement based on the value of data.Bld_Type. Code below. I am vey new to Flex and not sure what the problem or if this is the right way of doing itr work.

<?xml version="1.0" encoding="utf-8"?>
<s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[code].....

View 2 Replies

Actionscript 3 :: Flex Conditional Compilation Of MXML?

Sep 10, 2011

In Flex it is now possible to use the -define compiler option to do all sorts of cool stuff.In my program, I am using the option such that some of my code is excluded by blocks like this:

CONFIG::FACEBOOK{
//Some code
}

And this is working well.How do I get a similar behaviour with MXML?I want to do the same thing, but omitting/including MXML tags in this way, not blocks of AS code.

View 1 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

Flex :: Conditional Maven Build Section With A Profile?

Jan 15, 2010

I'm building a Flex application with Maven and the Flex Mojos plugin. I now want to compile an alternative version of the application with some extra libraries to enable automated functional testing. For this I need to change 2 things in the pom: extra dependencies extra configuration of the Flex Mojos plugin in the build section I created a profile in the pom targetted at building the alternative version and added the extra dependencies. I'm wondering however how I can specify the extra configuration of the Flex Mojos plugin in the build section. Should I just redefine (copy and modify) the complete plugin configuration from the build section into my profile,

View 1 Replies

AS3 :: Conditional Drag And Drop Operations In Flex Tree

Mar 25, 2010

I am currently working with a hierarchical tree structure in AS3/Flex, and want to enable drag and drop capabilities under certain conditions: Only parent/top level nodes can be moved Parent/top level nodes must remain at this level; they can not be moved to child nodes of other parent nodes Using the dragEnter event of the tree, I am able to handle condition 1 easily.

[Code]....

View 1 Replies

Flex :: Conditional Coloring On Spark RichText Component?

Jan 26, 2011

I have a spark RichText that I want to change his color according with the value on text property.

Negative values get red, positives blue...

When I declare the component, I call a method to set up the css style, but when the value changes, the color is not updated.

How can I put a conditional CSS Style? Is possible to create custom skins to RichText component?

View 3 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







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