困扰我一天的图片控制问题!!!!!!

feeling_vb 2007-01-29 05:34:23
imageClip._xscale = 100;
imageClip._yscale = 100;
//imageClip._width = 60;
//imageClip._height =60;
imageClip._x = 1;
imageClip._y = 1;
imageClip.loadMovie(imageStr);

这是我载入图片的一小段程序,我只要定义 imageStr一个路径,就可以将图片显示出来,但是大小不同的图片在里面显示的也不一样,我想让他不论图片大小,我都想让他显示出来是统一尺寸,比如:175*175 ,我查了半天没有查到怎么控制!如果有知道的请帮下忙,谢谢啦!!!同时也会快速结账!!!!

...全文
349 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
feeling_vb 2007-10-11
结贴喽!!!!!
回复
Luke121302 2007-02-01
loadfile="****";//要加载的文件
loadmc=_root.mymc;
setsize=300;

//---------代码开始------------
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
loaded=loadedBytes;
loadtotal=totalBytes;
loadds = int(loaded /loadtotal * 100);
loadtxt =int(loaded/1024) + " K / " + int(loadtotal/1024)+ " K " + loadds +"%";
_root.loadbar.gotoAndStop(loadds);
//if(loadds==100){_root.p._visible=false}
}//end onLoadProgress
myListener.onLoadInit = function (target_mc)
{

loadmcoldw = target_mc._width;
loadmcoldh = target_mc._height;
fileoldsize = "文件宽度:" + loadmcoldw + " 高度: " + loadmcoldh;
loadv=loadmcoldh/loadmcoldw;
speed=0.1;
loadneww=setsize;
loadnewh=setsize*loadv;
filesizetxt=fileoldsize+" 显示大小 "+ "宽:"+loadneww + " 高:"+loadnewh;
if (loadds==100){
target_mc.removeListener(myListener);
_root.mymc.onEnterFrame = function() {
_root.mymc._width+=(loadneww-_root.mymc._width)*speed;
_root.mymc._height+=(loadnewh-_root.mymc._height)*speed;
};
}
}
myListener.onLoadError = function (target_mc, errorCode) {
if (errorCode=="URLNotFound" || errorCode=="LoadNeverCompleted"){
loadtxt="文件不存在!";
}//end if
} //end onLoadError
my_mcl.addListener(myListener);
my_mcl.loadClip(loadfile,loadmc);
stop();
//MovieClipLoader.removeListener()


//MovieClipLoader.unloadClip()

自己改一下再
回复
wwj_ndsc 2007-01-31
你应该用moviecliploader
回复
bibishou 2007-01-30
imageClip.loadMovie(imageStr);
wantWidth = 175;
wantHeight = 175;

imageClip._xscale = imageClip._width * 100 / wantWidth;
imageClip._yscale = imageClip._height * 100 / wantHeight;
imageClip._x = 1;
imageClip._y = 1;

回复
feeling_vb 2007-01-30
var mclListener:Object = new Object();

imageClip.loadMovie(imageStr);
imageClip.addListener(mclListener);
mclListener.onLoadComplete = function(imageClip:MovieClip) {
imageClip._xscale = imageClip._width*100/120;
trace ( imageClip._width);
iamgeClip._yscale = imageClip._height*100/120;
};

我加入了事件,它怎么不处理事件???如何知道他载入完成了??????讨教!!!!!!!!!!
回复
bluekylin 2007-01-30
feeling_vb(feeling_vb)
imageClip._width 和 imageClip._height 的值为 0为什么???
_____________________________________________________________
因为图片尚未载入
回复
feeling_vb 2007-01-30
imageClip._width 和 imageClip._height 的值为 0为什么???
回复
发帖
Flash流媒体开发
创建于2007-09-28

2252

社区成员

多媒体/设计/Flash/Silverlight 开发 Flash流媒体开发
申请成为版主
帖子事件
创建了帖子
2007-01-29 05:34
社区公告
暂无公告