Posts Tagged ‘html’

Centering a Flash movie using HTML tables

The easiest way I have found to center a SWF both vertically and horizontally in HTML is using tables.  <table width="100%" height="100%" border="0"> <tr> <td valign="middle" align="center">  …   </td> </tr></table> 

Using an ‘onclick’ event to dynamically load a SWF

Here is an excellent post about how to use an ‘onclick’ event to dynamically load a SWF. The great thing about this example is that the javascript will dynamically add or remove the required DIV tag needed to embed the SWF. link

Remove padding around 100% width/height Flash content

Some browsers put in padding around flash content that is scaled to fit 100% height and width. This is a quick CSS / HTML fix to make your full-screen flash movie fit the full height and width of the browser. Just put this in the top of your HTML inside your CSS declaration * {margin:0px;padding:0px;}

FlashVars AS3 – getting values from the URL string

Getting values from the URL string in AS3 isn’t very complicated. First you need to set up your html to pass these into the SWF using a javascript function:  <script language="javascript">function gup(name){ name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == […]