Forum Sitebox swf width & height in %

Discussion and help relating to the PlayerIO webpage and Facebook app hosting solution, Sitebox.

swf width & height in %

Postby lvdeluxe » December 31st, 2012, 11:31 pm

Hi,

I'm working on a facebook app, and I need to specify my swf height and width in precentages instead of pixel (to use the "Fluid" settings of my app)
But as I use a template to embed my swf, like this :
{% swf src='swf/game.swf' width=760 height=500 myflashvar='game' %}
I cant specify the percentage value.
Is there a way to use percents instead of pixels in this case ?
Thanks.
lvdeluxe
 
Posts: 3
Joined: September 24th, 2012, 11:42 pm

Re: swf width & height in %

Postby Benjaminsen » January 4th, 2013, 11:22 am

use width='100%'
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: swf width & height in %

Postby lvdeluxe » January 20th, 2013, 11:21 pm

thanks for the reply,
it`s working fine for the width parameter, but when I do the same for height, the swf is not displayed anymore...
Any idea on how to bypass this ?
thanks
lvdeluxe
 
Posts: 3
Joined: September 24th, 2012, 11:42 pm

Re: swf width & height in %

Postby Benjaminsen » January 22nd, 2013, 9:34 am

lvdeluxe wrote:thanks for the reply,
it`s working fine for the width parameter, but when I do the same for height, the swf is not displayed anymore...
Any idea on how to bypass this ?
thanks


You are running into the fact that browsers does not have a default hight on documents. The width is easy to find as it's just the browser width. However hight, due to the ability to scroll can be anything. Thus your browser returns 0px for hight if there is no content.

It is luckily reasonably easy to solve. see http://stackoverflow.com/questions/6654 ... ser-height
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: swf width & height in %

Postby lvdeluxe » February 10th, 2013, 3:09 am

Hi,

I tried the solution you showed me but with no good results...
Seems like the src height overrides the css html/body height:100%
I aslo tried to resize my swf dynamically with the js onLoad method, but with no better results...
Maybe I could pass some js variable to the src params, but I can't figure out how to do this.
I need my game to be ready for next week (contest deadline!!!) so I'd really appreciate any help on this,

Thanks,
lvdeluxe
 
Posts: 3
Joined: September 24th, 2012, 11:42 pm

Re: swf width & height in %

Postby Andersan » November 13th, 2014, 5:47 am

Any idea on how to bypass this ?







________________
Fai
Fai
Andersan
 
Posts: 2
Joined: November 13th, 2014, 5:37 am


Return to Sitebox



cron