as3 use js call parent focus
var js:URLRequest=new URLRequest();
//js.url="javascript:window.opener.focus()";
js.url="javascript:if(window.opener){window.opener.focus();}else{window.open('http://yoururl.com','name');newWindow.focus(); void(0);}";
navigateToURL(js,'_self');
as3 ContextMenu
var my_menu:ContextMenu = new ContextMenu();
my_menu.hideBuiltInItems();
var my_notice = new ContextMenuItem("xxx");
var my_email = new ContextMenuItem("xx@yoururl.com");
var my_copyright = new ContextMenuItem("Copyright");
my_menu.customItems.push(my_notice, my_email, my_copyright);
contextMenu = my_menu;
as3 fading in fading out use tween
import com.greensock.TweenLite;
import com.greensock.plugins.*;
import com.greensock.easing.*;
TweenPlugin.activate([VolumePlugin]);
var snd:Sound = new Sound();
var req:URLRequest = new URLRequest(“MySound.mp3″);
snd.load(req);
var trans:SoundTransform;
trans = new SoundTransform(1, 0);
var channel:SoundChannel = snd.play(0, 1, trans);
TweenLite.to(channel, 4, {volume:0});
as3 server can't run flv
flv rename to swf
as3 angle between two point in 2d
import flash.events.Event;
import flash.geom.Point;
stage.addEventListener (Event.ENTER_FRAME,enterframe);
function enterframe(e:Event):void{
arrow_mc.rotation=GetAngleOfLineBetweenTwoPoints(new Point(arrow_mc.x,arrow_mc.y),new Point(mouseX,mouseY));
}
function GetAngleOfLineBetweenTwoPoints(p1:Point, p2:Point):Number{
var xDiff:Number= p2.x - p1.x;
var yDiff:Number= p2.y - p1.y;
return Math.atan2(yDiff, xDiff)/Math.PI*180;
}
