Style Text Input Field

//The code below acts upon a variable named titleInput which is an instance of a text input component, which you can find in the flash ide library.

var mainTextFormat:TextFormat = new TextFormat();
mainTextFormat.font = 'Arial';

titleInput.setStyle("textFormat", mainTextFormat);

Stage Mouse Over/Out

stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseOverStage);

function mouseOverStage(evt:Event):void
{
//Code to run for stage mouse over
stage.removeEventListener(MouseEvent.MOUSE_MOVE, mouseOverStage);
stage.addEventListener(Event.MOUSE_LEAVE, mouseOut);
}

function mouseOut(evt:Event):void
{
//Code to run for stage mouse out
stage.removeEventListener(Event.MOUSE_LEAVE, mouseOut);
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseOverStage);
}

Crossdomain XML

<!-- Snippet 1 -->

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cross-domain-policy SYSTEM 'http://www.adobe.com/xml/dtds/cross-domain-policy.dtd'>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*"/>
</cross-domain-policy>

<!-- Snippet 2 -->
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE cross-domain-policy SYSTEM 'http://www.adobe.com/xml/dtds/cross-domain-policy.dtd'>
<cross-domain-policy>
<allow-access-from domain="*.mydomain.com" />
</cross-domain-policy>

Google click tag

//The Actionscript2 Part

on (release) {

getURL(clickTAG, "_blank");
}

//The Actionscript3 Version (This does not work for google, use the Actionscript2 version above)

var paramList:Object = this.root.loaderInfo.parameters;

buttonOverlay.addEventListener(MouseEvent.CLICK, openURL);

function openURL(evtObj:MouseEvent):void {
var request:URLRequest = new URLRequest(paramList["clickTAG"]);
navigateToURL(request, "_blank");
}

//The HTML part

<object type="application/x-shockwave-flash" data="http://url_of_the_banner.com/swf/banner1.swf?clickTAG=http://the_landing_page.com" width="728" height="90">
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="swfversion" value="6.0.65.0" />
<param name="expressinstall" value="scripts/expressInstall.swf" />
<param name="movie" value="http://url_of_the_banner.com/swf/banner1.swf?clickTAG=http://the_landing_page.com" />
</object>

Easy Sound Player

package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.events.IOErrorEvent;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.media.SoundChannel;
import flash.media.SoundTransform;

public class MainSoundplayer extends Sprite
{
private var snd:Sound = new Sound();
private var channel:SoundChannel;
private var trackTransform:SoundTransform = new SoundTransform(1.0);
private var muteBtn:Mute = new Mute();
private var unmuteBtn:Unmute = new Unmute();

public function MainSoundplayer() {
addEventListener(MouseEvent.CLICK,processStageClicks);
setupButtons();
loadSound();
}

function processStageClicks(evt:MouseEvent):void
{
switch(evt.target.name)
{
case "unmute":
unmuteSound();
break;
case "mute":
muteSound();
break;
default:
return;
}
}

function setupButtons():void
{
unmuteBtn.visible = false;
unmuteBtn.name = "unmute";
muteBtn.name = "mute";
addChild(unmuteBtn);
addChild(muteBtn);
}

function loadSound():void
{
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("http://mcshare.myblog.it/media/02/00/5297c6b1fb603a0768135788b1f99407.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);

snd.load(req, context);
channel = snd.play();
channel.soundTransform = trackTransform;
snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}

function unmuteSound():void
{
trackTransform.volume = 1;
channel.soundTransform = trackTransform;
unmuteBtn.visible = false;
muteBtn.visible = true;
}

function muteSound():void
{
trackTransform.volume=0;
channel.soundTransform = trackTransform;
unmuteBtn.visible = true;
muteBtn.visible = false;
}

private function errorHandler(errorEvent:IOErrorEvent):void {
trace("The sound could not be loaded: " + errorEvent.text);
}
}
}

Buffer Mp3 sound

package {
import flash.display.Sprite;
import flash.net.URLRequest;
import flash.media.Sound;
import flash.media.SoundLoaderContext;
import flash.events.IOErrorEvent;

public class MainSoundplayer extends Sprite {

public function MainSoundplayer() {
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest("http://mcshare.myblog.it/media/02/00/5297c6b1fb603a0768135788b1f99407.mp3");
var context:SoundLoaderContext = new SoundLoaderContext(3000, false);

snd.load(req, context);
snd.play();

snd.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
}

private function errorHandler(errorEvent:IOErrorEvent):void {
trace("The sound could not be loaded: " + errorEvent.text);
}

}
}

Swf Resize

import flash.display.StageScaleMode;
import flash.display.StageAlign;
import flash.events.Event;

stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizeHandler);

var ratio = movieclip.width / movieclip.height;
var defaultWidth:Number = 550;
var defaultHeight:Number = defaultWidth / ratio;

movieclip.height = defaultWidth;
movieclip.width = defaultHeight;

// initialize sizing
resizeHandler(null);

function resizeHandler(event:Event):void {
var sw:Number = stage.stageWidth;
var sh:Number = stage.stageHeight;

//Set Minimum Width
if (sw < 550) { sw = 550; } else movieclip.width = sw; movieclip.height = sw / ratio;// change (sw / ratio) to sw if you want the mc to fit horizontal }