📄 iconcell.as
字号:
import mx.core.UIComponent
class IconCell extends UIComponent
{
var icon_mc: MovieClip;
var firstSizeCompleted:Boolean;
//var listOwner : MovieClip; // the reference we receive to the list
//var getCellIndex : Function; // the function we receive from the list
//var getDataLabel : Function; // the function we receive from the list
function IconCell()
{
}
function createChildren(Void) : Void
{
/* if (!firstSizeCompleted){
icon_mc._y=(0-icon_mc._height)/2;
}else{
icon_mc._y=0;
}*/
firstSizeCompleted=false;
//icon_mc = createObject("CheckBox", "icon_mc", 1, {styleName:this, owner:this});
//check.addEventListener("click", this);
//size();
}
// note that setSize is implemented by UIComponent and calls size(), after setting
// __width and __height
function size(Void) : Void
{
if (icon_mc != undefined){
icon_mc._x=(_width-icon_mc._width)/2;
if (!firstSizeCompleted){
icon_mc._y=0;
}
firstSizeCompleted=true;
}
}
function setValue(str:String, item:Object, sel:String) : Void
{
icon_mc.removeMovieClip();
if ((item.Filetype !="") && (item.Filetype != undefined)){
//icon_mc= createObject(item.Filetype,"icon_mc",100,{styleName:this,owner:this});
icon_mc=this.createEmptyMovieClip("iconmc",this.getNextHighestDepth());
//=eval("iconmc");
//trace(item.Filetype);
icon_mc._x=(_width-icon_mc._width)/2;
if (!firstSizeCompleted){
icon_mc._y =(0-icon_mc._height)/2;
}else{
icon_mc._y=0;
}
var CL = new MovieClipLoader();
CL.loadClip("./Pic_system/"+item.IcoPath,icon_mc);
//trace(item.IcoPath);
}
}
function getPreferredHeight(Void) : Number
{
return 25;
}
function getPreferredWidth(Void) : Number
{
return 20;
}
//function click()
//{
//listOwner.dataProvider.editField(getCellIndex().itemIndex, getDataLabel(), check.selected);
//listOwner.selectedIndex=getCellIndex().itemIndex;
//listOwner._parent.Change_DG();
//}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -