Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Dynamic Movive Clip Duplication


I have an empty movieclip (mc_holder).Now I dynamically create some textbox
instances inside this movieclip.
A function takes this mc_holder and duplicates it with a new name.
Strange the mc_holder duplicated does not have the textboxes.

How to do that

Help .




Adobe > ActionScript 1 and 2
Posted on: 09/20/2007 05:40:01 AM


View Complete Forum Thread with Replies

Sponsored Links:

Movive Clip Hit State
Hi guys, thanks for taking the time out to read this.

Is there a way of telling a MC button to have a hit state like a normal button?

I have some text popping up away from my MC button that is included in the hit state. When I roll over the main button the text pops up. But also, when I roll over where the text pops up it also triggers the pop up animation.

I hope this is clear and I hope you can help.

Thanks in advance.

View Replies !    View Related
XML And Dynamic Duplication Of Movie Clip...
I'm trying to develop this flash journal/blogging system...

My only hang up...

I am trying loading XML variables into a single movie clip... and then duplicating that clip based on a _y value. I have the text autoSize set to true... so that there is no character limit.

But the movieclip isn't dynamically sensing the y value it should - once the text autoSizes...

Here is my code for duplicating the clip and setting the new _y:
///////////

if (myXML.loaded != 1) {
gotoAndPlay(_currentframe-2);
} else {
if (myXML.firstChild.hasChildNodes()) {
myDesktops = new Array();
myDesktops = myXML.childNodes;
TotalDesktops = myDesktops.length;
for (i=0; i<TotalDesktops; i++) {
duplicateMovieClip("new_event", "new_event_"+i, i+1);
curClip = this["new_event_"+i];
curClip.date = myDesktops[i].firstChild.firstChild;
curClip.text_container.description = myDesktops[i].firstChild.nextSibling.firstChild.nodeValue;
curClip.text_container.link = myDesktops[i].firstChild.nextSibling.nextSibling.firstChild.nod eValue;
curClip._y = Math.round((_parent["new_event_"+(i-1)]._y)+(_parent["new_event_"+(i-1)]._height));
curClip.i_value = i;
}
} else {
gotoAndPlay(1);
}
}
stop();

////////////////

I think my problem happens here:

curClip._y = Math.round((_parent["new_event_"+(i-1)]._y)+(_parent["new_event_"+(i-1)]._height));

If I could somehow sense when the text is loaded... maybe that would fix it....

I was thinking some sort of loop that duplicates the clips individually... and senses when the previous clip is loaded... and then sets the _y values after they are loaded.

Any thoughts?

View Replies !    View Related
XML And Dynamic Sensing Of Size And Duplication Of Movie Clip...
I'm trying to develop this flash journal/blogging system...

My only hang up...

I am trying loading XML variables into a single movie clip... and then duplicating that clip based on a _y value. I have the text autoSize set to true... so that there is no character limit.

But the movieclip isn't dynamically sensing the y value it should - once the text autoSizes...

Here is my code for duplicating the clip and setting the new _y:
///////////

if (myXML.loaded != 1) {
gotoAndPlay(_currentframe-2);
} else {
if (myXML.firstChild.hasChildNodes()) {
myDesktops = new Array();
myDesktops = myXML.childNodes;
TotalDesktops = myDesktops.length;
for (i=0; i<TotalDesktops; i++) {
duplicateMovieClip("new_event", "new_event_"+i, i+1);
curClip = this["new_event_"+i];
curClip.date = myDesktops[i].firstChild.firstChild;
curClip.text_container.description = myDesktops[i].firstChild.nextSibling.firstChild.nodeValue;
curClip.text_container.link = myDesktops[i].firstChild.nextSibling.nextSibling.firstChild.nod eValue;
curClip._y = Math.round((_parent["new_event_"+(i-1)]._y)+(_parent["new_event_"+(i-1)]._height));
curClip.i_value = i;
}
} else {
gotoAndPlay(1);
}
}
stop();

////////////////

I think my problem happens here:

