add padding/margin

9 views
Skip to first unread message

Matus

unread,
Dec 14, 2009, 5:32:14 PM12/14/09
to SWFFit
By default the flash movie fits the full window. What is the
recommended way to add padding/margin?

My aim is to achieve top and bottom padding 10px. Setting padding
via CSS !important is no good, so I think editing the swffit sources
is the right way to go, right?

M.

Miller Medeiros

unread,
Dec 16, 2009, 10:39:27 AM12/16/09
to swf...@googlegroups.com
why do you need padding around the flash movie?? can't you replicate the effect inside the flash movie?

to add this to swffit you will you probably only need to change the methods setPosition() and setSize() to adapt the border around the flash movie..

if you need only the minimum size (no rescaling or maximum size) I would recommend creating a new script from scratch.. because then it will fit better to what you need to accomplish - you will need to change a lot swffit structure and depending on how you do it it's going to be "tied" to this specific project and wouldn't be useful to other projects.

just to make it easier to change the code here is a "documentation" of the private vars that swffit uses to store all data:

_ft, //{Element} object element (flash movie)
_re, //{Boolean} has resize event listener
_t, //{String} object id
_mw, //{int} min width
_mh, //{int} min height
_xw, //{int} max width
_xh, //{int} max height
_hc, //{Boolean} horizontal centered
_vc, //{Boolean} vertical centered
_ow, //{int} object width
_oh; //{int} object height

sorry for not using better names for the vars (like: _minWid, _minHei, etc..)  I've done this way to reduce the file size and be able to deploy swffit just removing the line breaks and unnecessary spaces.. (maybe I should change it in the future and use YUI compressor to deploy..)

good luck!

--
Miller Medeiros  |  www.millermedeiros.com

Matus Laco

unread,
Dec 17, 2009, 6:55:52 PM12/17/09
to swf...@googlegroups.com
I've ended with replicating the effect inside the flash movie. Quick and Dirty :)

BTW: a big thank you for your script!!! great time saver!

Matus.


--

You received this message because you are subscribed to the Google Groups "SWFFit" group.
To post to this group, send email to swf...@googlegroups.com.
To unsubscribe from this group, send email to swffit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/swffit?hl=en.

Reply all
Reply to author
Forward
0 new messages