Any way to prevent a Flash image from reloading every visit to a page...?
I've got a Flash image at the top of each page of my Web site and I only want it to load once per site visit. (Link) What is the easiest way to accomplish this?
When I go to your site, the flash is cached - I am only downloading it once.
It does restart every time though - is that what you mean?
You can put the flash file in a frame and have the rest of the site change in a different frame. This would prevent the flash file from restarting when a new page is loaded. You can do this nicely with it looking like ugly oldschool frames, but most people dont like using frames.
I think I understand what you are hoping to do. Have the Flash animation play on your home page put not replay each time the viewer visits another page. Is the correct? If that's it, use the flash animation only on your home page and use an image (jpg, etc) of the last frame of the animation for the rest of the pages. Then the banner will LOOK like it had just finished playing regardless of which page the viewer is on (except Home page).
To create that image, go to the last frame of the animation, then File / Export / Export Image. Just place that image on your page in place of the animation.
You might also consider using swfobject on your Home page. That allows you to place alternate content in the place of the animation. So while almost everyone has Flash in their browser, maybe a few donít. Well just use that same image as the alternate content on your home page. Then even without Flash, the viewer would still see an image of the last frame of your animation, and the banner would look just like all the other pages.
Nice site by the way! I like the colors and layout.
Yes, that is correct. Any suggestions?
What would you like the viewers to see as they browse to the secondary pages? Just a still image of the logo, or a part of the animation? It looks like the animation loops now, is that what you intended or did you want it to stop after one time through?
Since each page is kind of a separate entity as far as the browser is concerned, it seems like the long way around to alter the Flash to make it control the HTML. Frames would give you one option but you already have all the pages built. Did you do the coding for the Web pages so far? It still seems that a better way to go would be to use a still image as the banner for the secondary pages.
Anyway, good luck on your project!
Wow, I came to this forum for the exact same question. I don't see the answers I'm looking for however. Using a static image for other pages doesn't work for me because the banner is animated. I really, really, really don't like Frames either and will avoid them at all costs.
I'm hoping the solution is not as complicated as I think it will be. I suppose however I could create two flash files, one with the full animation for the homepage and one with just the basic loop made for every other page. It will be a pain if there are ever updates, but it may have to do.
So is the issue that you have a flash that has a beginning and a repeated section, and you don't want the animation to restart from the beginning each time there is a page load, but continue through the looped part?
If so, then you can do a similar thing, where you have the main flash animation, and then a second one for subsequent pages which just consists of the looping element.
Of course it won't be seamless.
But your insistence in "avoiding frames at all costs" leaves you with little alternative.
Frames have received a deserved bad rap after being abused in the 90s [shudder], but there are times where they are appropriate and the best solution.
In this case, an IFRAME would work perfectly for your needs without compromising usability, navigability or the design aesthetic.
Yeah I was thinking iFrame too... much better than standard frames. I'm just researching how that will impact SEO if at all. Then I might go for it.
The use of iframes could be one way around the problem, but it seems that in the case of a site which already has all the pages designed and working…. well it just seems like the long way around. If I understand this correctly, the object would be to hard code in the small animated banner on (for example), the home page and then bring all other content from every other page into that home page in an iframe? Just to have some manner of control over the banner? Or maybe I’m missing something. On the other hand if you put the animation in the iframe, and load page 2 (for example), won’t the browser just have to reload the banner as the page is parsed? If so, then what’s the purpose?
I’ve only used iframes to bring in small pieces to a larger page and not the other way around, so I’d be interested to see how it would work. Since the original (finished) site already has several pages of links, file paths, etc. , wouldn’t redoing all the pages into 1 iframe result in a lot of path and link issues?
A second banner, either static or animated just seems to make more sense to me. Personally I would go with the static version to avoid the annoyance of the instant replay affect (or at least start the looping section with a short period of no animation).
But….I’m keepin’ an open mind…
preventing flash image from reloading
Write a 'local shared object', this can store data on the client side. You then read the stored data when the flash page is refreshed and take the appropriate action.
Well the "local shared object" was new to me but I really appreciate the tip. Now that I've done a little research on it, I can think of an application or two that I would like to try it on. Thanks!
Use "<object> ~ </object>" tag:
Originally Posted by digitaldervish
(example. -you'll want to control the data="" part with your own page, which would contain the FLASH in a 'container' equal to the width/height used in the "<object>" tag, and nothing else..)
<object type="text/html" data="http://www.webdeveloper.com/forum/" style="width:500px; height:500px;"></object>
Do note that for Accessibility reasons, there will ALWAYS be a "vertical scrollbar" on "object", -even if grayed-out and not needed. This is built into every browser's shell (or chrome) to always provide navigation should the programmer err and forget to make it "scroll" if the height of the content exceeds the height of the constraining box...
Last edited by WebJoel; 03-08-2008 at 02:10 PM.
I build for: Firefox and tweak for IE
Thanks for all the great replies guys. To clarify, what I am looking for is a way to prevent the Flash from RESTARTING when the page is changed; so, in other words, prevent it from reloading, and just continuing where it left off from page to page. The IFRAME might work, but I tried that and I just get a blank white box with scroll bars when I use that. Is there ANY way to get this to work???
I've the same question. see example here;
The counters at the top right are flash. the appear on every page when you navigate through the site they disappear and reload with each page. it would be much nicer if they could load once and then stay constant while the pages change around them. Any suggestions?
P.S. They are already in an iframe as this was the simplest way to add them to the site.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)