flash video player



import fl.video.*;

var myVideo:FLVPlayback = new FLVPlayback();
myVideo.width = 720;
myVideo.height = 480;
myVideo.source = "video.flv";
myVideo.skin = "SkinOverAll.swf";
myVideo.skinBackgroundColor = 0x000000;
myVideo.skinBackgroundAlpha = 0.3;
myVideo.skinAutoHide = true;

myVideo.addEventListener(VideoEvent.COMPLETE, completePlay);
function completePlay(e:VideoEvent):void {

myVideo.play();

}

addChild(myVideo);

youtube player











var so = new SWFObject('player.swf','ply','480','270','9','#');
so.addParam('allowfullscreen','true');
so.addParam('allowscriptaccess','always');
so.addVariable('playlistfile','http://gdata.youtube.com/feeds/api/playlists/4705506A8FAF8B01?v=2');
so.addVariable('playlistsize', '150');
so.addVariable('playlist','right');
so.addVariable('repeat','always');
so.addVariable('shuffle','true');
so.write('mediaspace');

Percent %



var text1;
calculate_btn.addEventListener(MouseEvent.CLICK, onButtonClicked);
function onButtonClicked(e:MouseEvent):void
{
text1 = (int(amount_txt.text) * int(perc_txt.text) / 100 );
answer_txt.text = text1;

}

clickTAG

import flash.display.LoaderInfo;
import flash.events.MouseEvent;

click_btn.addEventListener(MouseEvent.CLICK, onButtonClicked);
function onButtonClicked(e:MouseEvent) :void {
if (root.loaderInfo.parameters.clickTAG.substr(0, 5) == "http:")
{
navigateToURL(new URLRequest(LoaderInfo(root.loaderInfo).parameters.clickTAG), "_blank");
}
}

loading external swf in movieclip

var your_r:String = "net.swf";
var url_r:URLRequest = new URLRequest(your_r);
var myLoader_r:Loader = new Loader();
movie_rollup.addChild(myLoader_r);
myLoader_r.load(url_r);

timeline and movieclip parent

btn_ie.addEventListener(MouseEvent.MOUSE_DOWN, click_d);

function click_d(event:MouseEvent):void
{

switch (event.currentTarget)
{

case btn_ie :
MovieClip(this.parent.parent).gotoAndStop("p_r");
MovieClip(this.parent).gotoAndStop(2);
gotoAndStop(2);
break;
}
}

fscommand calling exe in mac and win

import flash.system.fscommand;
import flash.events.MouseEvent;
import flash.system.Capabilities;

btn_pdfnow.addEventListener(MouseEvent.CLICK, open_pdfile);

function open_pdfile(event:MouseEvent):void
{
var os:String = flash.system.Capabilities.os.substr(0, 3);
var url:String;
if(os == "Win"){
url = "file.exe";
}else{
url = "file.app";
}

fscommand("exec",url);
}

calling external xml text

var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("game_text.xml"));

myLoader.addEventListener(Event.COMPLETE, processXML);

function processXML(e:Event):void {
myXML = new XML(e.target.data);
//trace(myXML.level[1].item.@name[1]);
step1.text = myXML.level[0].@title;
//
text1.text = myXML.level[0].item.@name[0];
text2.text = myXML.level[0].item.@name[1];
text3.text = myXML.level[0].item.@name[2];
text4.text = myXML.level[0].item.@name[3];

}

-?xml version="1.0" encoding="utf-8"?!
-GALLERY!

-level title="Setep 1"!
-item name = "dog"!dog-/item!
-item name = "boy"!dog-/item!
-item name = "cat"!-/item!
-item name = "fish"!-/item!
-/level!
-/GALLERY!