2

I am trying to use swfobject 2.2 to display an swf, but the swf won't scale to fit the div that I'm putting it in. You can see what I've got here.

When it first loads, it is the right size, then it expands larger for some reason. If I right-click on the movie and select "Show All", it then fits perfectly.

Here is the code to generate the sfobject:

var flashvars = {};
var params = {}
params.scale = "showAll";
params.allowscriptaccess = "always";
var attributes = {};                    
swfobject.embedSWF("/content/tour.swf", 
"flashContent", "900", "700", "9.0.0", "expressInstall.swf", 
                       flashvars, params, attributes);

Any help/suggestions would be greatly appreciated!

ConsultUtah
  • 6,639
  • 3
  • 32
  • 51
  • Here is the [answer](http://blog.jingproject.com/2008/01/answers-to-some-faqs.html) in case anybody cares. Jing videos cannot be scaled. – ConsultUtah Apr 27 '10 at 16:32

5 Answers5

0

As TestPlanManagement.com answered correctly, Jing videos cannot be scaled. But the SWF can be changed to allow this. See Resizing embedded screencasts with TechSmith Jing. The commercial Action Script Viewer is used to change the constant in the SWF.

Peter Kofler
  • 9,252
  • 8
  • 51
  • 79
0

You need to add some extra script like so:

function resizeFlashDiv()
{
        var theDiv = document.getElementById("navContainer");

        var theHeight = Math.floor(theDiv.offsetWidth * .33625) + 50; // add
the variable portion plus the fixed portion of the Flash

        theDiv.style.height = theHeight + "px";

}

This will make your SWF fill the DIV.

Todd Moses
  • 10,969
  • 10
  • 47
  • 65
0

To make the size of the div set the size of the swf (or rather the Flash Player) you can use "100%" for size in the swfobject.embedSWF() call, instead of a pixel size.

swfobject.embedSWF("/content/tour.swf", "flashContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);

The other parameter to work with is scale. The alternatives are:

  • "showAll": The entire application is visible in the specified area without distortion while maintaining the original aspect ratio of the application. Borders can appear on two sides of the application.

  • "exactFit": The entire application is visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, and the application may appear stretched or compressed.

  • "noBorder": The entire application fills the specified area, without distortion but possibly with some cropping, while maintaining the original aspect ratio of the application.

  • "noScale": The entire application is fixed, so that it remains unchanged even as the size of the player window changes. Cropping might occur if the player window is smaller than the content.

Lars Blåsjö
  • 6,118
  • 2
  • 19
  • 23
  • I'm doing that, but without success. You must be right, because everyone who has answered has said the same thing, but I can't figure out what's wrong... – ConsultUtah Apr 19 '10 at 22:27
0

The quickest thing I can think of is just setting the width to 100%. I've tested and it seems to work fine:

screenshot link full width

Lars has already posted all the available alternatives.

HTH, George

Community
  • 1
  • 1
George Profenza
  • 50,687
  • 19
  • 144
  • 218
  • I must be doing something horribly wrong since all three of you say the same thing, but I can't get it to work... – ConsultUtah Apr 19 '10 at 22:26
  • George, I set the width to 100% and it doesn't work for me, yet I can see your screenshot. If there anything else I might need to do? Thx – ConsultUtah Apr 20 '10 at 16:27
-1

check inside your loaded swf code, if you are setting the stageScaleMode to noScale. That was the source of my problem.

Jassi
  • 1