I have a little problem with a flash movie. I want to create a sort of dropdown menu, and have used, woth on release visible true, and stuff. It works fine now, but then i found out that i wanted it to fade up, instead of just showing up suddenly. Is there an AS soloution to this? When i press the gallery button, the submenu fades up, and when i press another button, the previous will fade down, and a new submenu will fade up…
Well, i mean that the submenu should turn from Alpha 0% to Alpha 100% in about 5 frames, when i press the gallery button…So my question was, if i could use AS, to do that, or i need to animate it…
okay, thanks for the modified flash, and thanks for all the help. That was really useful
But i have another problem now. i tried to make the submenu fade out, when i press one of the other buttons, and i think i need to change the code to the opposite numbers when i need it to fade out. But that wouldnt work, so i hoped that you could help me with this one too.
I have updated the links at my first post, in case you feel like do it for me :trout:
*Originally posted by Phat7 *
**Voets, this MC.prototype thing, is it like defining a function or what is it? **
It is a function I’m defining in the prototype object of the MovieClip constructor, which you can see as “Shared Documents” for movieclips. If you place something in a constructors prototype, every instance created through that constructor has access to it.
Since MovieClip is the contructor function of the movieclip class (try trace(MovieClip)), I place that function in it’s prototype object. Therefore, every movieclip has access to that function, which will be a method since it’s assigned to an object (the prototype object).
I have a new fade problem now. I found out that the fade/hide effect worked great with buttons, but not so great with bigger stuff. So instead im using the _root.myclipholder.loadMovie(“something.swf”) script. The question is now, that can this be combined with the fade effect? Like when its loaded, then it needs to go from alpha=0 to alpha=100 in about ten frames?
not tested, try:
[AS]_root.myclipholder.loadMovie(“something.swf”);
l = _root.myclipholder.getBytesLoaded();
t = _root.myclipholder.getBytesTotal();
_root.myclipholder.onEnterFrame = function() {
if (t>0 && t == l) {
this.fadeIn(100, 10);
//where fadeIn the prototype is Voetsjoeba gave you
} else {
trace(l/t);
}
};
[/AS]
Scotty – You have to update the bytes loaded Like this:
myclipholder.loadMovie("something.swf");
myclipholder.onEnterFrame = function() {
l = this.getBytesLoaded();
t = this.getBytesTotal();
if (t>0 && t == l) {
this.fadeIn(100, 10);
//where fadeIn the prototype is Voetsjoeba gave you
} else {
trace(l/t);
}
};
You should get the bytes total within the [font=courier new]onEnterFrame[/font] handler too. If you store the value immediately after you call the [font=courier new]MovieClip.loadMovie()[/font] method, you might get 0 or -1.