Duplicate and Random Code

I want to make a movie clip using the code of duplicate and random.

Page 1 of 1

4 Replies - 5567 Views - Last Post: 30 August 2006 - 06:26 PM

#1 kami85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-July 06

Duplicate and Random Code

Post icon  Posted 27 July 2006 - 03:27 AM

Hello,

My Name is Kamran Khan i am new in this site. I have a problem , i want to make a movie clip using the code of duplicate and random. Please tell me the simple and easy code of this.


I am waiting for your reply.
Is This A Good Question/Topic? 0
  • +

Replies To: Duplicate and Random Code

#2 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Duplicate and Random Code

Posted 29 August 2006 - 12:23 AM

to duplicate a movie clip you need to have at least 1 instance on the stage. It has to be named and, if not used, hidden.

you then use duplicateMovieClip( name, new name, depth ); function to make a copy.
Example:
Say you have a movieClip named foo on stage and you want to duplicate it and name it foo2...
duplicateMovieClip("foo", "foo2", 10);


How do you want the random part to come into effect?
Was This Post Helpful? 0
  • +
  • -

#3 kami85  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 26-July 06

Re: Duplicate and Random Code

Post icon  Posted 29 August 2006 - 03:24 AM

View PostpioSko, on 29 Aug, 2006 - 12:23 AM, said:

to duplicate a movie clip you need to have at least 1 instance on the stage. It has to be named and, if not used, hidden.

you then use duplicateMovieClip( name, new name, depth ); function to make a copy.
Example:
Say you have a movieClip named foo on stage and you want to duplicate it and name it foo2...
duplicateMovieClip("foo", "foo2", 10);


How do you want the random part to come into effect?



Hello Sir,

Please explain the code i use the your way but it did`t work . I make a clip with the an instanse name of foo and give him a simple your suggested code. But it does not work. And also sir i want to make a duplicate movie clip. Please give me a good suggestion.
Was This Post Helpful? 0
  • +
  • -

#4 smallfatguy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 20-June 05

Re: Duplicate and Random Code

Posted 30 August 2006 - 06:24 PM

Although I am new to Flash myself, I would guess that the code actually DID work. The only problem is that you have created the duplicate right on top of the original movie clip. If you add some code to move either of the movie clips you will see that there are now two instances on the stage. I tried this code:
var xmove:Number = 2;

duplicateMovieClip("foo", "foo2", 10);

onEnterFrame = function(){
foo2._x += xmove;
}


Was This Post Helpful? 0
  • +
  • -

#5 skyhawk133  Icon User is offline

  • Head DIC Head
  • member icon

Reputation: 1865
  • View blog
  • Posts: 20,278
  • Joined: 17-March 01

Re: Duplicate and Random Code

Posted 30 August 2006 - 06:26 PM

Very nice smallfatguy, thanks for helping!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1