Hi everyone,
I’m only just learning Actionscript, and have come up with a piece of code that I want to get working.
On my main timeline I have a movieclip with an instance called “eye”. What I would like to happen if for a random number to be generated and assigned to “blink”. If blink = 20 then I want to play "eye"s animation. This is the code I have so far:
You could use an onEnterFrame handler…
[AS]eye.onEnterFrame = function() {
var blink = Math.floor(Math.random()*20);
if (!blink) {
this.play();
}
};[/AS]
I thought to myself during the day it would probably make more sence to place the actionscript on the MC.
What would the up to date code of [M]'s code be? I’m trying to learn actionscript so an explanation of whats happening in the code would be very helpful! (I avoid cutting and pasting code, wont help me learn.)
I tried using this code in the movie clip but it told me I can only use the onClipEvent on a movie clip instance.
I put this code in a movie clip symbol.
What am I doing wrong?