FORUMS: list search recent posts


COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Cody Campbell
on Oct 28, 2009 at 9:45:27 pm

I'm an after effects guy so I apologize for my newbie-ness I dont have alot of opportunity to work in flash. In after effects there's a great twitch plugin that with shift an object a few pixels on the x-axis every so often. I found a flash tutorial that shows how to randomly shift on the x.axis but its constant. I only want it to shift every once in a while.

in after effects to do this you would set the "chances of twitch" to like 2% -- anyway to script something similar?

Cody Campbell

"Just because noone understands you does not make you an artist."

"Just because noone understands you does not make you an artist"

Return to posts index

Adam Ashby
Re: twitch
on Oct 29, 2009 at 6:39:57 am

do you have a link to that tutorial?

Return to posts index

Mike Smith
Re: twitch
on Oct 29, 2009 at 11:11:34 am

You could try playing with something like this, applying variation on the _x property of a movieclip instance name myTitcher1 ...

onEnterFrame = function () {
// each time you enter frame, get the property you want to twitch
myStarter = getProperty(_root.myTitcher1, _x);
// use a random number to decide whether or not to twitch
// multiplying Math.random by 100 should give a number between 0 and 100
// then if that number is above a threshold you set, the rest will follow
myMultiplier = (Math.random()*100);
if (myMultiplier>80) {
// change the greater than value to make this happen more or less often
// create a random amount of variation
myChange = (Math.round(Math.random()*50));
// trace(myChange);
// use another random number to decide whether to make _x value bigger or smaller
myPlusorMinus = (Math.round(Math.random()*10));
if (myPlusorMinus>=5) {
_root.myTitcher1._x += myChange;
} else {
_root.myTitcher1._x -= myChange;

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved