LOGIN Don't have an account yet?   Register

Forgot password?
 
19May2009

Prevent page refreshing when using SWFFIT


For our fullscreen flash websites, we usually use SWFFit in order to make sure our content is still visible if you browse from a smaller screen computer. SWFFit is a smart script that resizes your flash movie automatically if your browser window size is smaller or greater than your flash minimum desired size keeping it accessible independent of screen resolution.

swffit_logo

If you are ever going to use swfFit for your website, you should know that the solution for not having the website reload at the first use of swfFit, is to initialize it before you use it in the website, because it rewrites the swf file in html, so it flickers.

You have to initialize it in the html code, like this:

// PARAMS
var params = {};
params.bgcolor = "#ffffff";
params.menu = "false";
params.scale = 'noScale';
params.wmode = "opaque";
params.allowfullscreen = "true";
params.allowScriptAccess = "always";

// ATTRIBUTES
var attributes = {};
attributes.id = 'website';
attributes.name = 'website';

// JAVASCRIPT VARS
// stage dimensions
var stageW = "100%";
var stageH = "100%";

/** FLASH VARS **/
var flashvars = {};

/** EMBED THE SWF**/
swfobject.embedSWF('preview.swf?time=' + Date.parse(new Date()), 'website', stageW, stageH, '9.0.45', 'website/js/expressinstall.swf', flashvars, params, attributes);
swffit.fit("website", stageW, stageH);

For a nice example of the usage of swffit, please visit the latest website we released at Vuzum: http://www.tatravagonka.sk/2009/

Not sure how visible the most important line is, so I will paste it again here:

swffit.fit("website", stageW, stageH);

It’s the last line. You need to make sure that you have also declared the library in js, like this:

<script type="text/javascript" src="website/js/swffit.js"></script>

This post has 2 comments | Post your comment

Martin Klausen

September 25, 2010 at 5:40 am

I love SWFFit and it’s a great solution for flash sites with different heights.

I’m using the same but I have a problem with Safari making the website flicker. I saw that your Tatravagonka website does the same in Safari.

Have you found any solution for this?

Reply
 

Andrei Potorac

October 5, 2010 at 12:45 am

This looks like a bug in the new Safari version. It wasn’t there when we built Tatravagonka. Maybe the latest version of SwfFit fixes it?


Leave a Reply

blog entries RSS Feedproducts RSS Feed

Categories

Popular Files

  • Compact Flash Mp3 Player
  • Horizontal Image Slide on Mouse Move
  • Accordion Menu with Images from XML
  • Accordion Banner Rotator
  • Continuous Image Slider
  • Mp3 Player with Playlist
  • Flash Ken Burns Effect Slideshow
  • Accordion Gallery
  • Horizontal Scroller Slideshow
  • Fade In Fade Out Slideshow With Navigation
  • Simple AS3 Flash Video Player
  • Zoom Gallery

Download the plugin above
Read more about Flabell WordPress plugin

Archives

Search the blog