Flash AS2 为CE3 导入常用命令


function showmainUI(_show:String) //显示UI
{
if(_show==1)
{
_root.main._visible=true;

}
if(_show==0)
{
_root.main._visible=false;
fscommand("showUI",_show);
}
}

 

 

function hideUI() //隐藏UI层级低于show 拖到屏幕外
{
if( _root.main._x<960)
{
Tweener.addTween( _root.main,{_x:-transformx-(Parallel*Width), time:1, transition:"liner"});
fscommand("hideUI","1");
}
if( _root.main._x>960)
{
Tweener.addTween( _root.main,{_x:transformx+1000, time:1, transition:"liner"});
fscommand("hideUI","1");
}
}

function unhideUI()
{
Tweener.addTween( _root.main,{_x:transformx,time:1, transition:"liner"});
fscommand("hideUI","0")
}

function getalltextname() //使用计时器
{
n=0;
countersj=setInterval(foundalltextname,30)
}
function foundalltextname(repParallel,repVertical) //清除计时器
{
n++;



if( n<=Parallel*Vertical)
{
foundbuttontext("button"+n)
}
if( n>Parallel*Vertical)
{
clearInterval(countersj);
}

}

function foundbuttontext(buttonname:String) //调用外部txt文件
{
varboxh=new LoadVars();
varboxh.load("button.txt");

if(varboxh.onLoad!=0)
{
varboxh.onLoad = function(varT)
{
if(varT==true)
{
Fboxh=varboxh[buttonname];
setbuttontextname(buttonname, Fboxh);
fscommand("name",Fboxh)

}
}
}
}

_root.main[buttonname].Text.text=textname;
_root.main[buttonname].Text.textColor=0x1965c1;


var myImage:MovieClipLoader = new MovieClipLoader(); //调用图片 视频
myImage.addListener(this);
function onLoadInit(_mc:MovieClip)
{

_root.mc1.image._x=_root.mc1.video._x
_root.mc1.image._y=_root.mc1.video._y
_root.mc1.image._width=_root.mc1.video._width
_root.mc1.image._height=_root.mc1.video._height
//trace(_root.mc1.image._width);
}
function onLoadProgress(_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number)
{
}
function onLoadStart(_mc)
{
}
var NetC = new NetConnection();
NetC.connect(null);
var ns:NetStream = new NetStream(NetC);

function setvideoorpicshow(number:Number)
{
ns.close();
removeMovieClip(_root.mc1)
_root.attachMovie("VideoPlayer","mc1",number);
_root.mc1._x=-300;
_root.mc1._y=100;
Tweener.addTween( _root.mc1,{_x:0, time:0.3, transition:"liner"});
varboxh1=new LoadVars();
varboxh1.load("videocatalogue.txt");
if(varboxh1.onLoad!=0)
{
varboxh1.onLoad = function(varT)
{
if(varT==true)
{
path=varboxh1[number];
//trace(path);
suffix=substring(path,path.length-2,3)
//trace(suffix);
if(suffix=="usm")
{
_root.mc1.video.attachVideo(ns);
ns.play(path);
}
if(suffix=="jpg")
{
_root.myImage.loadClip(path,_root.mc1.createEmptyMovieClip ("image",10))
//trace(path)
}
else
{


}
}
}
}
}

recx=x_axis.split(","); //string To array 字符转数组
l_x=recx.length;

_root.Panel.tu1.di.lineStyle(1, 0x000000, 100) //画线
_root.Panel.tu1.di.moveTo(0,0);
_root.Panel.tu1.di.lineTo(1000,100)

 


function settextshow(number:String) //插入元件
{
removeMovieClip(_root.mc2);
_root.attachMovie("TextShow","mc2",Parallel*Vertical+Number(number));
_root.mc2._x=_root.mc1._x;
_root.mc2._y=_root.mc1._y+_root.mc1._height;
Tweener.addTween( _root.mc2,{_x:0, time:0.3, transition:"liner"});
varboxh2=new LoadVars();
varboxh2.load("textcatalogue.txt");

posted @ 2019-10-18 16:40  wimps  阅读(139)  评论(0编辑  收藏  举报