Closed (works as designed)
Project:
SWFAddress
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Mar 2008 at 19:07 UTC
Updated:
13 Jul 2010 at 17:47 UTC
Thanks for a great module!
It would be nice if the size of the swf could be set in percentage as well as pixels.
Comments
Comment #1
Steven Merrill commentedThe new 1.1 (long story) release of the SWFAddress module supports percentage heights and widths in addition to the upgrades to the latest versions of SWFAddress and SWFObject!
Enjoy.
Comment #2
thulstrup commentedThank you Steven!
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #4
alistairmcclymont commentedusing v1.2 and have set the size as a percentage (100% for both) but the div tag is no longer being replaced - works fine as a pixel size.
In the code the js and div are as below:
Thanks in advance - fantastic module by the way
Comment #5
protocol0 commentedHello,
I am experiencing the same issue as alistairmcclymont... the swf replacement does not work when a percentage is specified for width and height of the swf.
The module does in fact replace the div, but it seems to draw the swf with a width and height of 0 pixels when a percentage value is specified.
When the width and height are dynamically changed to pixel values in the DOM the swf displays properly.
I suppose it is possible that some other issue with our drupal configuration is at fault, but I don't know what that might be.
Comment #6
protocol0 commentedThese issues are resolved by applying CSS that insures all container elements have the desired height and width, such as:
See http://code.google.com/p/swfobject/wiki/faq question #1
Also, it is important to note that several parameters necessary for a full screen flash layout, which is the most likely use case for percentage values for SWF width and height, are not yet supported by this module.
Scale, window mode, salign, and allowfullscreen are configurable in the SWFtools embedding settings (/admin/settings/swftools/embed) but are not actually passed to the sprintf call that builds the swfaddress constructor for JS.
I worked around this hackishly by hardcoding these values into swfaddress.module:
It might be good to finish this implementation or remove the form elements from the swftools config page to avoid people barking up the wrong tree.
That said, thanks for this module :)
Comment #7
amcc commentedThe solution to making the flash 100% is making sure that every single parent div of the div you're replacing with the flash content is set to height: 100%. The problem with that is that you've got 2 versions of the site, a flash version for those with it installed (and javascript running) and an html version for everyone else and probably the admin user and any other backend or user stuff. But swfobject provides a method for adding CSS if the conditions are met for the correct flash version. I've put the code below at the top of my page.tpl.php at the bottom of the header:
http://code.google.com/p/swfobject/wiki/api
swfobject.createCSS(selStr, declStr)
Exposes SWFObject's internal cross-browser method to create a dynamic stylesheet (for media type screen only). It's most important feature is that it can be called before the DOM of a page is loaded. Based on a solution by Bobby van der Sluis [ http://www.bobbyvandersluis.com/articles/dynamic_css/index.html ]:
* selStr is a String value that represents a CSS selector
* declStr is a String value that represents a CSS declaration
Sample page: [ http://www.bobbyvandersluis.com/swfobject/testsuite_2_1/test_api_createc... ]
Comment #8
bmcmurray commentedAs noted in the above comments, this is a CSS problem, not a problem with the module. See previous comments for suggestions on how to set your CSS to work for full-window Flash sites.
Comment #9
smerrill commented(When #343045: Allow all SWFObject 2.1 params to be passed is added, SWFAddress should be configurable enough to let you send the extra parameters you might want.)
Comment #10
mautumn commentedamcc thanks very much for your info. It saved a lot of digging around. Much appreciated.