Flash as3 webservice call not called, with IE7 - actionscript-3

In a big as3 project we use web service calls with "Operation" class.
There is a webservicecaller class which is used by lots of objects to do calls.
In IE7 (some users, independent of the version), the first call is done, but not the second.
Tracing with MonsterDebugger show us that the function of the webservice is call, but no network traffic is visible in WireShark, and no call is visible serverside, in the server logs.
On my test computer, XP Pro SP3 with IE7, shockwave player 11 installed.
All is fine with other browsers/versions
Is there some specific code to do?
I have added the removeEventListener when the first call is finished, but no changes
Thank you for your help,
Sincerely,
François D

Prob. ie caches your requests, this may cause the problem. You can use timestamp to solve problem.

Related

Mvvmcross Subscription message firing stalls for 20+ secs after first viewmodel is shown

In some of my my viewmodels and some background running services, I need a second tick for all sorts of actions such as Statemachine progression etc..
To avoid having to create a Timer for every occasion, I have one TimerService which publishes a Messenger plugin message every second.
Those viewmodels or Services that need it just subscribe to this message.
This has worked well for over a year. Recently I noticed a rather long startup time of my app. After some debugging I found that after the launch of the first Viewmodel (it is correctly displayed), it takes about 25secs before the subscriptions start picking up on this message. Seems like something is holding back the publishing of these messages.
During those 20+ secs there is no activity by MvvmCross at all. Nothing is logged by Mvvmcross at all.
What could cause such behaviour ? When in the startup sequence does the messenger plugin start distributing its messages ?
I apologise for not posting code here, as it is a phenomenon that is just happening across the whole application. None of the singleton services that run in the background pick up these messages until after 20secs everything starts working properly.
EDIT: MvvmCross V3.5 is used along with latests stable updates of Xamarin. Problem occurs on every Android version tested.
After some experimenting (and reading all the MvxMessenger docs again) I tried using the SubscribeOnThreadPoolThread method instead of simple subscribe for one of the published messages that typically triggers updating the properties of a viewmodel on a regular basis in its handlers. This made the problem go away.
Normally the handling if this viewrefresh message is fast and doesn't require more then copying repository values (that are updated by a background service) to the visible viewmodel properties. I guess there's somewhere a synchronous call in one of the refresh handlers that make the messenger system block.Haven't found it yet.
What are typical situations that can make the Messenger plugin block ? I would be very interested to understand that a little better.

Getting connection status with as3 ( like weak, string etc... )

I need my client to check if the user connection with my server is strong or weak or etc, so i searched a lot and i think using URLLoader may be the answer:
I need to ping to an network with flash or actionscript
Is there a better way or this should do it?
The only thing using a URLLoader will tell you is if the device has a connection to that server or not. There is no in between, as you seem to desire. Additionally, if the requested server is down or slow (and Flash times out), your app will think it has no connection to the internet at all.
If you are using Adobe AIR, I suggest looking for an AIR Native Extension (commonly abbreviated to ANE) that does this. FreshPlanet has one called "ANE-Network-Info" that provides a way for iOS and Android apps to read if they have a network connection or not, though no way to get signal strength. Do some searching and you will probably find one, at least for iOS and/or Android.
If this isn't an AIR app, there's not much you can do. I suggest you treat it as any other website. If the connection drops or is weak, that's the problem of the client, not yours. If a request to a server fails, alert them. Beyond that, I don't think there is much else you can do.

GameInput API doesn't work once the SWF is embedded in a HTML page

I've built a small demo application to test the GameInput APIs that Adobe released a little while ago. It works perfectly in debug mode, via the .exe and via the .swf that get generated via Flash CC, but when I test the application embedded on a web page, I can no longer use the controller (I am using an Xbox 360 Controller).
I've spent some time researching, and can't find any references to the GameInput classes either working or not working when the SWF is embedded on a web page.
Does anyone know if it is possible to get working (perhaps via some extra data in the HTML embed code) or whether this is an obstacle I won't be able to get around?
The GameInput classes absolutely work in the browser. Support has been there since Flash Player 11.8 (in beta), then officially added with 11.9.
It does come with some caveats:
Not all devices work; some fringe devices may get ignored by Flash.
Sometimes the addition of devices that are supported don't really work - you may have to disconnect and reconnect them to get them to work.
Sometimes when using multiple controllers of the same type they get mixed up and only one of them will work.
Actual reported control ids vary between the Plugin/ActiveX version of Flash (Firefox/Safari/IE/etc) and Pepper (Chrome).
You usually need to press a button with the proper SWF focused for the GameInputDevice to be detected and reported.
An XBox 360 controller is guaranteed to work. That's FP's main "target", if such a thing exists. I have personally performed dozens of tests with different devices and the (wired) XBox 360 controller is the only one that never gave me any headache.
I have a published SWF that works for testing which devices have been properly detected, and their reported controls, with source code available as well.
As a final note: as is the norm with any HTML-embedded SWF, be sure to always test in a server, not using file:///. A local server with XAMPP or whatever will do. Loading SWF content without a server always gives you a lot of restrictions that you have to circumvent and it's generally more effort than it's worth. I wouldn't be surprised if GameInput support was unavailable for SWFs loaded from file:/// on some given browser.

Building web server using chrome.socket API

I've built a web server using Chrome Packaged Apps. The problem I see repeatedly is that chrome.socket.accept() and chrome.socket.write() don't invoke their callback functions. It usually works more or less reliably if request rate is less than 1 request per seconds. If I go above that, then I start seeing errors or missing callbacks.
I did similar tests with sample "webserver" app build by Google (https://github.com/GoogleChrome/chrome-app-samples/tree/master/webserver). It has the same problem. It usually takes less than 100 requests before web server stops responding. The easiest way to reproduce the problem is to use Chrome browser as a client and hold F5 key for few seconds.
It would be desirable to have a sample app that demonstrates how to build reliable web server using chrome.socket. So far I tried several different workarounds for monitoring the situation from the app itself and restarting socket when socket stops working, but it's not easy because there is no reliable way to check the status of the connection or status of the last operation when callback is not fired. I tried to use getInfo() method, but it always returns "connected=true" regardless of the situation.
I saw this on Windows 7 and Chrome OS (Chromebook).
Just an update on this. According to this the issue is now fixed.
There are still other problems with the sample web server application. I noticed that I could make the sample app lock up by holding down Ctrl-R in the browser. I wrote a more robust one that you can use here: https://github.com/kzahel/web-server-chrome

Does Policy Request needs Delay?

My friend and i have been working on a multiplayer game in as3. Tests without policy request has successed on local, but at last we added it so we could test on the browser.
Weird stuff happened, because it managed to connect to the server, but it was needed to spam the connect button in order to start sending data.
With a timer the problem has been solved, but we dont want to wait 5 seconds in order to connect. I dont know what is wrong, and few information can be readed on the internet about this matter. Has someone experimented this issue?
It probably is because the flash game has to be loaded in the cache first from web. it may be dependent on the internet speed, the computers cache, the browser you are using , etc. same goes to every other document, flash, HTML, etc. , testing it locally gives you instant access, but opening it from web would take time
Policy request should not require you do add a delay manually, so there must be something else going on.
Even though the method is named Security.loadPolicyFile(), a policy
file isn’t loaded until a network call that requires a policy file is
issued. Calls to loadPolicyFile() simply tell Flash Player where to
look for policy files when they are needed.
You can’t receive notification of when a policy file request is
initiated or completed, and there is no reason to do so. Flash Player
performs policy checks asynchronously, and automatically waits to
initiate connections until after the policy file checks have
succeeded.
Source: http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e08.html