Be a Supporter!

Using the same object many times

  • 281 Views
  • 9 Replies
New Topic Respond to this Topic
aplusads21
aplusads21
  • Member since: Feb. 4, 2009
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Using the same object many times 2009-02-10 05:19:41 Reply

Suppose i have a movie clip with some actions on it (say its a obstacle)

now i want to place this movie clip on several places on the stage. I manually select command duplicate symbol and place it here and there.

but the actions associated with it are lost. and i have to again paste the code for that movie clip

is there a way to duplicate the movie clip with the action script intact.

thank you

Redshift
Redshift
  • Member since: Feb. 12, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Using the same object many times 2009-02-10 05:20:43 Reply

This is precisely what classes are for. :P


#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}

BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Using the same object many times 2009-02-10 05:26:20 Reply

Place an instance on stage, with the actions on it, then simply copy/paste multiple times.

It's either that or use (AS2) Duplicated Movie Clips/attachMovie to replicate an instance on stage or from the library. If you're doing that, you can add your actions as you create the new MC.

And then there's always classes, as Nano says, but they killed my grandma so I don't like them.


- - Flash - Music - Images - -

BBS Signature
Redshift
Redshift
  • Member since: Feb. 12, 2005
  • Offline.
Forum Stats
Member
Level 15
Programmer
Response to Using the same object many times 2009-02-10 05:35:18 Reply

At 2/10/09 05:26 AM, Denvish wrote: And then there's always classes, as Nano says, but they killed my grandma so I don't like them.

*is confused*


#include <stdio.h>
char*p="#include <stdio.h>%cchar*p=%c%s%c;%cmain() {printf(p,10,34,p,34,10);}";
main() {printf(p,10,34,p,34,10);}

BBS Signature
Deathcon7
Deathcon7
  • Member since: Oct. 1, 2003
  • Offline.
Forum Stats
Member
Level 21
Writer
Response to Using the same object many times 2009-02-10 05:35:49 Reply

At 2/10/09 05:26 AM, Denvish wrote: And then there's always classes, as Nano says, but they killed my grandma so I don't like them.

Your grandma was obviously not strong in the force.

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Using the same object many times 2009-02-10 05:39:31 Reply

At 2/10/09 05:35 AM, Deathcon7 wrote: Your grandma was obviously not strong in the force.

She was geriatrically procedural


- - Flash - Music - Images - -

BBS Signature
aplusads21
aplusads21
  • Member since: Feb. 4, 2009
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Using the same object many times 2009-02-10 05:51:45 Reply

At 2/10/09 05:26 AM, Denvish wrote: Place an instance on stage, with the actions on it, then simply copy/paste multiple times.

.

i am trying copy paste duplicate movie even dragging from library to stage . But the actions are not coming with the movie clip

How do i create an instance with actions on it

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Using the same object many times 2009-02-10 06:08:42 Reply

At 2/10/09 05:51 AM, aplusads21 wrote: How do i create an instance with actions on it

I'm not sure which approach you're taking

Drag one instance of a movie clip from the library to the stage. Select it, on stage, and press F9. Paste your actions. Then just copy that on-stage MC and paste it as many times as you want, the code will come with it.


- - Flash - Music - Images - -

BBS Signature
aplusads21
aplusads21
  • Member since: Feb. 4, 2009
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Using the same object many times 2009-02-10 06:20:24 Reply

ok it worked thank you brother and sister.

TutorialPoo
TutorialPoo
  • Member since: Dec. 29, 2008
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to Using the same object many times 2009-02-10 06:49:19 Reply

At 2/10/09 06:20 AM, aplusads21 wrote: ok it worked thank you brother and sister.

It's ok mother.