by Daniel | Nov 18, 2009 | actionscript
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>
by Daniel | Oct 11, 2009 | actionscript
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
by Daniel | Sep 29, 2009 | actionscript
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;}
by Daniel | Dec 6, 2008 | actionscript
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:
Place this inside your html.
Then if you are using the default HTML publishing you need to set up your SWF to take the variable. In this example I’m looking for a variable called ‘transition’
...
...
The important lines are:
‘FlashVars’, ‘transition=’+gup(“transition”),
and
param name=”FlashVars” value=”transition=”+gup(“transition”)
Here we are calling the javascript function to return the value that matches ‘transition’. Then this gets passed to the SWF.
Inside the flash this can be accessed with:
var sTrans:String = String(stage.loaderInfo.parameters.transition)
Then you can get variables from the URL string:
http://www.sitedaniel.com/index.html?transition=myvalue
Recent Comments