Flash :: Comet-style Long-Poll In AIR Using URLStream

Sep 26, 2011

I'm attempting to connect to an existing Comet-style long-poll service using an AIR app. The service expects a client to make a GET request with a Connection: Keep-Alive header. This request will remain open for long periods of time so that the server can push data through. In my app, the connection is terminated with an IOError after 30 seconds.

Is this an undocumented limitation of URLStream? A restriction on adl (I've only been running my app through adl)?

The server does not send any "keep-alive" messages to the client but, unfortunately this is not something i have control over.

Update

To test this, I've set up a stripped-down version using a little php script (linked by leggetter below) and am hitting it from a simple AIR app. I'm finding that my connections are closed after 30 seconds whether I use URLStream or URLLoader. the PHP:

<?php
set_time_limit(0);
sleep(40);

[Code]....

If i adjust the initial sleep time in the php script to anything over 30 seconds, the IOError event is triggered. If I lower the sleep time, but the request continues adding data past 30 seconds, the onComplete event is called, but _urlLoader.data is empty.

The only way this process completely successfully is if the entire thing is over before 30 seconds elapses.

View 1 Replies


Similar Posts:


Flash :: Long Polling With URLStream?

Jun 27, 2010

I'm trying to open a connection to a URL that will periodically send over a JSON object. I know that I need to use URLStream and some event callbacks, but I'm in the dark when it comes to knowing how streams of data "work," or the general flow of operations. Assume I know how to open the connection and send the correct request headers. First, some relevant code:

[Code]...

View 1 Replies

Flash :: Game Development - Comet / JS / PHP / HTML5 Versus In Secure Multiplayer Gamedevelopment

Sep 1, 2011

I would like to create a multiplayer online game (tic-tac-toe/chess) and i am not sure which language to use. I am familiar with JS/PHP and heard about comet Does comet stand a chance against Flash, if yes whats the limitations except the lack of smooth animations like flash allows? What are the differences regarding resources and memory needed? SECURITY: Is it possible to create Flash-games without any chance to modify (flash-)cookies etc... for cheating? i know lot of questions, i do hope for your recommendations into the reight direction.

View 1 Replies

ActionScript 2.0 :: Making A Flash Poll Using ASP?

Oct 30, 2006

I am currently looking for a tutorial that will explain how to build a flash poll. This is for a website I�m working on. However, the server is not PHP friendly. Thus, I am looking for a Flash poll ASP tutorial.

View 1 Replies

ActionScript 2.0 :: Good Links To Flash Poll?

Jan 30, 2010

Has anyone any good links to an flash poll tutorials?

I have looked at one on Activeden,One that shows a percentage of votes preferably

View 0 Replies

ActionScript 2.0 :: Make A Voting Poll With Flash Mx?

Apr 5, 2004

i would like to make a voting poll with flash mx, how can i do it ?

View 2 Replies

ActionScript 2.0 :: How To Create Comet 'tail'

Dec 22, 2006

Newbie here. (sorry in advance if this has been asked already) I've seen a lot of mouse trailer effects with action script but I'm trying to find a way to make a similar 'trailer' or 'tail' effect to follow an object that is tweened on the stage. Anyone know how to do this? Example: sphere symbol is tweened and follows a guide in a arch. I'd like to apply an action so there is a tail to it that nicely trails the sphere to make a realistic looking comet shooting across the sky. (with bunch of dust or small stars sparkling behind)

View 5 Replies

Flex :: Asynchronously Poll A File Using A Flash Timer Without Blocking The UI?

Jun 26, 2009

I have a flex application that repeatedly polls a remote XML file to detect changes, but I've found that once the file hits a certain size, the poll blocks the UI and makes the page unresponsive for a short time.

Is there any way to ensure that the call made to the server or the event from the flash.utils.Timer class runs asynchronously to the main UI thread?

View 3 Replies

Flash :: Pause / Resume Downloads With The URLStream Object?

Jun 27, 2009

Is it possible to pause / resume downloads with the URLStream object?

View 2 Replies

ActionScript 2.0 :: Make A Poll System In Flash Which Grabs Data From A PHP Generated Xml File

Apr 20, 2004

I've been using Flash for a while now but have just started using Flash Combined with XML. I'm trying to make a poll system in flash which grabs data from a PHP generated xml file. This is the contents of the xml file at the moment.

[Code]....

View 1 Replies

Actionscript 3 :: Internet Explorer Flash.net.URLStream Close() Method

Jan 15, 2012

Is anyone else aware of the fact that Internet Explorer (at least version 8) keeps downloading a file even if the close() method is called on an URLStream instance? Heck, it even keeps downloading if you close the tab displaying the site which called the load()/close() methods on an URLStream instance. Does anyone know of a solution to overcome this problem? More details: My preloader is loading a dozen of files and immediately closing the download streams with the purpose of checking each resource's file size. In Mozilla Firefox all goes well, exactly as expected, but Internet Explorer keeps downloading the resource even if the stream has been interrupted by the action script close() method.

View 1 Replies

ActionScript 2.0 :: LoadMovieNum - Users Of The Player To See How Long They Have Listen Or How Long Time Back Of The Song

Feb 5, 2004

I'am making a advanced mp3 player arund this tutorial: [URL] and i want the users of the player to see how long they have listen or how long time back of the song. i have the AS i what to use but i cant connect them. becuase the tutorial i used does not make a sound objekt (MUSIC)

[COde]...

View 1 Replies

Flex :: Playing A Large/long H264 File With NetStream Takes A LONG Time To Begin Playback?

Aug 1, 2010

I'm trying to play a 10 minute long video (h264/mp4) which is 39MB in size, after I call stream.play(fileURL) it doesn't start playback until its loaded around 12-16MB of the file (many many seconds later), I finally get onMetaData at this point too. Why doesn't it begin playback right away, or at least w/in a couple seconds? What can cause this bloated lead in time?

View 2 Replies

Creating A Live Poll?

Jul 14, 2009

I need to create a website that has only one question on it, and then displays the poll results automatically after a user makes a selection, showing the overall results updated in real timepoint me in the right direction on where to get started with this.I imagine I will need some php and possibly mysql to make this guy go.

View 5 Replies

Flex To Poll The Keyboard?

Nov 7, 2011

I'd like to tell if a certain key is being held down around the startup of my AIR (desktop) application, and I'd like to tell if a specific key (ALT in this case) is being held down. Unfortunately, flex seems to be so event based that there is no way poll the keyboard directly. Can anyone verify this?

I know that it's possible to take the keyboard events and keep track manually. However, this won't work if the user presses the key right before startup, so it isn't a solution for my specific problem.

View 2 Replies

ActionScript 3.0 :: Get Poll/Evaluation Quiz Template?

Nov 14, 2011

I have decided of using AS3 on my Evaluation Quiz because only AS3 supports saving pdf file. I need this feature for reports/tracking.
The question now is where can I get Poll/Evaluation Quiz Template?

View 2 Replies

Flex :: URLStream & OSX Laggy?

Dec 8, 2009

I'm using URLStream to download 30-80mb files over HTTP. It downloads fine on Windows XP, but is extremely laggy in OSX. Anyone had similar issues? Here's some snippets of the code.

[Code]...

View 1 Replies

ActionScript 3.0 :: URLStream Bytes Available Returns Incorrect Value

Aug 2, 2010

I am trying to upload and download a file from the server. After uploading if I Try to download the file it is not downloading. URLStream.bytes Available returns incorrect value. If I close the AIR application and try it ,it will work perfectly.. Why URLStream.bytesAvailable returns incorrect value just after uploading..

View 0 Replies

ActionScript 3.0 :: URLStream Object Does Not Have A Stream Opened

Dec 14, 2009

I successfully built a XML gallery; everything seems to work fine. But everytime I click on a thumbnail, I will get the following error:Error: Error #2029: This URLStream object does not have a stream opened.I researched on this error, and it seems this error involves sounds. Something about trying to load something that's already fully loaded. Therefore, I'm confused since I don't have any sound in my gallery. On top of that, the gallery works just fine but this error keeps popping up in Flash.[code]

View 1 Replies

Actionscript 3 :; URLStream Throws Error # 2029 In Flex AIR App?

Nov 2, 2010

In my AIR app,I am trying to implement a file downloader using URLStream.


public class FileDownloader {
// Class to download files from the internet
Function called every time data arrives[code].....

I simply create an object of the above class and passing the url and the file and call the load function. For some files I get the following error.

remotePath: http:[url].....error while writing bytes from...Error:Error #2029: This URLStream object does not have a stream opened.Which means the error is from the file stream(fileAccess) that I am using. I am unable to figure out why this could be happening. If I try to open the url http:[url]... in the browser, it opens properly. This happens randomly for some files.

View 1 Replies

Actionscript 3 :: Streamed PNG Using URLStream Intermittent When Server Is Bogged?

Dec 14, 2011

In my case I need to be able to cancel loading as the user could possibly be scrolling through alot of images and the if not canceled it can take a few minutes to catch up to the scroll position.So after research the URLStream class seems to cure this problem and I found a good streaming class hereThis class works very nice except when there is heavy load on the server causing lag.When this lag happens the class will dispatch the complete event yet the image will not show.Watching the download with HTTPFox shows the image in fact does get loaded.

I assume there is some kind of delayed issue with the URLStream class and the author of this class tried to correct it using the setTimeout method. I also tried delaying the dispatching of the complete event using a timer and not dispatching until if( this.width != 0 ) was detected and this seemed to work much better.But it is still haunting me just not as often.

View 1 Replies

ActionScript 3.0 :: Check If A URLStream On A Loader Is Open Or Closed

Jun 30, 2010

I have to be able to cancel and kill a Loader process properly and many times. If I dont do this, it seems that the flash player (at least on mac) eventually crashes as some loader processes are flying about , strangling the CPU.

There doesnt seem to be a straightforward way to know this and just calling a Loader.close causes an error, if the stream is not open.

View 4 Replies

ActionScript 3.0 :: ComboBox Style: Can't Style Text

Oct 23, 2009

I've got a comboBox component on the stage, instance name 'combo'. I want to style the text. I followed the adobe instructions, but they seem not work, and I get no errors.

Code:
import fl.data.DataProvider;
import flash.text.TextFormat;
var tf:TextFormat = new TextFormat();

[code].....

View 2 Replies

ActionScript 3.0 :: Error #2029: This URLStream Object Does Not Have A Stream Opened

Dec 14, 2009

I successfully built a XML gallery; everything seems to work fine. But everytime I click on a thumbnail, I will get the following error:
 
Error: Error #2029: This URLStream object does not have a stream opened.
 
I researched on this error, and it seems this error involves sounds. Something about trying to load something that's already fully loaded. Therefore, I'm confused since I don't have any sound in my gallery. On top of that, the gallery works just fine but this error keeps popping up in Flash. Does anyone have information about this error and how to resolve this?
 
import gs.TweenLite;import fl.motion.easing.*;import fl.controls.ProgressBar;import flash.text.TextFieldAutoSize;var imgNum:int = galleryData.image.length();var spacing:int = galleryData.@spacing;var cols:int = galleryData.@cols;var rows:int = Math.ceil(imgNum / cols);var imgCount:int = 0;var gallery:MovieClip = new MovieClip();var detailImage:Loader =

[code]....

View 6 Replies

ActionScript 3.0 :: Voting Poll Using PHP & MySQL >>TypeError: Error #2007: Parameter Text Must Be Non-null?

Dec 13, 2010

I am getting this back:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()

[code]....

View 1 Replies

Flex :: Using NetConnection And URLStream To Send/receive Data At High Frequency

Jun 17, 2009

I'm writing a Comet-like app using Flex on the client and my own hand-written server.

I need to be able to send short bursts of data from the client at quite a high frequency (e.g. of the order of 10ms between sends).

I also need the server to push short bursts of data at a similarly high frequency.

I'm using NetConnection.call() to send the data to the server, and URLStream (with chunked encoding) to push the data from the server to the client.

What I've found is that the data isn't being sent/received as soon as it's available. For example, in IE, it seems the data is sent every 200ms rather than as soon as NetConnection.call() is called. Similarly, URLStream isn't making the data available as soon as the server is sending it.

Judging by the difference in behaviour between the browsers, it seems as though the Flash Player (version 10) is relying on the host browser to do all the comms. Can anyone confirm this? Update: This is very likely as only the host browser would know about the proxy settings that might be set.

I've tried using the Socket class and there's no problem with speed there: it works perfectly. However, I'd like to be able to use HTTP-based (port 80) connections so that my app can run in heavily fire-walled environments (I tried using a Socket over port 80, but that has its problems).

Incidentally, all development/testing has been done on an internal LAN, so bandwidth/latency is not an issue.

Update: The data being sent/received is in small packets and doesn't need to be in any particular format. For example, I might need to send a short array of Numbers, and this could either be encoded in AMF (e.g. via NetConnection.call()) or could be put into GET parameters (e.g. using sendToURL()). The main point of my question is really to see whether anyone else has experienced the same problem in calling NetConnection/URLStream frequently, and whether there is a workaround (it's also possible that the fault lies with my server code of course, rather than Flash).

View 2 Replies

Actionscript :: Download Multiple Large Files And Saving Locally - URLStream Or URLLoader?

Feb 17, 2011

This is absolutely driving me crazy. While I'm a fan of the availability of asynchronous calls in AIR, I'm finding that being forced to use them for something that should be SUPER simple is a severe limitation. So severe that I may end up abandoning AIR and writing native Android and iOS apps instead of using the shared AIR platform.

OK, now that I have that off my chest, here's what I'm trying to accomplish. I have an app that, when deployed, is relatively small. But once deployed to a user's device that user will log in using a login name/password. Once they log in, content specific to that user needs to be downloaded and saved to the local device. Since the content varies by user I can't include it in the package for deployment.

But I cannot figure out how to accomplish this: say I want to download 10 files and each file is 2-3mb and I want to show a "Downloading, please wait..." view during the download. The application cannot proceed until all 10 files are downloaded. But since from what I've seen URLStream and URLLoader are both async I cannot figure out how to block the app from opening the "View available content" and say on the "Downloading, please wait..." view.

View 1 Replies

Long Delay On Everything In Flash?

Jun 4, 2009

I Have Flash CS4 and a pretty decent system with Vista and 3 GB of RAM.  However, whenever I click on anything in Flash, it takes about 3 or 4 seconds for it to become active.  If I click a keyframe, the stage won't come up for 3-4 seconds, if I click the text tool, the cross hairs won't come up for 3-4 seconds, etc.  It has been like this since I installed it...I am just finally getting my full of it.

View 3 Replies

ActionScript 2.0 :: Long Does It Take To Become A Flash Devoloper?

Sep 20, 2006

I know flash know some Actionscript... to be clear what I know is how to take code form a sample file, and build the gui ontop of it... simple stuff not too tech... ie like moving an object onEvent using AS etc.

I have never taken any programming courses I am a university grad with a good amount of math knowlegde and solid (so I'd like to think) design sense. What I would like to know is two things.1. What methods (if any) would I take to become a proficient AS developer.

2. How long will it take (I can basically devote 6 out of the 7 days of the week to this effort.

5 days. ... can it be done in one 4 month semester?

View 14 Replies

ActionScript 3.0 :: How Long Flash Will Survive After The HTML5 And The Discontinuing Of Flash Player For Mobiles?

Nov 14, 2011

I have just been asked to do a project that i can do it in flash cause of its interactivity and graphical comunication and so on... its like an interactive map, VERY interactive. BUT, came the question of how long more will Flash survive after the HTML5 and the discontinuing of flash player for mobiles.Does it worth it doing it on Flash or should i move to something else?

View 8 Replies







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