ActionScript 3.0 :: Way To 'duplicate' / 'clone' A Complex Movieclip?
Jan 13, 2010
In our app, we create complex nested movieclip with code. Essentially, we use lots of loadbytes and addchild to create these complex movieclips. Sometimes, we need to duplicate one of these complex movieclip hundreds of times to create hundreds of instances of it.Currently, we perform the "duplication" by re-creating the complex movieclips from scratch with loadbytes and such. However, this is proving to be very slow.What would be a quicker way to "duplicate" or "clone" a complex movieclip?Is there a way to serialize a complex mc into a bytearray and the resurrect it as a new object with a single loadbytes?
View 2 Replies
Similar Posts:
Feb 4, 2010
I've some strange behavior using ObjectUtil.copy() and ByteArray.writeObject/readObject(). I clone an ArrayCollection and sometime the result is two identical instance of the class. Example :
[Code]...
View 1 Replies
Jan 29, 2007
with a "small" problem:I can't seem to duplicate or clone a mc created at runtime, with a child mc inside, which is attached at runtime... Here is my file:
View 6 Replies
Mar 24, 2008
I want to load some .swf files using the Loader class. I'm all set with that and got the image on screen but I wish to have multiple instances of it. Do I have to reload one for each that I intent on using?
For example say I'm attempting to load a power up's graphic from an .swf (i'll call it ex.swf). I load it and then put the image I loaded into the power up. But then I also want to have another power up of the same type somewhere else, and I want to use that same graphic. Neither adding the loaded ex.swf's contents or simply assigning the contents to a child of the power up will work obviously. So do I have to load a new copy every single time i want a new one, or can I just clone/duplicate the contents?
I mean I know it must be common for games to have 100's of copies of the same graphic being used by different things, yet If I try to preload the amount I'd need it's not exactly flexibly and if I load them as I need them it seems bad practice..
View 8 Replies
Jan 22, 2009
have a imageHolder_mc wich is calling the image from the local drive / server, and this container is inside of PictureHold_mc and that inside of Image01_btn.image01_btn.pictureHold_mc.imageHold01_mcand all this for 1 image tobe displayed in the website. But I am going to have something like 300. This is for example HomePage to ProductPage to SpecificIndividualProduct.I have created an instance but DO I NEED TO DUPLICATE ALL _btn and _mc all the way down? Or is there any better ways.And next question. I have done Home Page with 18 images called from the local drive but despite of Preloader showing 100% loaded page look empty for about 30 sec. and suddenly all images starts popping out ramdomly.
View 5 Replies
Mar 20, 2010
My problem is that when I click the letter movieclip it does create the duplicate as it should and it starts to drag the duplicate mc. However, when I release the clip it doesn't stop dragging? I realized that if I put onMouseUP event instead of onRelease it actually does stop dragging when I release the mouse. I would, however not like to use the onMouseUP event if possible.
[Code]...
View 2 Replies
Sep 14, 2011
I have a toolbar with some cars on the left of the window, and I want to click on one element and drag it to the board creating a clone of it, but I can't do it.[code]...
View 1 Replies
Aug 24, 2009
I have a movieclip that inside have secuence of image, I will like 1000 instances of this movieclip, but I not like reload the 100 of images inside the movieclipIt is posible.That the movieclip have a child share with more objects
View 1 Replies
Jan 10, 2012
How do I make a clone of a Sprite or MovieClip at runtime? So that if I make changes to the copy, the original remains unchanged.
And you can turn any Sprite or MovieClick in a class? So that I can create instances of this class (using new) and thus create copies of the display objects.
View 6 Replies
May 11, 2006
Is it possible to use duplicateMovieClip to copy a movieClip into another movieclip, or is it only possible to duplicate it inside one and the same containermovieclip?
View 1 Replies
Jul 28, 2007
i have movieClip on stage with name ==>> myStar. i do not know how to duplicate that movieClip ? i am trying
Code:
var myStarContainor:Sprite = new Sprite();
myStarContainor.addChild(myStar1);
myStarContainor.addChild(myStar2);[code].....
View 12 Replies
Jul 15, 2010
Flash actionscript3.0 How to dublicate the movieclip and attach the movieclip in stage.
View 2 Replies
Dec 19, 2011
In stage there is one mc i need duplicate for that mc how .
View 1 Replies
Dec 23, 2007
Is there a way to duplicate a MovieClip in AS3???I've tried all methods I found (in google) but weirdly none works.I am very pissed as people keep saying it works but it don't!!![code]
View 10 Replies
Mar 25, 2009
I was looking at a video tutorial, and in order to reference a MovieClip, the instructor used:
var mc:MovieClip = MovieClip(e.currentTarget);
What is the difference between using that, and just using:
var mc:MovieClip = e.currentTarget;
Also, is there any way to easily duplicate a MovieClip? (or any class for that matter) There was a function somewhere back there, but that created a dynamic class. I want an exact replica of the class and all it's properties without manually changing over each and every value.
View 2 Replies
Jul 7, 2009
In my movieclips, I already have functions such as the following:
onClipEvent (enterFrame) {
currentlocx = this._x;
currentlocy = this._y;
differencex = newX - currentlocx;
differencey = newY- currentlocy;
[Code] .....
How would I add other functions such as duplicateMovieClip(my_mc, "new_mc", 5); to the code. Where would I add them? I've tried adding them under (enterFrame) but my movieclip does not duplicate after every "x" seconds. In addition to this, I would like my movieclip to "disappear" whenever it is clicked.
View 7 Replies
Jun 8, 2011
I'm working on a creating a button that will create (preferably unlimited) duplicates of one movie clip. I have something that works for Flash, pre-2004, but I'd like to update it to Actionscript 2.
Button:
on (press) {
i = i + 1;
[code]......
View 2 Replies
Jun 7, 2011
Ok, I know layers dont exist once compiled and that duplicated movieclips cannot be duplicated to new levels but I need some kind of work around here.
I cannot use the library as the movieclip I am duplicating is dynamically generated by actionscript (a graph based on user input over time) and thus cannot be made by me beforehand as it varies.
I need to somehow make a duplicate of this on a layer above the where the original was made, anyone know how this is possible?
View 1 Replies
Jun 9, 2011
i have this script and i want to know how to duplicate the movieclips, one each other. This scrip works fine with images with same width, but when the sizes its diferent, dont work.
var dados:XML = new XML();
dados.ignoreWhite = true;
dados.load("xml/15anos.xml");
[Code].....
View 1 Replies
Aug 2, 2011
[code]...
how to use that code in flash as3 coding and please give me some example or link, how to create duplicate movieclip in as3 ? how to play/pouse one particular sound in flash as3 ?
View 1 Replies
Nov 7, 2009
I ve taken a look at some of the tutorials on here for this subject and I have made ot work using an on release function but i cant get it to work automaticly.What im trying to do is make this
Code:
//BUTTON START
//attach clip
[code].....
View 1 Replies
Jan 1, 2010
How can i duplicate an unlinkaged movieclip that is dragged from library to stage in as3 ?
i want to write an class that gets instancename of an unlinkaged movieclip(a movieclip that it is't exported to as3) and duplicate that to certain Counts?
View 0 Replies
Mar 16, 2010
In my scene I've got a movieclip. If I press left the same movieclip should be duplicated a distance left of the first movieclip. If I press right, one should appear to the right of the first movieclip. If I press left again another duplication of the movieclip should show up on the left of the copied one on the left...
View 4 Replies
Aug 24, 2010
Ive seen this for loop to duplicate a movieclip.Its somethin.g i like to understand its square brackets. when are square brackets used instead of the circular brackets.
for(i=1; i<5;i++){
_root["face"].duplicateMovieClip("face"+i,i++,face)
}
and i woud also like to know. i understand the first part. i = zero if i less than 5 add one.until 5 is made. which is reffering to the maintimeline.
1. is this refering main movie clip to be duplicated? ["face"]
2.In the final round brackets ("face"+i,i++,face) not sure n some of the meaning.
View 5 Replies
Feb 12, 2012
i am creating a frogger game, my problem is how to create a duplicate movieclip which is the car and how to generate it randomly that wont hit or overlap another car...here is my code and .fla
import flash.events.Event;
import flash.display.MovieClip;
stage.scaleMode = StageScaleMode.SHOW_ALL;
[code].....
View 0 Replies
Feb 4, 2004
I have a movie clip, that has various codes attached to it to snap to areas of the screen. If I apply the duplicate movie clip command to this, the second instance will have a new name right? so how can I change the code that addressed the original movie clip to relate to the new instance with the new name?
View 5 Replies
Jul 4, 2005
I'm using this code to duplicate a movieclip:
Code:
for (i=0;i<10;i++) {
_root.lane.duplicateMovieClip("lane"+i, i);
i++
}
Now, I want each duplicate to have their _x position 30 pixels away from each other.
Basically, they would all be in a row, I'm sure it's simple so how can I put them all in a row?
View 6 Replies
Jul 11, 2005
how can i duplicate movieclip and add actionscript 2 the duplicated movie?
View 1 Replies
Feb 24, 2008
Im creating a portofolio for myself, and im trying to make it database dependent, so i can update it through mysql and php. Im loading my vars from a database called portofolio, where i want to load a title, description, id, and a url to an image. In my fla i have the following code:
Code:
//postition of the first thumbnail
var nextx:Number = 25;
var nexty:Number = 25;[code]....
i would like to have all the data from the DB imported using only one query, and then have it displayed in the thumbnail duplicates.
View 3 Replies
Nov 30, 2008
Ok having some issues with this:I create a new movieclip:this.createEmptyMovieClip("setClip1", this.getNextHighestDepth());and then I attach a bunch of the same movieclip from the library to my new clip:in a for loopthis.setClip1.attachMovie("dashLine","dashLine"+i, this.setClip1.getNextHighestDepth());This is all working fine. BUT, I try to duplicate this movieclip:_root.setClip1.duplicateMovieClip("setLeft1",thisgetNextHighestDepth());And it seems to work - I can trace the _x/_y values and such so it sees my new clip but nothing shows up. It's just blank.So my question I guess to start is this:When you useduplicateMovieClip, does it bring with it all of the attached movieclips as well or does it not include the attached clips as well?
View 1 Replies