Hi I am trying to fade in an image using actionscript,
this is the code i have,
speed = 10;
image.onEnterFrame = function(){
this._alpha>=100 ? this._alpha-=speed : delete this.onEnterFrame;
}
I’ve set the image on stage to alpha 0, i run this movie but nothing seems to happen, i’ve given the movie clip name an instance name of image.
can someone help?
try this:
var speed = 10;
image.onEnterFrame = function() {
(this._alpha<=100) ? this._alpha+=speed : delete this.onEnterFrame;
}
hey… I’ve seen that so often, but never known the name of that conditional statement… what’s it called?
Mee tooo! I need to know this one as well!
well, go right to the source.
anyways its the same as going:
var speed = 10;
image.onEnterFrame = function() {
if(this._alpha<=100) {
this._alpha+=speed
} else {
delete this.onEnterFrame;
}
}
oh thanks… I never read to the bottom of that page the last time I saw it :lol:
