Older build version detection - actionscript-3

I'm working on a social game (actionscript) whenever I upload a build seems like for some users the new build isn't downloaded instead the older version (cached) is served to them. How can I detect the user is on an older version and perhaps throw a popup at them?

I think it is more about your web server configuration. Cache related headers to be more precise. But we at some point decided to solve this issue by publishing application####.swf upon each deployment, where #### is a build number. And updated the HTML wrapper accordingly.

A little trick you can use is to append some FlashVars to the end of the embed code, e.g.
<embed src="file.swf?version=1.01" .. />
All you need to do is update the value of version each time you update the SWF.

Related

How to fix pointer event issue in Chrome 55+ without upgrade to newer version

We are using UI5 library version 1.36.12 in our Web app but due to chrome update some controls like IconTabBar, MulticomboBox are not working properly due to pointer events not disabled by default in the latest versions of Chrome.
One solution to this problem is to upgrade to version 1.38.14 but we are running in a tight schedule and we have to make many changes if we update the library.
One solution I tried is adding the fix in sap.ui.core.js file in current library jar files. But it is still not working. Should I have to rebuild sap.ui.core.js file and if yes how should I do that?
Please don't suggest to manually deactivate functionality in chrome through chrome://flags/#enable-pointer-events as client is not approving for that. Please suggest me a way to solve this issue without upgrading the library.
In the current UI5 version you can load your own Device object beforehand and UI5 will use it. I assume that this works in your version as well.
UPDATE: My proposal to reset the value later cannot work as it is used in the bootstrap mechanism. Therefore I removed this. Then the last resort is to use the approach mentioned by codeworrior on GitHub:
Before you bootstrap UI5 add a script tag and do the following:
if (/chrome/i.test(navigator.userAgent)) {
delete window.PointerEvent;
}
In this case pointer support is set to false.

Google Web Designer has a very long load time

I'm creating an html5 banner using Google Web Designer. I've created the banner and published it. When I view the published version I noticed that it takes sometime to load.
Someone else on my team is also creating HTML5 banners. The banner that he creates loads instantly even though its a larger file size. We compared our files and other than the actual assets, the way the banner was created and published is the same.
Does anyone have any ideas why this might be happening?
GWD add this code at the end of the banner and animation show up immediately:
<script data-exports-type="dclk-quick-preview">studio.Enabler.setRushSimulatedLocalEvents(true);</script>
Which environment are you using?
When creating a new project in GWD you are able to select an environment. By default is DoubleClick.
This adds additional file (in the case of DoubleClick, the Enabler library).
If you open your Chrome console, while running the banner, you will see that the banner is not initialized until the enabler is available.
You will also see how much time it takes to load the enabler.
If your colleague is creating a banner without that library, or without correctly listening to the event Enabler.initialized, this may be the main reason for the discrepancy.
If you don't want to include this additional library (that is used to integrate your banner in DoubleClick Studio), just select Generic from the environments dropdown.
There is also another reason that may cause the delay, and is the PoliteLoader.
You can select to politeLoad the banner from the Publish menu.
If the PoliteLoader is selected this cause the banner to be initialized only after the page is fully loaded. This may cause delays compared to a non polite loaded ads.
This all seems not to be a bug, but a feature of enabler.js simulates a test environment, when not beeing uploaded to Adwords (guess it similar in Doubleclick). Uploading to Google Environments should change the situation
Look at the console and see:
There is a long delay in alle items loading after the enabler.js.
It is NOT because of a long loading time of enabler.js - thats all fine.
Looking at the Logs, the enabler waits a second and throws out:
[ 1.008s] [studio.sdk] Using default ad parameters in test environment. Simulating local events.
When uploading to Google Adwords (i assume that this all is similar to DC Studio) - the enabler throws out different logs and the delay disappears.
Hope this was helpful.
By chance, I found out a way to make the Enabler loading fast. Instead of using Publish, use Preview to generate the HTML.
For some reasons, Enabler.js in preview-generated HTML only takes 0.019s to load as compared to Enabler.js in publish-generated HTML taking 1.015s to load.
Studio Enabler SDK looks for "e" parameter in iframe URL containing Studio creative. It expects a number and uses that to set the creative environment.
Setting e=1 in your preview environment (query string parameter in the iframe url pointing at the index.html for your studio creative) will tell Enabler to use LIVE mode.
I assume there is a reason why Enabler has this functionality (avoid counting impressions or paying for impressions from test/qa environment)...so I wouldn't suggest using this as a permanent setting.

