<script type="text/javascript">
var flashvars = {
flashVarName1: "",
flashVarName2: "",
flashVarName3: ""
};
var params = {
wmode: "transparent",
allowFullScreen: "true"
};
var attributes = {
};
swfobject.embedSWF("nameOfSwf.swf", "divID", "300","240", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
Tag Archive for embed
snippets |
April 15, 2013
SWF Object Embed Code
snippets |
January 27, 2013
Embed Font From Library
var embeddedFontsArray: Array = Font.enumerateFonts(false);
for (var i:uint = 0; i < embeddedFontsArray.length; i++)
{
trace("fontName: " + embeddedFontsArray[i].fontName);
}
var t:TextField = new TextField();
addChild(t);
var tf:TextFormat = new TextFormat();
tf.font = "Verdana";
tf.size = 14;
t.embedFonts = true;
t.defaultTextFormat = tf;
t.antiAliasType = AntiAliasType.ADVANCED;
t.text = "Verdana";
t.autoSize = TextFieldAutoSize.LEFT;
stop();
snippets |
January 14, 2013
Embedding and using a pixel-bender filter
package {
import flash.display.Bitmap;
import flash.display.Shader;
import flash.display.Sprite;
import flash.filters.*;
import flash.utils.ByteArray;
public class PixelBenderTest extends Sprite
{
[Embed(source='image.jpg')]
private var ImageFile:Class;
[Embed(source="filter.pbj" , mimeType="application/octet-stream")]
private var FilterFile : Class;
private var shader:Shader;
private var filter:ShaderFilter;
private var bmp:Bitmap;
public function PBTest()
{
bmp = new ImageFile() as Bitmap;
shader = new Shader( new FilterFile() as ByteArray ) ;
shader.data.size.value = [20];
shader.data.base.value = [400,250];
filter = new ShaderFilter(shader);
bmp.filters = [ filter ];
addChild(bmp);
}
}
}
snippets |
January 3, 2013
Embed and register SWF file embedded fonts
[Embed(source="emededfont.swf", fontName="Font Name", fontWeight="bold|normal") ] public static var FontClass:Class; Font.registerFont(FontClass);
snippets |
December 15, 2012
Embedding fonts in AS3 on Flex 3
[Embed(source='assets/CALIBRII.TTF', fontName='fontCalibri', fontStyle='italic', fontWeight='light', mimeType='application/x-font')] textFormat = new TextFormat(); textFormat.color = 0xFFFFFF; textFormat.font = "fontCalibri"; textFormat.size = 11; textField = new TextField(); textField.embedFonts = true; textField.text = "Embeded Text"; textField.selectable = false; textField.background = true; textField.multiline = false; textField.backgroundColor = 0x000000; textField.setTextFormat(this.textFormat);
snippets |
October 12, 2012
Text Embedding in AS3
package {
//--------------------------------------
// IMPORT
//--------------------------------------
import flash.display.*;
import flash.text.*;
public class embedTest extends Sprite {
[Embed(
source='/fonts/DINOT-Regular.otf',
fontName="DINOT-Regular",
mimeType="application/x-font-truetype"
)]
private var pFont:Class;
/**
* @Constructor
*/
public function untitled():void{
// DEFINITIONS
//--------------------------------------
Font.registerFont(pFont);
}
private function createLink() : void {
tf = new TextField();
tf.text = 'foo';
formatText(tf, T_COLOR, 12, true);
tf.embedFonts = true;
this.addChild(tf);
}
private function formatText(_tf:TextField, _color:Number, _size:Number, _bold:Boolean = false) : void {
var tFormat:TextFormat = new TextFormat();
tFormat.font = 'DINOT-Regular';
tFormat.color = _color;
tFormat.size = _size;
tFormat.bold = _bold;
_tf.setTextFormat(tFormat);
}
} // END embedTest Class
} // END package
snippets |
July 28, 2012
Standard Flash Player Embed – FLV
<object id="videoPlayerObject" name="videoPlayerObject" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="1021" height="770"> <param name="movie" value="vid/video_player.swf"> <param name="flashvars" value="flv=filename.flv&width=1021&height=770"> <param name="allowScriptAccess" value="always"> <param name="allowFullScreen" value="true"> <param name="salign" value="lt"> <embed id="videoPlayerEmbed" name="videoPlayerEmbed" src="vid/video_player.swf" flashvars="flv=filename.flv&width=1021&height=770" allowFullScreen="true" width="1021" height="770" allowScriptAccess="always" salign="lt" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed> </object>
snippets |
July 20, 2012
single embedding flash code
<embed src="player.swf" width="300" height="300" allowscriptaccess="always" allowfullscreen="true" />
snippets |
June 23, 2012
Another embed swf with both object and embed
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="386" height="547" hspace="0" vspace="0" align="middle"> <param name="movie" value="nomefile.swf" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="&a=2&b=1" /> <param name="quality" value="high" /><param name="SCALE" value="exactfit" /> <embed src="nomefile.swf" width="386" flashvars="&a=2&b=1" wmode="transparent" height="547" hspace="0" vspace="0" align="middle" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" scale="exactfit"></embed> </object>
snippets |
June 8, 2012
Simple Flash Embed
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Simple Flash Embed</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body> <object type="application/x-shockwave-flash" data="video_player.swf" width="640" height="480"> <param name="movie" value="video_player.swf" /> <param name="allowScriptAccess" value="always"/> <param name="allowFullScreen" value="true"/> <p>Alternative content -- Can contain any HTML: DIVs, IMGs, etc.</p> </object> </body> </html>