View Full Version : Is it possible to duplicate a movie that contains a loaded bitmap (jpeg)...how?
Mig256
05-27-2003, 06:33 PM
I use several jpegs in my app. Some of them need to be shown twice at the same time. Duplicatemovieclip doesn't seem to work when trying with a mc that has loaded a jpeg. Is there a way to do so?
Thanks!
CyanBlue
05-28-2003, 07:42 AM
Um... I don't think that is possible to duplicate... Sorry...
farafiro
05-28-2003, 08:18 AM
hmmmmm, strange
I should try it myself??
farafiro
05-28-2003, 01:35 PM
I did a way around, just duplicate the empty mc, and then load what u want
CyanBlue
05-28-2003, 01:45 PM
Yup... That's how it's gotta be done... Don't know why and don't want to know why we cannot duplicate it by itself...
farafiro
05-28-2003, 02:08 PM
WHY:
flashguru found it..... because the Movieclip.onLoad event handler is deleted when the loadMovieNum function is called. Because of these drawbacks, you will have to use the Movieclip.onEnterFrame event handler of a Movieclip other than the Movieclip which is having either an external movie or an external image loaded into it, but even the onEnterrame won't do that for duplicating :(
HOW:
I'm working on it ;)
farafiro
05-29-2003, 09:07 AM
I tried even with adding a new property with addProperty()paste = function (num) {
for (i=1; i<=num; i++) {
this.dub = this.duplicateMovieClip(this._name+i, i, {_x:Math.random()*Stage.width});
}
};
copy = function () {
return this.dub;
};
MovieClip.prototype.addProperty("dubIt", this.copy, this.paste);
_root.createEmptyMovieClip("h_mc", 10);
h_mc.createEmptyMovieClip("holder_mc", 10);
h_mc.holder_mc.loadMovie("pic1.jpg");
h_mc.holder_mc.dubIt = 2;
Mig256
05-29-2003, 04:23 PM
The best solution I found (by the way not so elegant...) is to load the jpeg again (into another mc) when the first mc has finished loading. As the cache keeps the image it does spend time downloading.
Thanks for your support guys!
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.