curClip._y = Math.round((_parent["new_event_"+(i-1)]._y)+(_parent["new_event_"+(i-1)]._height));

If I could somehow sense when the text is loaded... maybe that would fix it....

I was thinking some sort of loop that duplicates the clips individually... and senses when the previous clip is loaded... and then sets the _y values after they are loaded.

Any thoughts?

View Replies !    View Related
Clip Duplication
I want to duplicate an instance (horizontally,maximum 10 duplication)whenever i click a button. The duplication will come randomly.I mean sometime it will show 5 boxes, then 9boxes and so on. Please help.

Thanks

View Replies !    View Related
Help With Movie Clip Duplication
hello!

I have attached the file i have done so far, which doesnt work
but this is whats going on:

This .swf needs to create a list of Real Estate Listings dynamically with an variables from a text file.

Each listing is a Movie Clip that contains the following:
A photo (which needs to be loaded dynamically)
A description
An Address
Price
# of Beds and Baths
Size of property by square ft.

All of those are dynamic text fields inside of the movie clip.

So far I have a text file like so:
&N=3
&descripts="Desricption 1¿Desricption 2¿Desricption 3"
&addresses="Addr 1(BR)City 1¿Addr 2(BR)City 2¿Addr 2(BR)City 2"

Note: The (BR)'s really equal < b r > without the spaces, i dont know how to turn off html code in this message haha.

Then I tried to load an array with the variables, spilting them by the character '¿' (alt+168)

Then depending on how many listings, it would duplicate the movieclip and file in the information for all the listings in the text file. the listings would be placed under one another, and would be put in a scrollable movieclip (I dont need help with that part, just how to create them dynamically and fill them with the correct information.)

Thanks!

View Replies !    View Related
Movie Clip Duplication
I'm using flash 5. When I try to duplicate a movie clip the copy becomes one of my tweens. I have about 600 tweens and the only way I founf to get around this problem is to delete the tween that the clip turns into. But if the tween is something that I need then I can't delete it.

What do I do? Please help.

View Replies !    View Related
Duplication Movie Clip ...
Hi,

How to duplicate Movie Clip in AS3,

Thanks

View Replies !    View Related
Movie Clip Duplication And Randomization
I have some text

I want that text to fly from right to left across the screen at a random speed at a random height along with duplicates with random properties.

So multiple instances on the screen at at once at random heights acceleration/speed across the screen.

Can action script do this ? plz

Thanks in advance

View Replies !    View Related
Movie Clip Duplication Problems
I qualify as a very novice flash designer. But I'm under the gun and have a deadline to meet.

My problem is that when I try to duplicate a movie clip the copy becomes one of my tweens. This is a big problem when I need to duplicate a complex movie clip that I want to re-use for a different purpose. You understand what I mean.

If anyone can help me with this problem I would really appreciate it.

View Replies !    View Related
Problems With Duplication Of Movie Clip
can someone take a look at the attached .fla and see if you can spot what my problem is here.

an onEnterFrame handler created for an empty movieclip is supposed to run until 11 reps have finished and thus 11 duplicates of this clip will be made and lined up in a row.

problem is the onEnterFrame handler is only running once. so the clip is duped and positioned once only. don't understand why.

and here's something else strange. if i eliminate the stop() method in the parent clip's timeline (frame 15) then suddenly the onEnterFrames are ALL executed, as though i had really removed a stop() that was on the empty clip's timeline (the clip doing the onEnterFrame executions). but even then, the clips that are duped exist only until the next dupe happens, and then the prior clip is deleted for some reason.

????

i'm really confused. maybe lack of sleep, but i've actually been working on this before and had the same problems.

help would be greatly appreciated.

View Replies !    View Related
Movie Clip Duplication Problem
Not sure how to do this, but I have a rather elaborate button that I have converted into a movie clip and I want to duplicate that button into several others that look just like it, but have different images on them. The problem is that when I duplicate the clip in the library, and then edit the new clip, I don't want those changes to reflect in the original clip. I just want to be able to duplicate the original button, and then edit the copy to make another button independant of the original. I would think that this would have a simple solution, however, it seems to be eluding me at the moment. My appreciation for any help that can be given.