Clearing website cache for new launch

We have beta testing a new version of a website which is similar to the previous version.
I see the old and new versions conflicting due to the previous version being cached in my browser.
I assume this will happen to most of our users who don't clear their browser cache regularly. How do I ensure that the new website is rendered without such cache conflicts?
The best way I know is to add a parameter to your css file.
<link rel="stylesheet" href="/stylesheets/styles.css?{{ site.time | date:'%Y%m%d%U%H%N%S' }}">
We use Jekyll to run our site, and using liquid templating I added a time stamp to end of the main css file. Every time we deploy a new timestamp is generated, telling a browser to download the css file and not to use the cached version.
Not sure what you are using to run your site but to test you can statically test this by adding a "?" at the end of your css file and add random number. If you are using any sort of backend you can set this dynamically.

compiling HTML5 to .exe/.dmg

I am currently beginning a project where we want to build an Interactive Whiteboard (educational activities) and deploy via CD-ROM. I want to build the project in HTML5 for it's interactivity and then somehow compile it to both .exe. and .dmg so when the CD-ROM is inserted it autoplays the 'Game'.
How is this possible? Any help/advice would be greatly appreciated. Thank you.
I already made a project using pure C (WinAPI) on github that can pack HTML files into single EXE using resources.
http://github.com/dns/WinAPI-Embed-Browser/releases
Use: res://programname.exe/test.html as path to access html files from your EXE file.
From here you also can hide the window border & just showing the content of your HTML app, or even running on fullscreen. This is very useful if you want to make interactive CD-ROM.
On Mac, you can use Delphi/Lazarus TWebBrowser control to load html files. However I don't know if mac program can access files from resource or not.
HTML 5 is a browser technology, so I think as long as the pc you are installing on has the latest browsers, installing your app should work fine.
Can you tell us why you want it as a CD-ROM based installation, where as you can easily host it online?
You may not need any .exe wrapping. Here is an approach.
Important: your autorun will be often disabled, [not so] quietly. Provide some instructions for running your application manually.
So:
Google for running a portable version of Firefox or Chrome from a CD. Have the browser prepared. Put it in a [sub]directory representing your CD.
Put your content there.
Create a .cmd file to invoke the browser with a command like,
FirefoxPortable.exe index.html
Create autorun.inf (details googlable) to call the above batch file.
Make a CD image from that directory. There are lots of CD burning applications that can do that.
Test.

Adobe Air - Open app in fullscreen

I created an Air desktop app with Flash CS 5. Usually Windows (XP) is opening an application (like Firefox) with the latest set size and position.
For my installed Air app it's always just the default one.
How to start it with the latest used size and position?
Thanks.
Uli
hope this will work for you:
http://cookbooks.adobe.com/post_Using_the_FullScreen_functionality_in_AIR-8004.html
http://blog.ochodurando.com/2010/04/adobe-air-e-fullscreen/
You need to save a record somewhere that remembers the window's size, and possibly position. If your app has a preferences file, this would be an ideal place to store that information. Then, whenever your app starts, it checks for this information and resizes the window if any values are found.
Most popular programs include this feature (and don't even mention it, since it's pretty basic UI), but it's done intentionally and not as a default for every application. Thus if you want it, you have to program it in.
You can read and write to application.xml. You'll find there and nodes.
file = new File( File.applicationDirectory.nativePath + "/META-INF/AIR/application.xml" );
Adobe restrict writing access to application diractory but this trick is useful if you don't want to create a separate config file in app-storage:/ folder, which is of course prefered.