| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 618
|
Hi - I have an animation where I am duplicating a movieClip that then moves from one side of the screen to the other. I want to be able to control the repeat rate of this duplication (possibly from a variable) so that end result would be like being able to control the speed of a conveyer belt. I have tried setting up something with getTimer (and even tried a controlled "random" scenario) without much success. Can anyone point me in the right direction?
Thanks in advance! Rupert |
|
|
|
|
|
#2 |
|
New Member
Join Date: Feb 2001
Posts: 378
|
Hi Rupert...
Try following this example. It contains two MC's, one contains the timer and the other is duplicated at desired intervals: 1) Place an MC to the left of your stage, name it 'myMc'. 2) Attach this action to the MC: onClipEvent (enterFrame) { _root.newMc._x+=5; } Now for the timer MC: 3) Insert/New Symbol/Movie. You should be in MC editing mode. 4) Add an Input textfield, name it 'time'. 5) Add the actions that control the repeat rate; a) Frame1: stop (); b) Frame2: startTime = getTimer ()/1000; c) Frame3: timeNow = getTimer()/1000; repeatRate = time; timeDiff = timeNow-startTime; if (timeDiff>=repeatRate) { _root.myMc.duplicateMovieClip("newMc",1); gotoAndStop (1); } d) Frame4: gotoAndPlay (3); 6) Add the control button: on (release) { play (); } When you are in test movie mode type the amount of seconds you want the delay to be in the 'time' textfield then press the button. Hope this helps. |
|
|
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 618
|
Thanks for that! I am now well on the way to getting this thing finished - At last!!
Cheers, Rupert |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| removing duplicate movie clips | chupa_chup | ActionScript 1.0 (and below) | 2 | 06-02-2004 06:13 AM |
| variable text in a duplicate movie clip | msabo | ActionScript 1.0 (and below) | 6 | 04-21-2004 12:21 PM |
| duplicate movie clip per preload percent | fixate | ActionScript 1.0 (and below) | 1 | 01-02-2004 03:54 AM |
| Target Previous Duplicate Movie | cphunk | ActionScript 2.0 | 2 | 10-26-2003 04:33 AM |
| problems with targeting a movie using a script | vladc77 | ActionScript 1.0 (and below) | 2 | 01-30-2003 06:48 PM |