View Replies !    View Related
Random Movie Clip Duplication
RANDON MOVIE CLIP TRIGGERING:

1)i have a movie clip, and i want to duplicate 50 of them. The order will be one below the another. The height of one movie clip is 10 pixels, so they will go like 10, 20, 30, 40, etc. (x=0 for all of them and y= 10, 20, 30, 40,....)

2) those duplicated movie clips will be RANDOMLY duplicated and then play.

How can i do this? Any help is appreciated!

View Replies !    View Related
Tunnel Effect Movie Clip Duplication Help
I've got to create a tunnel effect and must keep the file size to a minimum. I have a series of simple circular movie clips, all similar to one another, that will zoom from the centre outwards and rotate.

I need to have some actionscript that will do the following... and I warn you this is very complicated.

1) Select one of these, lets say 5 clips at random.

2) Duplicate the selected movie clip after a random number of miliseconds / frames

3) Rotate the movie clip randomly before playing it so it's different from the others.

4) Loop this sequence.

Does anyone know how this can be done? It would be extremely helpful.

Mike
[Edited by mikehalsey_uk on 10-15-2001 at 11:13 AM]

View Replies !    View Related
How To Stop A Movie Clip Duplication After A Certain Frame?
i want to make movie clip that duplicates and apear randomly but does stop after a certain frame i tried but i failed to make it stop i put the following script

_root.my movieClip.unloadMovie()

in the frame i want it to stop at but it didnt why???!!!

View Replies !    View Related
Random Movie Clip Movement With Duplication
I want to take a movieClip from my library and dynamically duplicate it and have it move around around the stage. How can I do that?

View Replies !    View Related
Duplication Of A Movie Clip On A Lower Layer
Okay, I'm new. no duh. So I'm not going to say 'go easy', cuz I know the rules of forums. You wanna call me a loser or idiot or whatever, I surrender myself to the flames lest I missed something obvious.

I am using the candle effect in Flashkit's movie archives as the flames for a jetpack, as a school project. I experimented and halfway worked-out the Duplication effect that replicates the movie clip. However, the replicates appear on the front layer, and I don't know how to have them replicated to a lower layer.

Here's the actionscript for the first frame...yes, the movie clip being duplicated is named 'fl'.


i = 0;
setProperty ("fl", _visible, 0);
xx = getProperty("fl",_x);


here's the second frame's actions:


if(i < 35)
{
duplicateMovieClip ("fl", "fl" add i, i);
setProperty ( "fl" add i, _alpha,i*8);
setProperty ( "fl" add i, _x,random(3) + xx);
i = i + 1;
}


Maybe I am an idiot, not knowing how to do this. I'm not exactly the flash guru, but any help would be appreciated. Thanks again for tolerating a new guys' post.

View Replies !    View Related
[MX04] Clip Duplication Based On Array
Hmm I seem to remember haveing seen this done, but cant remember where or how.

Essentialy I want to dynamically generate a picture our of 2 different small MovieClips.

I can make a square grid of them nicely. But what I want is for certain ones to be one colour and the rest another. So that it makes a pattern.

I thought there was some way to do it with arrays, something vaguely like this sprang to mind.

0, 0, 0, 0, 0,
0, 1, 1, 1, 0,
0, 1, 0, 1, 0,
0, 1, 1, 1, 0,
0, 0, 0, 0, 0

That would represent the layout of duplicated clips on the stage and the 0s would be one colour and the 1s another. Is there a way to do this or am I just making it up? How else might I go about it?

Thanks.

View Replies !    View Related
Random Movie Clip Duplication In Order
random movie clip duplication in order
i have 48 boxes, each row has 9 boxes and each column has 6 boxes so it is 9 x 6. Each box size is 80 by 80 pixels with 2 pixels between each box vertically and horizantally.

when my movie starts, i want the initial box1_mc clip to duplicate itself randomly to generate 48 boxes on the stage in their spot.

