Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > General > Animation and Effects

Reply
 
Thread Tools Rate Thread Display Modes
Old 05-15-2001, 10:47 AM   #1
Rupert
Registered User
 
Rupert's Avatar
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 618
Default

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
Rupert is offline   Reply With Quote
Old 05-19-2001, 02:26 PM   #2
Marx
New Member
 
Join Date: Feb 2001
Posts: 378
Default

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.
Marx is offline   Reply With Quote
Old 05-21-2001, 12:55 AM   #3
Rupert
Registered User
 
Rupert's Avatar
 
Join Date: Mar 2001
Location: Melbourne, Australia
Posts: 618
Thumbs up

Thanks for that! I am now well on the way to getting this thing finished - At last!!

Cheers,

Rupert
Rupert 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

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


All times are GMT. The time now is 07:57 AM.


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