|
查看: 1633|回复: 8
|
Flash AS2.0 问题 (masking)
[复制链接]
|
|
|
想请教各位大大,我在flash里面用createEmtpyMovieClip() create 出来的movieclip 不能用 onRelease function 吗?
e.g. this.createEmtpyMovieClip("testing", getNextHighestDepth);
this.testing.loadMovie("abc.jpg");
this.testing.onRelease = function() {
this.testing.unloadMovie();
}
如果我用for loop来duplicate movieclips, 如何在duplicate出来的movieclip 放不同的 loadMovie() parameters 呢?
e.g. for (i=0; i<=5, i++) {
mc = this.testing.duplicateMovieClip("testing"+i, i);
mc.OnRelease = function(){
preview_mc.loadMovie("abc.jpg");
}
以上是duplicate 6个movieclips, 可是6个都是打开abc.jpg的,
我要6个都打开不同的jpg file.
有任何高见吗 ?
谢谢!
[ 本帖最后由 JohnChronox 于 7-7-2008 04:28 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 16-6-2008 10:31 AM
|
显示全部楼层
var mc:MovieClip = this.createEmptyMovieClip("testing", this.getNextHighestDepth());
mc.loadMovie("abc.swf");
mc.onRelease = function()
{
this.removeMovieClip();
}
var pic:Array = new Array("a.jpg", "b.jpg", "c.jpg");
for(var i:Number=0; i<pic.length; i++)
{
var mc:MovieClip = this.createEmptyMovieClip("testing"+i, i);
mc.loadMovie(pic);
mc.onRelease = function()
{
this.removeMovieClip();
}
} |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 16-6-2008 05:38 PM
|
显示全部楼层
谢谢super-tomato的回复,
首先,
var mc:MovieClip = this.createEmptyMovieClip("testing", this.getNextHighestDepth());
mc.loadMovie("abc.swf");
mc.onRelease = function()
{
this.removeMovieClip();
}
create出来的movieclip, loadMovie() 过后,click不到。所以
mc.onRelease = function()
{
this.removeMovieClip();
}
起不了作用。
还有我想问的是,用duplicateMovieClip() 复制6个movieclips, 然后 onRelease(), load 6个不同的 pic URL.
对不起,之前问题说明不够清楚。 |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 21-6-2008 04:12 PM
|
显示全部楼层
再次请求
希望有人能帮助我。。。
就快要进入大学了,希望能在入大学之前做完。
谢谢!
我的 photos.fla
我的 photos.xml
[ 本帖最后由 JohnChronox 于 21-6-2008 04:38 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|
发表于 21-6-2008 06:24 PM
|
显示全部楼层
你可以改成用MovieClipLoader載入看看
MovieClip.prototype.loadPic = function(url:String)
{
this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {
mc.onRelease = function()
{
trace("click");
}
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(url, this.image_mc);
}
function loadPhoto()
{
for (p=0; p<photoNumArray.length; p++)
{
var thumblist_mc:MovieClip = _root.photolist_mc.createEmptyMovieClip("thumb"+p, p);
thumblist_mc._y = 100 * p;
thumblist_mc.loadPic(thumbpath + photoNumArray[p][1]);
}
} |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 22-6-2008 10:33 PM
|
显示全部楼层
谢谢super-tomato
还有一个问题,如果我要把
mc.onRelease = function()
{
trace("click");
}
改成
mc.onRelease = function()
{
preview_mc.loadMovie(fullpath+photoNumArray[p][2]);
}
问题是,p 已经不是一个variable了。而那个array 自然变成undefined
该如何解决?
EDIT:问题已经解决, 非常谢谢你,super-tomato.
MovieClip.prototype.loadPic = function(url:String, fullurl:String) {
this.createEmptyMovieClip("image_mc",this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(mc:MovieClip) {
mc.onRelease = function() {
image_mcl.loadClip(fullurl, preview_mc);
};
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip(url,this.image_mc);
};
function loadPhoto() {
for (p=0; p<=5; p++) {
thumblist_mc = _root.photolist_mc.createEmptyMovieClip("thumb"+p, p);
thumblist_mc._y = 100*p;
thumblist_mc.loadPic(thumbpath+photoNumArray[p][1], fullpath+photoNumArray[p][2]);
}
}
[ 本帖最后由 JohnChronox 于 22-6-2008 10:43 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 27-6-2008 07:16 PM
|
显示全部楼层
又有问题了。
我在photos.swf 里用AS 作了mask effect.
this._lockroot = true;
_root.mask_mc.cacheAsBitmap = true;
_root.photolist_mc.setMask("_root.mask_mc");
然后我在main.swf load photos.swf 进去, 可是mask effect 不见了。
请帮帮忙。 谢谢! |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 7-7-2008 04:28 PM
|
显示全部楼层
没人能帮得到我吗??
很奇怪。。。当我把external swf file 载入进去时, mask effect 就不见了。
[ 本帖最后由 JohnChronox 于 9-7-2008 06:47 PM 编辑 ] |
|
|
|
|
|
|
|
|
|
|

楼主 |
发表于 13-7-2008 06:09 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|