I am dynamically loading images into a blank movie file. I would like if the images fade in as they load.
Remark, I am not using a slide show effect. All i would like to do is load image and make it fade in. When the user clicks to go to the next frame the image should fade out.
How to do this?
um, you can’t really fade them in while they’re loading, since the entire image would have to be loaded in order to “fade”. so what you can do is fade it in once it’s loaded. load the image in a movieclip, then just fade in the movieclip:
onClipEvent (load) {
_alpha = 0;
}
onClipEvent (enterFrame) {
if (_alpha < 100) {
_alpha++; //same as _alpha = _alpha+1;
}
after you finish downloading the images (note: its not the same as the load movie command.) I repeat AFTER your images are loaded then you could do something like this:
[AS]
movieClip.onRollover = function () {
this.onEnterFrame = function() {
this._alpha+=10;
}
}[/AS]
hope this helps.
thanks a ton guys! thios really helped
im not sure if this would work or not but its just a thought…
you could have some sort of preloader…a super basic one…using the getBytesLoaded & getBytesTotal of the movieclip the images are being loaded into…an once it was loaded…you could set the alpha of the movieclip to 0 and then use the enterframe stuff some one said above…
does that make sense? i think thats what the guy above said, but i wasnt sure…maybe this is just a repeat post…or maybe it will give a lil more light as to what to do
I used the above onRollover with an onRollout, how do I get it to work after more than one rollover/out?
thx
Hello dezynr, can you post your code?
shape5.onRollover = function () {
this.onEnterFrame = function() {
this._alpha-=10;
}
}
shape5.onRollout = function () {
this.onEnterFrame = function() {
this._alpha+=10;
}
}
This only lets you rollover it once. How do I change that?
And can I us onRelease to make it a button? If so, can you show that code too?
Thanks so much.
I know I can do this fade with tween but I 'm determined I’m going to learn Actionscript. :thumb:
I was hoping someone knew the answer to this. Oh well, I’ll figure it out someday. :q:
shape5.onEnterFrame = function() {
this.onRollOver = function () {
this.alpha = 100;
}
this.onRollOut = function () {
this.alpha = 0
}
this._alpha += (this.alpha - this._alpha)/10 // instead of 10 you can put other number (lower the number is, faster the animation is)
}