Setting web page background color

General Tips & Tricks
Site Admin
User avatar
Posts: 223
Joined: Fri May 26, 2006 1:51 pm
Location: Rochester, NY

Setting web page background color

Postby Andrew » Wed Apr 15, 2009 6:30 am

If you want to set the background color of the web page that the Viewlet sits in you will need to edit the HTML that gets published with the Viewlet. In ViewletBuilder this is accomplished by editing the HTML Frame in Project Properties.

In Standard.qframe, modify the file named "$VIEWLET_NAME$_viewlet_swf.html"
You can set the web pages background color by changing the bgcolor= value in the body tag.

For example to set it blue:
<body bgcolor="#0000ff" ......

Additionally, if you've set "Scale To Fit Web Page" option in Project Properties, then Flash will try to scale the Viewlet but also maintain the proper aspect ratio. This can lead to extra area on the top or sides of the Viewlet that needs to be colored. By default this will be white. If you want to set this as well, you will need to set the background color for Flash.

Look for the JavaScript that loads the Flash file. It will start with:
var flashTag = new FlashTag(

You want to call setBgcolor on flashTag as follows to set it to blue:


This can be added after the line:
flashTag.addParameter("allowScriptAccess", "always");
Andrew Branch

Return to FAQs - ViewletBuilder 6.x

Who is online

Users browsing this forum: No registered users and 1 guest