How to force download of css swf before page load in adobe flex? - flex4

I have a compiled css file (swf) which I am loading in my preintialize phase of my spark application in adobe flex 4.1.
I have observed that for every user, the first time, the page loads without any css and in a second or two the CSS loads and there is a flicker.
I understand that it takes time to download the swf from server and hence, the flicker appears. After this, the browser caches the same and hence we don't face this on other views.
Could anyone please suggest how can I avoid this flicker? How can I enforce the swf to be cached first and then load the page?

I found the solution to this. It has 2 steps:
Prefetch the css swf file in html before running the flex application swf made the css available in cache before the app loaded. It removed the flicker.
The css swf file was trying to reach out to crossdomain.xml CDNs of adobe which were blocked by my firewall. As a solution, I set static-link-runtime-shared-libraries to true in my mxmlc compiler arguments. It made my css swf file a bit larger, but now it does not lookup adobe CDNs anymore.

Related

How to check why there is a lag loading the stylesheet for website

I'm building a website and there seems to be a lag with loading the stylesheets. It seems as if the page loads without the stylesheet and then a few seconds later (depending on the network speed) the entire page loads. This would of course be a bad experience for the users. I can't figure out what stylesheet is not loading quickly to cause this delay. Here are the links.
http://www.hotelzoo.com/sign_up?hotelregister=true
http://www.hotelzoo.com/sign_in
I'm coding this using Ruby, Heroku, and AWS if that helps.
You're importing the CSS in the bottom of the page, together with the JavaScript but it shouldn't be there. Always import the CSS inside the <header> tag at beginning, this way the browser will load the source files before rendering the page.

AS3 - Understanding how [Embed] metadata works

While developing a game I usually load my assets using a loader, while listening to whenever the loading is completed before even interaction with each object I'm loading.
However, I found people are using the Embed in order to "load" images and sprite sheets, in order to improve performance and so on. So I did, but I do not understand how it's actually work in real-time. My game is running on the web, and how could I know for sure the Embedded image are loaded and ready to use? I understand it's loaded when compiling the project while running on local, but what will happen when running on the web or on mobile?
I'm doing something like this:
public final class Assests
{
[Embed(source="../assets/character.png")]
public var Character:Class;
public var characterBMD:BitmapData = new Character().bitmapData;
}
What if there are tones of graphics to load? How can I listen to whenever it's ready, while showing the user a loading screen, just as usually via the loader Class.
Embed, as the name suggests, embeds the asset inside the swf file itself. So no loading is required as it's loaded as part of the swf file (along with code and any other assets embedded in the swf). This is the equivalent of having library assets in Flash Professional. All your assets are a part of the SWF file.
Using a Loader, is loading in a separate asset after the swf file has loaded.
So, embedding will add to the size of the swf (and cause the entire swf to load slower).
Loading with Loader after the fact, makes the initial swf open quicker, and then allows you to load asynchronously and show a progress bar or do other things during the load. It also allows you to have dynamically loaded content. So you can do things like determine the users screen resolution, and load a higher-resolution images for that user if their system would benefit from that.
Generally, loading with a Loader is best for large files. Embedding is great for lots of little files or anything you need available immediately.
When you use [Embed] it's compiling the assets into the SWF, so there's no additional loading at runtime. By the time your AS3 is executing, the asset is ready to be used.
This speeds up initial load time because loading in assets has a lot of overhead [relatively speaking] that can be skipped when its embedded directly in the SWF, however the trade-off is that the SWF itself becomes much heavier and you have no choice but to load the embedded assets with the SWF.

How to start loading big background image earlier than other external resources?

I am trying to think of a solution to start loading a background image after loading *.html or *.php, and not waiting to load *.css or *.js. When I look in Web Inspector on the Network tab how my page is loading, I see that images start loading only after all scripts and style sheets are loaded.
Could you be a little more specific?
If you want to pre-load you will need JS support, so that can be done once the JS is working and if you are writting non-intrusive JS then you probably will have to wait until the document is loaded.
The behaviour you are seeing is due to the fact that browsers limit the number of simultaneous connections. Since your styles and scripts are likely in your <head> section, they're bound to be called before the background images. Therefore images must load after styles and scripts - doubly so if the style defining the background image is in your stylesheet.
There isn't really any way to avoid this on the first load, but if you're setting the correct cache headers the images will be instant afterward.

How correct set ApplicationBarIconButton IconUri?

I specially download wp7 standart icons for AppBar, I set image build action to cotent, and copy to output copy always. But whatever I do Icon doesn't changed. What must I do?
The problem is solved.My probles is that instead IconUri="/Images/ic_menu_album_create.png"
I wrote /Cafe4Us.WP7;component/Images/ic_menu_album_create.png
I would change the properties of your image from "Resource/Copy never" to "Content/Copy if newer". By setting this as a resource, it compiles those images into the DLL that loads when the application starts up instead of pulling from disk after the application is already loaded. 1 or 2 images is not that big of a deal, but if you're dealing with a lot of images, marking them as resources can slow down the loading of your DLL into memory, causing a percieved performance issue with your application.

Multiple swf files not loading in DNN 5.X

We have run numerous tests now and it has now come down to either a DNN-SWFObject loading multiple swf files on a page or Firefox bug.
Here's the outcome we need:
Two swf files on one page:
Header.swf: which holds the nav and some bling animation.
Map.swf: which has different provinces of the country highlighted on rollover. The active province is highlighted by reading the URL via Javascript and then loaded into the Map.swf via FlashVars.
In all of our other tests in other browsers, the scenario works very well but in Firefox 3.5.3 The swf files refuse to show.
We have stripped this test down to the bare minimum, one html page scenario and embedding it the same way using SWFObject 2.2 and this works in Firefox. When it is uploaded in DNN, the swf files refuse to show.
Is there anything anyone can think of?
Many thanks,
James
My first thought would be the way dnn renames element ids - and are you using client ids
If you could post some code it might help to look at it or a url to look at

Resources