.影片剪辑
MovieClip: alpha scaleX scaleY parent visible
.加载资源
var MCLoader:Loader=new Loader();
var adurl:URLRequest=new URLRequest("图片路径.jpg");
MCLoader.load(adurl);
MCLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,comleteHandle);
MCLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadingProgress);
function loadingProgress(e:ProgressEvent):void
{
trace(int((e.bytesLoaded/e.bytesTotal)*100)+"%");
}
function comleteHandle(e:Event)
{
addChild(e.target.content.loader);
}
.加载外部文本
var TxtLoader=new URLLoader();
var adurl:URLRequest=new URLRequest("文本文件路径.xml");
TxtLoader.load(adurl);
TxtLoader.addEventListener(Event.COMPLETE,comleteHandle);
.监听鼠标事件
btn.addEventListener(MouseEvent.ROLL_OUT,btout);
btn.addEventListener(MouseEvent.ROLL_OVER,btover);
function btover(event:Event)
{
}
.抛出事件
dispatchEvent(new Event("事件名称",true));//true设置冒泡
.弹出浏览器窗口
var request1:URLRequest = new URLRequest("http://www.baidu.com/");
navigateToURL(request1);
.动画引擎
import com.greensock.*;
import com.greensock.easing.*;
TweenLite.to(mc, 0.5, {x:294, y:356, ease:Cubic.easeInOut,onComplete:wancheng});
function wancheng()
{
}
MovieClip: alpha scaleX scaleY parent visible
.加载资源
var MCLoader:Loader=new Loader();
var adurl:URLRequest=new URLRequest("图片路径.jpg");
MCLoader.load(adurl);
MCLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,comleteHandle);
MCLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,loadingProgress);
function loadingProgress(e:ProgressEvent):void
{
trace(int((e.bytesLoaded/e.bytesTotal)*100)+"%");
}
function comleteHandle(e:Event)
{
addChild(e.target.content.loader);
}
.加载外部文本
var TxtLoader=new URLLoader();
var adurl:URLRequest=new URLRequest("文本文件路径.xml");
TxtLoader.load(adurl);
TxtLoader.addEventListener(Event.COMPLETE,comleteHandle);
.监听鼠标事件
btn.addEventListener(MouseEvent.ROLL_OUT,btout);
btn.addEventListener(MouseEvent.ROLL_OVER,btover);
function btover(event:Event)
{
}
.抛出事件
dispatchEvent(new Event("事件名称",true));//true设置冒泡
.弹出浏览器窗口
var request1:URLRequest = new URLRequest("http://www.baidu.com/");
navigateToURL(request1);
.动画引擎
import com.greensock.*;
import com.greensock.easing.*;
TweenLite.to(mc, 0.5, {x:294, y:356, ease:Cubic.easeInOut,onComplete:wancheng});
function wancheng()
{
}