random expression executed once
by Peter Hriso
on
Nov 5, 2009 at 4:06:34 am
I have the following expression on a text source:
var myArray = ["beans","rice","tacos","bbq"];
var i = Math.floor(random(myArray.length));
myArray[i]
I need a expression to execute one time and not every frame when the playhead plays through the comp. How can I run an expression to execute only at the beginning of a timeline and not on every frame? I don't see any triggers/events for detecting the first run of the timeline, for example an onEnterFrame handler function that actionscript utilizes.
thnx in advance
var myArray = ["beans","rice","tacos","bbq"];
var i = Math.floor(random(myArray.length));
myArray[i]
Re: random expression executed once by Xinlai Ni on Nov 5, 2009 at 5:15:15 am
Maybe I missed your point, but why do you want a random function to choose one out of four choices and keep it forever? Why not just pick one manually and assign it and not change it throughout the time?
Re: random expression executed once by Peter Hriso on Nov 5, 2009 at 1:59:55 pm
I have a comp generating particles. I am attempting to customize the look of the particles with animated text. I have attached a second comp to each individual particle to design the animated look and feel. I am using the second comp to design the animated words but I need it to be an array of different words.