Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 02-11-2003, 02:25 PM   #1
cardin
Cardin
 
cardin's Avatar
 
Join Date: Jan 2003
Location: Singapore
Posts: 56
Default duplicating prob

I am trying to duplicate this movieclip but it seemed not to be working, why?
ActionScript Code:
onClipEvent (enterFrame) {     for (i=1; i<=_root.database.noOfFly; i++) {         duplicateMovieClip ("_root.fly", _root["fly"+i], i);         _root["fly"+i]._x=Math.random()*300;         _root["fly"+i]._y=Math.random()*300;     } }
__________________
Yohohoho... Yohohoho.
cardin is offline   Reply With Quote
Old 02-11-2003, 05:04 PM   #2
annexion
I make out with chicks
 
Join Date: Oct 2002
Location: NYC
Posts: 1,586
Default

ActionScript Code:
onClipEvent (enterFrame) {         for (i=1; i<=_root.database.noOfFly; i++) {                 _root.fly.duplicateMovieClip ( "fly"+i, i);                 _root["fly"+i]._x=Math.random()*300;                 _root["fly"+i]._y=Math.random()*300;         } }
Try that. If you are duplicating "fly", and those actions are in "fly" itself then use the following.
ActionScript Code:
onClipEvent (enterFrame) {         for (i=1; i<=_root.database.noOfFly; i++) {                 this.duplicateMovieClip ( "fly"+i, i);                 _root["fly"+i]._x=Math.random()*300;                 _root["fly"+i]._y=Math.random()*300;         } }
Good luck.
__________________
www.perpetuated.com
annexion is offline   Reply With Quote
Old 02-12-2003, 12:35 AM   #3
cardin
Cardin
 
cardin's Avatar
 
Join Date: Jan 2003
Location: Singapore
Posts: 56
Default

The duplicatind worked. But the fly kept duplicating all over the place, ten on the stage at any one time. Why?

ActionScript Code:
onClipEvent (enterFrame) {     if (!duplicate) {         for (i=1; i<=_root.database.noOfFly; i++) {             _root.fly.duplicateMovieClip("fly"+i, i);             _root["fly"+i]._x = Math.random()*300;         }         duplicate=true;     } }

Also, the fly is a animating movieclip, not a standstill one. However, when i used the duplicate movieclips ( I manage to control one or two flies by directly controling its _x, and i saw this ) the duplicated movieclips were staying constantly at frame 1.
__________________
Yohohoho... Yohohoho.

Last edited by cardin; 02-12-2003 at 05:47 AM.
cardin is offline   Reply With Quote
Old 02-12-2003, 05:56 AM   #4
cardin
Cardin
 
cardin's Avatar
 
Join Date: Jan 2003
Location: Singapore
Posts: 56
Default

Here's my file if you ever wanna check.
Attached Files
File Type: zip archin_the_fly.zip (19.4 KB, 121 views)
__________________
Yohohoho... Yohohoho.
cardin is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:34 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.