How do i achieve this. I know how to duplicate them randomly on stage but not in their actual spot and remember that they only have to be duplicated only once.

Please help!

View Replies !    View Related
Random Movie Clip Duplication In Order
i have 48 boxes, each row has 9 boxes and each column has 6 boxes so it is 9 x 6. Each box size is 80 by 80 pixels with 2 pixels between each box vertically and horizantally.

when my movie starts, i want the initial box1_mc clip to duplicate itself randomly to generate 48 boxes on the stage in their spot.

How do i achieve this. I know how to duplicate them randomly on stage but not in their actual spot and remember that they only have to be duplicated only once.

Please help!

View Replies !    View Related
MovieClip Duplication Deletes Previous Duplication
I have created 2 instances of a movie clip based button inn_btn and out_btn.
They are both contained in the same movie clip to which the following code is attached. The code duplicates the buttons in a column but as each of the out_btn buttons is deletes the inn_btn one that proceeds it. If I remove all the references to the out_btn one, all the inn_btns duplicate and work fine. If I keep the code in for the out_btns, all the out_btns appear and work fine but only the original inn_button is present. I've stepped it through and seen each inn_btn get deleted as the out_btn is created. I've tried lots of variations on this all with the same results.
I am fairly new to action script but doing lots of learning!


ActionScript Code:
onClipEvent (load) {
    trace("Main init");
    var inSel = 0;
    var outSel = 1;
    numButtons = 9;
    vSpacing = 22;
    //duplicate buttons
    for (i=0; i<numButtons; i++) {
        if (i != 0) {
            inn_btn0.duplicateMovieClip("inn_btn"+i, i);
            this["inn_btn"+i]._y += i*vSpacing;
            out_btn0.duplicateMovieClip("out_btn"+i, i);
            this["out_btn"+i]._y += i*vSpacing;
           
        }
        this["inn_btn"+i].onPress = function() {
            trace(this._name);
        };
        this["out_btn"+i].onPress = function() {
            trace(this._name);
        };
    }
}

View Replies !    View Related
Dynamic Textbox Duplication
ok when I parse some text to a textbox on the fly that resides in a mc and then try to duplicate that mc, do I still keep my textbox with the parsed txt ?

it seems I don't, please tell me it is not so

oz.

View Replies !    View Related
Dynamic Duplication + Calculation
I wanted to create a calculation script. Buts its not normal calculator.

1. The script would 1st randomize out the amount (15-150)
2. I will have 5 movie clip. Each represent an exact number. (1, 5, 10, 20, 50)
3. According to that 5 specific numbers, the area/movie clip will be duplicated in order to makes the amount of any of the 5 number, total up as the randomize amount.
4. The amount of the area duplicate would be 4-10

Exp:

I would 1st randomize out the amount: 124
So in order to have either of that 5numbers total up as 124, It would duplicate out 7 area()

( )+( )+( )+( )+( )+( )+( )=124


Now from here I would drag in the 5 numbers given to sum up to 124

(50)+(50)+(20)+(1)+(1)+(1)+(1)=124


Any ideas or guide on how to do this?

View Replies !    View Related
Heeelp - Dynamic Vars / PHP, Duplication
Im really struggling with the last part of what I'm trying to do here - that's if I'll be able to do it at all maybe some1 can help.

Im using PHP to pull records from MySQL into flash - that part works ok.

Im getting the data into flash and putting the each pair of variables into a movie clip, which Im duplicating vertically. One of the variables has varying length, so I'm using a method I picked up on here (thank god) for using "maxscroll==1" on the varying field and moving to the frame where the textbox is long enough to accommodate it. It took a while to get that to work but eventually it did.

My only remaining problem is the positioning of the duped movie clips. I've tried:

((previousClip._y +(previousClip._height /2))+5) + (thisClip._height / 2)

but that didnt work.

I also tried using getbounds yMax - yMin on previousClip - that didnt work either. It looks like no matter what I do flash is assuming that all the duped movie clips are the same height.

