Duplicating Movie Clip
Can someone help me check this file so that whenever i press the dupe button a cube will duplicate and and form steps down instead of moveing the 2 cubes?
http://b.1asphost.com/connexi/Terrain1.fla
FlashKit > Flash Help > Flash MX
Posted on: 10-05-2005, 07:49 AM
View Complete Forum Thread with Replies
Sponsored Links:
Duplicating Movie Clip
I am currently haveing a number of movie clips duplicated within a movie - The problem that I am haveing at the moment is that the movie clips that are being duplicated are being positioned on top of other symbols on the stage, even when I place these symbols on layers above the one with the original movie clip that is being duplicated - can any one please help with this problem
thanks
Peter
View Replies !
View Related
Duplicating A Movie Clip
Hi,
I was wondering if someone could help me out.
I want to make something like a 'night sky'...
I have the black background and a movie clip called
star.
Can anyone tell me the script to have the star movie clip
duplicated and randomly placed across the black background?
I don't want more than 15 stars on the background at a time.
Thanks for your help!!
View Replies !
View Related
Duplicating Movie Clip
I have created 5 buttons. I have created 1 movie clip.
I am controlling the movieclip with button1 by doing a "on roll over, tell target (movie1) go to and play 1" I want to use the same movie for the same effect (with changes on layer 2 of each movie)Can I duplicate the movie clip, rename it, drag it onto the timeline, and control with each button. In other words, button 1 controls "movie", button 2 controls "movie2", etc. If not any suggestions would be appreciated...
Thanks for your help - DB
View Replies !
View Related
Fed Up With Duplicating Movie Clip... Please Help
Hi All,
I'm working on a presentation for a educational institution. I came across one problem for which i need you people's help.
This presentation is for primary level and so its a alphabetical exercise. I animated a bear entering on screen carrying two papers on which "A" and "a" is written. and then another enter with "B" and "b" and so on till "Z". What I've done is made a movie clip of one bear (with "A" and "a") and duplicated it 25 times (As there are 26 alphabets). Now when I'm placing all these animated movieclips on screen. The file size get heavier and the animations moves slow and jerked. There is no changes in bear appearance and colour or stucture, the only change is the alphabets.
Is there any way to do it easily as the file size should not increased and it play smoothly.
Please help me with solution
VICKYMUSTDIE
View Replies !
View Related
Duplicating A Movie Clip
I have a movie clip (smallwheel) that contains two movie clips (wheelclip1, wheelclip2). At the begining of the movieclip (smallwheel3) only wheelclip1 is visible, after a simple motion tween only wheelclip2 is visible. Wheelclip2 can then be dragged. What I would like to happen is this:
After Wheelclip2 has been dragged and released a duplicate of the movie (smallwheel3) is created and place in the original position.
The duplication occurs but after the second wheelclip2 is dragged and released it simply disapears. I would like to be able to have many copies of wheelclip2 that can be dragged on press.
Here is the code that I have placed on wheelclip2:
on (press) {
startDrag(_this);
}
on (release) {
stopDrag();
for(i=1;i<i+1;i++);{
duplicateMovieClip("_root.draw.smallwheel3","small wheel3"+i,i);}
}
Any help would be greatly appreciated.
Thanks
View Replies !
View Related
Duplicating A Movie Clip
i have a movie clip that a user can duplicate by pressing a button. i want the new duplicated movie clip's ._y attribute to be 50 pixels offset. the first duplicate i make is offset, but all the others just duplicate in the same place.
cna someone please tell me what i'm doing wrong and how to get each new movie clip to be offset from the previous one
here is my code:
// initial container name is "container0"
copy=0;
apply_drag(copy);
//copy button
_root.more.onRelease=function() {
duplicate_container();
}
//duplication functionality
function duplicate_container() {
copy++;
container0.duplicateMovieClip("container"+copy,cop y);
_root["container"+copy]._y+=50;
apply_drag(copy);
}
//dragging
function apply_drag(copy) {
_root["container"+copy].frame.onPress=function() {
_root["container"+copy].startDrag(false);
}
_root["container"+copy].frame.onRelease=function() {
_root["container"+copy].stopDrag();
}
}
View Replies !
View Related
Duplicating Movie Clip
Hi People
Maybe somone could help?
I need a simple code i can use to duplicate movie clips, I also need to use this script for more then one movie clip, the duplicated movie clip needs to be able to be draggable.
It would hep if someone could help me, im using flash mx professional
Thanks in advance
ben_2005
View Replies !
View Related
Help With Duplicating Movie Clip.. ^^
Hi everyone..
This is my first post and... my first question.. I got this shooting game that I want to do..
Basically a bunch of target (movie clip called "blah") will fall randomly.. done with actionScript.. this is the code:
Code:
for(i=1;i<4;i++){
blah.duplicateMovieClip("blah"+i,_root.getNextHighestDepth());
}
where blah is the movie clip.. as for the shooting cursor, I used mouse.hide and another movie clip with the mouse drag code:
Code:
onClipEvent (load) {
startDrag(this, true);
Mouse.hide();
}
Somehow all of those duplicated movie clip (Target) seems to be above the shooting cursor, instead of below it - except one which is the main copy, I suspect it's something to do with the _root.getNextHighestDepth() code in the duplication.. so I tried messing around with it.. it doesn't work (T_T).
I tried deliberately setting the depth into its own depth, i.e.:
Code:
for(i=1;i<4;i++){
blah.duplicateMovieClip("blah"+1, blah.getDepth());
}
Can someone please help me?? (T_T)
Thanks in advance..
Oh by the way.. I'm using Flash 8 Professional...
-B.B
View Replies !
View Related
Help Duplicating Movie Clip
hey every body i need some help duplicating a movie clip... its for like a shooting game...
i have a dot which is named circle and i have this code on it
Code:
onClipEvent (enterFrame) {
_root.newCircle._y -= 5;
if (Key.isDown(Key.SPACE)) {
_root.newCircle = this.duplicateMovieClip("newCircle"+_root.getNextHighestDepth(), _root.getNextHighestDepth());
_root.newCircle._x = 69;
_root.newCircle._y = 93.5;
}
}
it works fine but when i press space the new movieclip goes back to where it was and starts moving from there... it doesnt create a new movie clip in that spot...
can anyone help me duplicate this more then one time?
View Replies !
View Related
Duplicating A Movie Clip?
I have been wondering about duplicating a movie clip.
Is there a way to duplicate one already made and then rename it - so it is a new clip with the same animations/coding/actions on the inside without changing the original clip???
It seems every time that I've tried to do this, it will still change all / or the original clip.
Does this make sense?
View Replies !
View Related
Duplicating A Movie Clip?
I have been wondering about duplicating a movie clip.
Is there a way to duplicate one already made and then rename it - so it is a new clip with the same animations/coding/actions on the inside without changing the original clip
It seems every time that I've tried to do this, it will still change all / or the original clip.
Does this make sense?
View Replies !
View Related
Duplicating Movie Clip
I have an instance inside of a movieclip that I am trying to duplicate on press. I also am trying to have this duplicated instance take the name of the original instance plus a variable. I'm sure I'm way off, but this is what I'm trying:
Code:
on(press) {
_root.currentNum++;
duplicateMovieClip(this,this._name+_root.currentNum,1);
this._x += 100;
trace(this._name);
trace(_root.currentNum);
}
The instance is duplicated, but it's not getting the right instance name.
View Replies !
View Related
Duplicating Movie Clip
I have a welding torch fallowing a path and i need the sparks from the torch to play and stay at the spot it started to play at while the torch moves along and i want to use action script to do this i'm a beginner and i dont really know how to do this please help me!!!!
oops i put this in the wrong section can someone put this in the actionscript section?
View Replies !
View Related
Duplicating A Movie Clip
hey all.......
i'v just wrote this script in flash 5 for doing a random x/y position for a movie clip nClipEvent (enterFrame) {
_x = random ( 500 );
_y = random (500);
}
but i just want it to be duplicated every time it is in any x/y position ......
so wanna help from ya guy, i am a newbie so i want a little bit explanatoin thx 4 helping........
View Replies !
View Related
Duplicating A Movie Clip Onto Another
I'm sure I'm just not thinking about this right but rather than scrathc my head for hours, hopefully someone can tell me where I'g going wrong.
I'm trying to produce a sort of gallery. I want to be able to duplicate a thumbnail as many times as I require. I then want to use a mask so that the thumbnails slowly appear.
So the problem I have is duplicating a movie clip so that the duplicate lies on the layer which is being masked. I have a movieclip in the masked layer on to which I want to put the duplicated thumbnails. In other words, how do I stop my duplicate movie clip from appearing in _root?
View Replies !
View Related
Duplicating Movie Clip
The below script has a duplicate movieclip in it yet it does not seem to be working ? Can anyone tell me why thanks:
on (release) {
//font = _root.extras.font_cb.getValue();
font = font_cb.getValue();
_global.text = input;
//if (_root.inputbox.text != "" ) {
count++;
duplicateMovieClip(_root.extras.textmovie,"textmov ie"+count,count+12);
this["textmovie"+count].onPress = function() {
this.startDrag();
this.dragging = true;
};
View Replies !
View Related
Help With Duplicating A Movie Clip
i read the tutorial, and can't get it to work...
i'm trying to get the bullet to be duplicated at the correct position each time the gun is fired
the fla is attached, will someone plz tell me what i'm doing wrong?
thanks
BTW- all artwork was made by porpous (except the line that he walks on lol)
fla can be found
HERE
View Replies !
View Related
Duplicating Movie Clip
I'm setting up a simple photo gallery with thumbnails. I've made one thumbnail clip, and then I'd like to duplicate that clip as many times as necessary to house the various thumbnail images that will be loaded dynamically.
I started to script it, but for some reason, although the duplication part works fine, it doesn't seem to recognize any attempts to work with the properties of the duplicated clips? Long story short, this script doesn't work (and yes, of course spacer is defined, and the syntax itself is fine. When traced, the values are all correct - just doesn't apply to the movieclip targeted for some reason??):
ActionScript Code:
for (var i=1; i<total_images; i++) {
duplicateMovieClip(thumbs.btn0, "btn"+i, i);
thumbs[btn+"j"]._x = thumbs["btn"+(j-1)]._x + thumbs["btn"+j]._width + spacer;
}
...but this one does?
ActionScript Code:
for (var i=1; i<total_images; i++) {
duplicateMovieClip(thumbs.btn0, "btn"+i, i);
}
thumbs.btn1._x = 200;
thumbs.btn2._x = 300;
//etc...
Why can't I control the properties of the duplicated clips within that first loop? Am I just missing a step someplace?
Any help would be great! Thanks!
View Replies !
View Related
Duplicating A Movie Clip
i have a movie clip that a user can duplicate by pressing a button. i want the new duplicated movie clip's ._y attribute to be 50 pixels offset. the first duplicate i make is offset, but all the others just duplicate in the same place.
cna someone please tell me what i'm doing wrong and how to get each new movie clip to be offset from the previous one
here is my code:
// initial container name is "container0"
copy=0;
apply_drag(copy);
//copy button
_root.more.onRelease=function() {
duplicate_container();
}
//duplication functionality
function duplicate_container() {
copy++;
container0.duplicateMovieClip("container"+copy,copy);
_root["container"+copy]._y+=50;
apply_drag(copy);
}
//dragging
function apply_drag(copy) {
_root["container"+copy].frame.onPress=function() {
_root["container"+copy].startDrag(false);
}
_root["container"+copy].frame.onRelease=function() {
_root["container"+copy].stopDrag();
}
}
View Replies !
View Related
Duplicating A Movie Clip Using A Button ?
hi all,
i am trying to duplicate a movie clip using a button, and then place the duplicate at a randon spot on the stage.
something like this:
on (release) {
atom.duplicateMovieClip ("atom"+counter, counter)
}
atom is the instance name and counter is a variable set to 1 on the main timeline in the first frame.
but i'm not sure how to reference the duplicate to move it. using dot sytntax, is this how i do it:
("atom"+counter)._x=..some random position.
i know how to generate the random position, but i'm not sure how to reference the duplicate to move it there.
thanks!
[Edited by ian23 on 09-01-2001 at 04:19 PM]
View Replies !
View Related
Duplicating Movie Clip In Specified Pattern
hi
i am not sure how to go about starting this project. i have never had success with duplicating movie clips and if there is anyone out there kicking around today, i would really appreciate some help.
i need to make a duplicating movie clip swf
the mc is a circle and i would like it to duplicate to the number 910
in a square pattern that is 26x35
then i need to be able to target each duplicated circle to be able to change its color.
i bet i can get a duplicating movie clip going, but how to go about making it duplicate equally spaced in a square pattern, 26x35...
stummper.
thank you for listening and i look forward to any help you can offer me.
best
slimpixi
View Replies !
View Related
Depth Of A Movie Clip After Duplicating?
hello,
I have MovieA which is Duplicated about 37 times with the below code:
---------
duplicateMovieClip (this.CalendarX, "mc"+start, start);
setProperty ("mc"+start, _x, newx);
That works fine, but i have a button inside of the movie, which displays info when a user rollover it. I need the code to to movie the the movie which the mouse is over to be on top of the other 36. I have tired the below with no luck. Please help Thanks!!!
onClipEvent(load){
this.swapDepths(50);
}
View Replies !
View Related
Duplicating Movie Clip Problems.
Hey,
I'm trying to spawn enemies so that whenever one is killed another one spawns to a maximum of 3 on screen at a time.
Quote:
// Frame 69 Actionscript
enemycoordinates = [ [ 100, 150, 100 ],
[ 200, 300, 75 ],
[ 400, 150, 50 ],
[ 600, 200, 25 ],
[ 750, 75, 92 ]
];
while (_root.enemiesalive < 3) {
_root.enemiesalive += 1;
duplicateMovieClip (_root.level1enemy, "level1enemy_" + _root.enemiesalive, _root.enemiesalive);
enemytospawn = random(5);
set("level1enemy_"+_root.enemiesalive+"._x", enemycoordinates[enemytospawn][0]);
set("level1enemy_"+_root.enemiesalive+"._y", enemycoordinates[enemytospawn][1]);
set("level1enemy_"+_root.enemiesalive+"._xscale", enemycoordinates[enemytospawn][2]);
set("level1enemy_"+_root.enemiesalive+"._yscale", enemycoordinates[enemytospawn][2]);
"level1enemy_"+enemiesalive.gotoAndPlay("Alive ");
}
// The above appears to be getting set as when I go List Variables it displays the x, y, yscale and xscale for each of the three objects, but they don't seem to appear on screen anywhere.
// Frame 70 Actionscript
prevFrame();
// For level1enemy actions
on (release) {
if (this.dying != true) {
totalshots += 1;
totalscore += 1;
this.gotoAndPlay("Dying");
}
}
// When the enemy is clicked it goes to the dying label, does the animation and then calls
removeMovieClip(this);
Anyone have any ideas? Post if you need any more information.
Thanks.
View Replies !
View Related
Duplicating A Movie Clip W/ Animation
I need a thing that on enterframe adds 1 to a count, so it would have the frame number stroed in count. I would also need a movieclip to duplicate itself on certain frame numbers (like frame 5, 100, or 4000). But when I get it to duplicate, it doesn't play the movieclip. (The movie clip has an animation inside it.) So how would I make a .play(); that would work with this?
Thanx Much
View Replies !
View Related
Duplicating A Duplicated Movie Clip
I am doing a project in which lot of images should be displayed. Each images is retrieved from the database.
What I have done is, I have placed a movie clip and duplicating it as necessary on clicking of a button. So depending upon the number of images stored in the database, movie clip will be duplicated and gets loaded with the images.
These duplicated movie must be draggable. Therefore If the user wants to choose particular image, he will be able to drag these movie clip and put into another movie clip. The user can choose a single image multiple times.
So I want to duplicate the duplicated movie clip on the release event of the duplicated movie clip.
How to do this?
Thanx in advance.
Nagarajan.V
View Replies !
View Related
Duplicating 1 Movie Clip, And Another Dessapears?
i can't get this one the way i want. I have this movie clip which duplicates it selve and, than when u press space, u can start shooting. This shooting is done with an other movie clip which duplicates itselve. But when this one duplicates itselfse, i can see that other movieclip is dissapearing bit by bit, although the name of each thing is different....any help here?
View Replies !
View Related
Duplicating Movie Clip Trouble
code:
mcname.DuplicateMovieClip("mc2", _x = 434);
Every time I use that script to duplicate a movie clip, it keeps doing it more than once. Also, The original MC also goes to the property which I had set for the copy, IE (_x = 434) in this example. What am I doing wrong?
Thanks.
View Replies !
View Related
Duplicating Movie Clip Question
Hey guys,
I have a very basic function i want to perform. I would like a new ball movie clip to be created everytime I click on a button. I have the code that allows me to make this and have the ball show up 30 pixels over from where the previous ball showed up. however, I would like the ball to start on a NEW line when it reaches a predetermined destination. In other words, I want the balls to form a grid.
Here is the code that I have thus far. Any help would be greatly appreciated.
j=0;
i=0;
create.onRelease=function(){
ball.duplicateMovieClip("ball"+i, i);
mc=_root["ball"+i];
mc._x=i*30;
i++;
}
View Replies !
View Related
Question About Duplicating A Movie Clip
Hello, I currently have an image gallery strip that goes from right to left and when a user clicks on the image it loads the larger version below the strip. The problem is, when the strip gets to the end, I have to stop it, but I want it to loop from the beginning to have a constant rolling strip... in order to do that i thought of duplicating that instance and deleting the old instance once it is off the screen... to have it keep rolling... is there a way to do such a thing? i searched but could not find any information on it.
here is the swf i am talking about...
go to
http://guttershell.com/
and click on Gallery...
View Replies !
View Related
Duplicating An Attached Movie Clip
Hi all,
I have several movie clips that are dynamically attached to a base Movie Clip (when user clicks on a button). Think of a torso as a base MC; and shirt, jacket, etc. are attached to it using attachMovie method.
After attaching the MCs, I want to be able to duplicate the base MC (the torso) and all the attached MCs. How do I do this? When I use duplicateMoveClip method it only duplicates the base.
Any help would be appreciated. Thank you very much!
Bdik
View Replies !
View Related
Duplicating Movie Clip Problems
Please, I need help duplicating movie clips.
Here's what I want to do...
Click an add button, duplicate the movie clip. Click the add button again, duplicate the movie clip again. Ext. Sounds simple enough.
Here's the problem...
When I click the add button the second time the first movie clip that I added disappears.
Any suggestions why this might be happening?
View Replies !
View Related
Duplicating A Movie Clip Issue
I have an issue that seems to have appeared on the forum but I don't see any solution:
I insert a new movie clip "A" into the library. It is two lines of text only.
There is a movie clip in the library that has the exact function that I need so I duplicated movie clip "B" in the library, not on the stage.
Then in one of the frames of movie clip "B" I swap a movie clip symbol with the newly created "A".
I test the movie and all is fine until I save the movie, close it and then reopen it.
When I reopen it the graphics get scrambled as if they are somehow all connected to one another.
Any solutions out there?
Your help appreciated.Text
View Replies !
View Related
Duplicating Movie Clip Using Xml As Database
I am new to xml and require help for same. I have a world map where i need to place a circle ( movie clip) at different coordinates. I have data placed in xml as:
<countries>
<regions name="AS" value="14">
<subregion URL="location.aspx?section=location&cityname=Bangalore&CountryName=India" name="India" value="Bangalore - 6" xval="150" yval="100" />
<subregion URL="location.aspx?section=location&cityname=Bhubaneshwar&CountryName=India" name="India" value="Bhubaneshwar - 2" xval="100" yval="80" />
<subregion URL="location.aspx?section=location&cityname=Chennai&CountryName=India" name="India" value="Chennai - 1" xval="200" yval="110" />
<subregion URL="location.aspx?section=location&cityname=DELHI&CountryName=India" name="India" value="DELHI - 1" xval="10" yval="10" />
</regions>
</countires>
I have created a movie clip as "dot_mc". Now i want to duplicate this movie clip, so that the X and Y position is taken from the XMl file ( xval and yval).
I am stuck at this crucial point and want to finish it off at the earliest or else would be in soup. Please help.
Thanks in advance.
View Replies !
View Related
Duplicating Movie Clip Problem
Hi anyone
I'm trying to code a movie clip so when it is clicked a duplicate is created at a pre-defined location (callled origX and origY). I've tried adapting the code in the help files but, alas, no joy. Where am I going wrong (see attached code)
"counter" is just a counter which increments each time the MovieClip is clicked and is added to the string representing the name of the latest instance of the movie clip.
The "trace"s are just in there for testing, but reveal an 'undefined' for _x and _y for the new movieclip.
Rick
Attach Code
on (press) {
_global.counter++;
var new_cow:Object = "cow"+_global.counter;
duplicateMovieClip(cow, new_cow, this.getNextHighestDepth());
//new_cow._visible = true;
new_cow._x = origX;
new_cow._y = origY;
//trace(new_cow._x);
trace("origX = "+origX+"origY = "+origY);
trace(new_cow+" x = "+new_cow._x+" y = "+new_cow._y);
}
View Replies !
View Related
Duplicating Movie Clip Using Xml As Database
I am new to xml and require help for same. I have a world map where i need to place a circle ( movie clip) at different coordinates. I have data placed in xml as:
<countries>
<regions name="AS" value="14">
<subregion URL="location.aspx?section=location&cityname=Bangalore&CountryName=India" name="India" value="Bangalore - 6" xval="150" yval="100" />
<subregion URL="location.aspx?section=location&cityname=Bhubaneshwar&CountryName=India" name="India" value="Bhubaneshwar - 2" xval="100" yval="80" />
<subregion URL="location.aspx?section=location&cityname=Chennai&CountryName=India" name="India" value="Chennai - 1" xval="200" yval="110" />
<subregion URL="location.aspx?section=location&cityname=DELHI&CountryName=India" name="India" value="DELHI - 1" xval="10" yval="10" />
</regions>
</countires>
I have created a movie clip as "dot_mc". Now i want to duplicate this movie clip, so that the X and Y position is taken from the XMl file ( xval and yval).
I am stuck at this crucial point and want to finish it off at the earliest or else would be in soup. Please help.
Thanks in advance.
View Replies !
View Related
Duplicating Movie Clip Problem
Hey all,
I'm running into problems of attempting to create a flash based site
composed of multiple windows(mc's) which I need to get generated based
on how many lots of information are passed into it.
I currently have:
database
php page displaying information to get passed into flash (number of db
rows + the content)
the working window which is able to obtain the information off the page.
The problem is, I will be passing multiple lots of information that I
will want in multiple windows (with no limit).
so i'm hoping I can:
have the 1 primary mc always appearing.
if there are 5 rows of information come through.
it duplicate the mc 4 more times. on which a loop will set all the
content to the correct mc's.
What I currently have working is at
http://project.exofire.net/flash
but currently the 2 windows are both manually made, and do not have a
loop to put the content in.
there is just a few lines of code for each window.
I should be able to generate the loop myself once I can find a method of
creating multiple windows on demand, and find a way around each pulling
the content for the correct window.
Any help is appreciated.
View Replies !
View Related
Duplicating Movie Clip Into An Array In AS3
Hi anyone
I am writing an interactive 'bingo' game which creates a bingo card with 20 boxes. In AS2 I used duplicateMovieClip and 'push'ed the duplicate into an array. I could them access each movie clip when clicked (to turn a cross on or off on the movie clip). I'm new to AS3 and am really struggling to get to grips with the new coding protocols. Can anyone help with the attached code?
My original movie clip is called symbol_box_mc and the array I want to push it into is called symbol_box
I've a load of other queries about this project but one step at a time!
I've defined the array earlier with...
var symbol_box:Array = new Array();
Attach Code
//create an array to hold used symbols
for (i=0; i<20; i++) {
var newImg_mc:MovieClip = symbol_box_mc.duplicateMovieClip("newImg_mc"+i, dep++);
symbol_box.push(newImg_mc);
}
View Replies !
View Related
Duplicating A Draggable Movie Clip
I'm wondering if there is a way to duplicate a mc so that when you drag & drop a ball, for example, there can be 50 balls stacked underneath, each with its own capabilities to be dragged individually? Obviously the goal is to be able to do this without applying the start/stop drag action to each ball.
Any suggestions would be hugely appreciated!
Thanks!
View Replies !
View Related
Dragging & Duplicating A Movie Clip
Hi - I'm trying to figure out a way to basically create a stacking effect out of a draggable element. Is there a way to do this without manually duplicating and stacking? Each one needs to be able to be dragged independantly.
Any help is much appreciated!
View Replies !
View Related
Duplicating A Movie Clip Outside The Stage.
I'm looking for a way to duplicate a movie clip outside the stage in a random position. it doesnt have to be duplicated in that position, i can do onClipEvent(load) but i just need to know how to put a movie clip in a random position OUTSIDE the stage, any help would be appreciated
View Replies !
View Related
[Problem] Duplicating A Movie Clip.
Well, I am developing a Tower defense game and I need some help with the duplicating movie clip and also another few thing. When I open my game and try to add a tower it doesn't seem to add a new clip? When you click the button of the tower in the store there is a 'clear' button that appears above the playing field. There is a variable set to true when you click to buy the turret. When you click the 'clear' button, it should duplicate a movie clip that is out of view (but still added to the canvas), and add it at the mouses position.
Here is the A.S. that is on the 'clear' button above the playing field:
Code:
on (release) {
_root.adding = false; // sets the adding var to false
if (_root.adding_type == "green") { // checks the type of turret the player is adding
_root.green_turrets = Number(_root.green_turrets)+1; // add to the amount of green turrets
duplicateMovieClip(add_green,"green_turret" + _root.green_turrets, 1); // duplicates the green turret that is hidden (but still on the canvas)
// this is where I get lost:
setProperty("green_turret" + _root.green_turrets,_x,_xmouse); // Tries to change the x position of the new movie clip
setProperty("green_turret" + _root.green_turrets,_y,_ymouse);// Tries to change the y position of the new movie clip
} else {
// add other turret here later -.-"
}
gotoAndStop(1);
}
And here is the A.S when you click to buy the turret in the store:
Code:
on (rollOver) {
details1.gotoAndStop(3); // shows the details of the turret
}
on (rollOut) {
details1.gotoAndStop(1); // hides the details of the turret
}
on (release) {
if (_root.money <= 15) {} else { // checks if player has enough money for the turret
_root.money = number(_root.money) - 15; // takes money from player's bank
_root.money_vis.text = Number(_root.currentWave); // displays new amount of money
_root.adding = true; // sets the adding var to true (durr?)
_root.adding_type = "red"; // sets the type of turret that the player is adding
_root.add_feild_mc2.gotoAndStop(2); // shows the 'clear' button on top of the playing field.
_root.turrets.gotoAndStop(1); // closes the shop.
}
}
Thanks for any help, Andrew
View Replies !
View Related
AS 2 Duplicating Movie Clip Problem
Help Anybody,
I followed kirupa's tutorial on duplicating movieclips http://www.kirupa.com/developer/acti.../duplicate.htm
Now I have to fade the object I am duplicating in the timeline. I thought placing a object over it as a layer would work...but it doesn't.
Can anybody help?
Thank you, Brian
View Replies !
View Related
Duplicating Movie Clip To Take Some Shape
Hi All,
I would appreciate if someone can please help with the query below:
I have a circle movie clip which i want to duplicate so that it takes the shape of the object.
for instance, if i want the dots to form a shape of cone by randomly populating the region of the cone/square etc.
i can do this via masking, but i dont want the dots to cut or maybe eliminate dots that are going outside the boundry of the shape.
please advice.
thanks in advice.
View Replies !
View Related
|