I tried using the method of calculating the approx. height of the clip by (getting the length of the data string and dividing by the average number of chars per line) X height of char - but thats kinda ugly as the gap differs depending on whether the string is full of i's or full of w's.

It seems that the for loop Im using only sees the original height of the previousClip.

It so nearly works - if anyone can shed some light on this Id be very grateful.

I've put the .fla up at http://www.firmdesign.co.uk/mysqltes...cvarsmovie.fla
in case you wanna take a look.

View Replies !    View Related
Dynamic Txt Field Movieclip Duplication Question
trying to produce some txt fx using dynamic tx fields in a movieclip.( im looping through characters ).the movie clip is duplicated. is there anyway once a movieclip is duplicated to make an earlier duplication of the clip and/ or the original instance undynamic? (ie the cycling of characters stops )
n e help much appreciated!!!

View Replies !    View Related
Dynamic Text Within Dynamic Movie Clip Loops
Ok my predicament. I am trying to create thumbnails, but instead of using pictures as the thumbnails I would like to have text, formatted blah blah for people to select. Now the code I am trying to adapt is fine and dandy to get working with pictures, so I know the part of this code that creates the movie clip is fine. However I cannot seem to dynamically create the text boxes within the movie clips. I need to have them within the movie clips so the opacity will change when they are hovered over.

Code:

currentName = "t"+k
thumbnail_mc.createEmptyMovieClip(currentName, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.currentName.createTextField("text"+cu rrentName, thumbnail_mc.currentName.getNextHighestDepth(), 0, 0, 244, 28)
thumbnail_mc.currentName.text="test"

k will be changing anyway for each time through taht a movie clip is made hence why they will need different names.

Any help...hope this can be understood.

View Replies !    View Related
Duplication
I have this simple code but it just wount duplicate

Code:
onClipEvent (enterFrame) {
x=_root._xmouse;
y=_root._ymouse;
_name="circle"+i;
duplicateMovieClip ( "circle", _name, i );
_root[_name]._x=x;
_root[_name]._y=y;
_root[_name]._xscale=x;
_root[_name]._yscale=y;
_root[_name]._rotation=x*y;
i++;
}

View Replies !    View Related
Duplication Var
Right, I'm a wee bit stuck!

I'm trying to create a movie with 6 draggable MC's and 2 target areas. Each MC has a different numerical value.

I want the user to try out different combinations of MCs in the target areas and see the total of the two MC's within the target areas in a text box by pressing a calculate button.

I want to calculation to work even when only one target area is filled by a movie clip.

can anyone help?

Maybe a few keys: DuplicateMovie etc? Please help

View Replies !    View Related
Self Duplication
I need to be able to click on a movie clip, and then reproduce that movie clip on screen, and if I click the same movie clip again, that another duplicate is produced.

Is this possible?

View Replies !    View Related
Duplication
I have a duplicated movie and I can't seem to make it do what I want.

Heres what I have, a movie clip that has been duplicated 3 times
----------------------
movie1-(instance name movie1)
movie2-(instance name movie2)
movie3-(instance name movie3)

----------------------
I also have a button that has been duplicated 3 times
----------------------
button1
button2
button3
----------------------
The button Code
----------------------
on (release) {
if (this.url.indexOf("|")>0) {
var z = this.url.split("|");
_root[z[0]].gotoAndPlay(z[1]);
}
}
----------------------
The Array Code
----------------------
linkArray =
[["movie1|1"],
["movie2|1"],
["movie3|1"]];

myMenu["holder"+k]["menu"+m].url = linkArray[k][m];
----------------------
----------------------
What I want to do is if you click button1, movie1 plays if you click button2, movie2 plays and it you click button3, movie3 plays. A problem I'm have is I don't know how to make a specific movie clip play when the movie clip is being duplicated. Another problem is I have to put the movie clip in with the main button and I can't seem to target the movie clip when it is inside another movie clip.
----------------------

Take a look at the menu
http://www.medeirosdesign.com
Download the file
http://www.medeirosdesign.com/Menu.fla.zip

View Replies !    View Related
Duplication
whats the best way (in your opinion) to duplicate a movie clip? and how would i hit test with the duplicated object?

View Replies !    View Related
MC Duplication
hello,

ive noticed that when you duplicate movie clips, you are able to set that depth of the MC, but on what layer is it produced?

can you assign on what layer it goes?

thx !!

View Replies !    View Related
Duplication.
I'm making a game where you can fire bullets, but so far all that happens is I fire the bullet and then I have to wait for it to end so I can fire another one. How can I duplicate the bullet so I can fire it more?

View Replies !    View Related
[F8] Duplication
I had somebody work on my site with me, as I am not exactly a pro at flash. The problem is I am trying to add a new page and can't really figure it out. I am a photographer. On my site, I have three galleries. I just wanted to see if there was an easy way to duplicate the page so I could add another gallery. You can check out my site at www.BradChristopher.com I would be so greatful to anybody who could help me out. It is very detrimental to my career right now.

View Replies !    View Related
Duplication Help
I was just playing around with the duplicate movie command and I ran into a problem. It deletes some of my earlier instances when I press the button. I have attached the fla. I think it has something to do with the level I load it on but i am not sure. Any help appreciated. Thanks.

View Replies !    View Related
Duplication/setProp Help Please
I am trying to get a script to duplicate a movieClip to form a grid of items according to the number of elements in an XML doc. the duplication work perfectly but I cant get the spacing to work.it will make the first row of four MC's and then places all the rest directly beneath those. I am really frustrated andf any help would be great. Thanks everyone!

---------------------code----------------------

//functions
function getLoaded(success){
productCount=xmlObj.firstChild.childNodes.length
for(i=0;i<20;i++){
nodeObj=xmlObj.firstChild.childNodes[i]
duplicateMovieClip(gallery.pic,"pic"+i,i)
set("gallery.pic"+i+".picName",nodeObj.attributes["name"])
for(k=0;k<productCount;k++){
if(horiz==4){
setProperty("gallery.pic"+k,_y,startY*(height*20))
setProperty("gallery.pic"+k,_x,startX)
horiz=0
}
setProperty("gallery.pic"+k,_x,startX+(horiz*(widt h+5)))
setProperty("gallery.pic"+k,_y,startY)
startY="gallery.pic"+k._y
testX=gallery.pic18._x
testY=gallery.pic18._y
horiz++
}
}
}
//INIT Vars (duplication and lable set)
dupCount=0
countX=0
countY=0
width=gallery.pic._width
//grid Vars
horiz=0
rows=0
width=gallery.pic._width
height=gallery.pic._height
startX=gallery.pic._x
startY=gallery.pic._y
//meat
stop()
//XML
xmlObj= new XML
xmlObj.load("mydoc.xml")
xmlObj.onLoad=getLoaded
=============================================

View Replies !    View Related
Movie Duplication
I have a button on stage. On Press it duplicates a MC (instance name dragme) 20 times, adding variable "a" to the instance name to give a unique instance name.

Then it should move each separate instance of the MC by 20 pixels.

On Release it should remove the instances again.

Here's the code:
----------------

on (press) {
startDrag ("_root.dragme" add a, true);
set (a, 1);
while (a<=20) {
duplicateMovieClip ("_root.dragme", "dragme" add a, a);
setProperty ("_root.dragme" add a, _x, getProperty("_root.dragme" add a, _x) + 10);
set (a, a++);
}
}
on (release) {
stopDrag ();
set (a, 1);
while (a<=20) {
removeMovieClip("_root.dragme" add a);
set (a, a+1);
}
}

View Replies !    View Related
Got Duplication Done....now To Randomize
Hi guys....long to no see

Got myself some troubles again.
I got this duplication thing going on working like this:

Duplicate Movie Clip ("/blok&name", blok&name, name)

and this going on for like 200 times. with adding 1 to every name with every duplicate.

Now I have about 200 of these mc's on my stage and I want to play them randomly untill every single one is done (the mc is 5 frames, fading out).

How to go about this....thx for the help already

View Replies !    View Related
Duplication Question
Ok.

I'm duplicating a MC with

amount = 40;

for (i=1; i<amount; ++i) {

duplicateMovieClip ("mc0", "mc"+i, i);
eval("mc"+i)._x = eval("mc"+(i-1))._x+6;
eval("mc"+i+".num") = i;

}

View Replies !    View Related
Duplication Question
Ok., I'm duplicating a MC the question is this the MC named mc has a varible in in named Text, after I duplicate the MC mc how do I set the varible in lets say the 1st thru the 3rd duplicated MC
so if I want to say
"todd" on duplicate 1 // "coker" on dupicate 2// "random" on duplicate 3

How can I talk to specific duplicated MC's ??

Please help

View Replies !    View Related
Movie Duplication
on (release) {
duplicateMovieClip ("Line", "Line" add l, l);
setProperty ("Line" add l, _x, Number (getProperty ( "Line" add l, _x ))+Number ( 15+(getProperty ( "Line" add l, _width ) ) ));
l = Number ( l )+1;
}


what is wrong with this script???
when i press the button it duplicates the movie but when i press it secend time it does nothing!!!
i want it to duplicate the same movie on and on but it only duplicate it once.

View Replies !    View Related
Duplication Effect
I have this code moving a mc to a target position what I want to do is to have it duplicate itself behind and have the last few fade away like a trail effect . I know its not easy or is it .I have done some duplication before but I dont know the best way to go around the effect I want .
[code]
onClipEvent (load) {
targetx=9;
targety=8;
targetxScale=71.7;
targetyScale=22.8;
}
onClipEvent (enterFrame) {
xdif=targetx-this._x;
this._x+=xdif/5;
ydif=targety-this._y;
this._y+=ydif/5;
scalexdif=targetxScale-this._width;
this._width+=scalexdif/5;
scaleydif=targetyScale-this._height;
this._height+=scaleydif/5;
}

View Replies !    View Related
Duplication And Remove
I have a mc called ball and two buttons that one sets a variable active=true; and the the other active =false; then I have a function on the main timeline
[code]function incball () {
if (active) {
for ( i=0; i<20; i++ ) {
_root.ball.duplicateMovieClip( "ball"+i, i );
_root["ball"+i]._x+= i*20;
_root.ball._visible=false;
if (!active) {
_root["ball"+i].removeMovieClip();
_root["ball"+i]--;
_root.ball._visible=true;
}
}
}
}

View Replies !    View Related
Duplication And Remove Again
a function on the _root level been called from a mc,clipevent that is triggered from a button either to duplicate or remove

Code:
function incball () {
if (active) {
for ( i=0; i<20; i++ ) {
_root.ball.duplicateMovieClip( "ball"+i, i );
_root["ball"+i]._x+= i*20;
_root.ball._visible=false;
if (!active) {
_root["ball"+i].removeMovieClip();
_root["ball"+i]--;
_root.ball._visible=true;
}
}
}
}
clipevent
Code:
onClipEvent ( enterFrame ) {
if (_root.active) {
_root.incball();
}
}
button says _root.active =true and the remove button says _root.active=false;
The problem is in the remove code it just doesn't remove I want it to remove back to its original state of one clip [/b]

View Replies !    View Related
Duplication And Remove HELP
Please help this is driving me mad . I have a function that is been checked from a mc to see if the button is clicked if it is it says active and it duplicates the ball mc if the other button is pressed it says active= false and it should remove the clip set in the function but it wont this is driving me mad.ddddddd
[code]function incball () {
if (active) {
for ( i=0; i<20; i++ ) {
_root.ball.duplicateMovieClip( "ball"+i, i );
_root["ball"+i]._x+= i*20;
_root.ball._visible=false;
}
} else {
removeMovieClip (_root["ball"+i]);
_root["ball"+i]--;
_root.ball._visible=true;
}
}

View Replies !    View Related
Duplication Prob
hey guys i just found a bug in the next code:
pro = {xp:630, mmbdup:7, mtbdup:6, dbb:22.5};
alpha = Math.floor(Math.random()*60)+20;
mmb1.fill._alpha = alpha;
for (i=2; i<=pro.mmbdup; i++) {
duplicateMovieClip(_root.mmb1, "mmb"+i, i);
alpha = Math.floor(Math.random()*60)+20;
_root["mmb"+i].fill._alpha = alpha;
}
_root.mtb1.endx = pro.xp;
for (i=2; i<=pro.mtbdup; i++) {
duplicateMovieClip(_root.mtb1, "mtb"+i, i);
pro.xp -= pro.dbb;
_root["mtb"+i].endx = pro.xp;
}

the bug is in the duplication depth. since it places 2 objects in the same depth and it writes over the old object it makes i duplication all 6 and the other only 2.

is there a way to fix this without using an external var that will inc a depth count???
is there a way without using external var???

View Replies !    View Related
Random Duplication
can anyone show me a bit of code that shows how to duplicate a movie clip every time a button is pressed. Eg. when i click a button a circle appears, and when i click it again, another appears but with a random offset (like 5 pixels left of the previous one)

Cheers!

View Replies !    View Related
Scene Duplication?
This is crazy.
I imported the MC of a scene that someone did into my library. This one scene however, is like over 300 kb because it's got all the cool effects & stuff.
So I can actually preview it in the library too. The second I attempt to drag it to the stage of my animation ... it all crashes! I've tried it on 2 different, powerful computers too.

What should I do? This extra scene really needs to be added to the animation I've already completed.

OH! And I tried copying layers upon layers of frames and pasting. Because this ani scene is so complex and includes all sorts of masks, etc....it totally screwed it up and would be quite a bit of work to fix. I've wasted 2 hours fooling with it!

Does anyone have any advice to give?

Thanks!
(urgent)

View Replies !    View Related
Duplication Question.
Ok, I can duplicate a Movie Clip just fine, I'm using the code

code: if (i<20) {
box.duplicateMovieClip ("box" + i, i)
}
i++

So this gives each created box a name of box1, box2, box3, etc. Now how can I move all those boxes at once without actually putting a line of code for each box? Any ideas here would be great because this is really bogging me down.

View Replies !    View Related
Loading MC Duplication?
Hi All,

I designing a "loading bar" that grows while the clip is loading, but also has those semi-transparent angled bars moving from left to right as well on top. Is there a way to move these angled bars across using actionscript and a movie clip?

For example, could I animate just one of those angle bars moving in its own movie clip then have some actionscript duplicate it, one by one, a second or so apart until the movie is loaded? Or would it just be easier to draw a long line of them and animate with a tween and mask?

Thanks in advace

View Replies !    View Related
Duplication Level
Hi everyone,
ok im having some trouble with a movie that im making.Ok i have a global variable called"N" set to 70.
i have a movie clip on the main stage called "Ninja" and on this ninja movie clip i have the following code: code: onClipEvent (enterFrame) {
if(this.hitTest(_root["mc"+90])){
this.gotoAndStop(75);
_root["mc"+90].gotoAndStop(21);
if (N>=70 && N<=89) {
duplicateMovieClip(_root.Ninja, "NMC"+N, N);
N++;
}else {N = 70;}
}
}

so i want every time the movie clip is hit to duplicate its self between the levels 70 - 89 so there will never be more than 19 instances on screen. i know the hit part works because it is sending the ninja movie to frame 75 as stated. However it is duplicating the movie always to layer 70 and not incrementing thus deleting the original movie on layer 70 so there is only one instance appearing at a time.

also when debugging i get the following results:
Movie Clip: Frame=10 Target="_level0.NMC70.instance33"
Movie Clip: Frame=10 Target="_level0.NMC70.instance34"
so its copying the instance but not assigning a new level

any help would be absolutly great as i havent got much hair left on my poor balding head.

P.S. using MX

View Replies !    View Related
Button Duplication
Hello,

Can anyone tell me how to duplicate a button so that i can change the text and code in the duplicated button? When i duplicate and rename my button and i change something in it it changes both the text and code on the button.

What am i doing wrong?

Cheers!

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved