Flash Alpha & Motion Tween
- Started
- Last post
- 28 Responses
- steadyvibe
help! i got this code from Ultrashock and spent most of yesterday staring at it and tweaking it to be what i need it to be. I have a menu that drops down when you roll over a moveclip, but the one this i can figure out is how to make the menu fade it when it drops down and fade back when it goes up.
Any suggestions?
The code for the menus is in the next post>>
- steadyvibe0
// -- function that opens the subsection on rollover
}
function openSubs(target) {
for (i=0; i
- steadyvibe0
Weird it cuts off half of my code when i post it???
- steadyvibe0
// -- function that opens the subsection on rollover
}
function openSubs(target) {
for (i=0; i < this[target].subs.length; i++) {
subMenuCounter = 0;
this[target]["sub"+i].button.new... = this[target]["sub"+i].button.out...
currentOpen = target;
}
}
// -- close subsections function
function closeSubs(target) {
for (i=0; i < this[target].subs.length; i++) {
this[target]["sub"+i].button.new... = this[target]["sub"+i].button.oYp...}
}
- arlo0
You just gotta change the alpha from 0 to 100 on the fade in gradually, and then 100 to 0 on the fadeout. I'm not sure how these functions are applied in the movie itself so I can't really just revise the functions for you.
- steadyvibe0
what code might i used to tween the aplha as it is moving dynamically up and down?
- Mr_Jump0
Can't u just motion tween the alpha values and have the movie clip go to that frame when the menu reaches a certain point? I know it's dirty coding but i'm not really sure how u got the whole thing set up.
- steadyvibe0
should i post my FLA?
- Mr_Jump0
Yes, that might be best. Also, u tried the Were-here forums? Those guyz over there are action script wizards (no disrespect to the NT lot).
- JamesEngage0
can't you take the distance that the dropdowns elements are from the toolbar and use that to set the _alpha?
- steadyvibe0
You can see now why i might want to hide the sub menu when its not rolled over.. i can figure out how to hide the sub menu!!!
- steadyvibe0
maybe this code is just way over my head??
- Mr_Jump0
Sorry, this code is way over my head to. I'm sure there's a simpler work around. And i'm no actionscript wiz, but i don't think u can get it to gradually fade the menu. _alpha properties an absolute value u'll have to animate by moving through frames. U cud put an if value in there and get it to go between frames to gradually change the alpha.
- steadyvibe0
Yeah but there has got to be a way to make it fade as it comes out and fade back when it goies back?? it seems so simple??
I need unfittoprints help! Hes a flash god.
- unfittoprint0
//FADE PROTOTYPE
//looped function
MovieClip.prototype.changeAlpha = function(targetalpha) {
this._alpha += (targetalpha-this._alpha)/4;
if (Math.abs(targetalpha-this._alph...
- unfittoprint0
_______________ < again ...
//FADE PROTOTYPE
//looped function
MovieClip.prototype.changeAlpha = function(targetalpha) {
this._alpha += (targetalpha-this._alpha)/4;
if (Math.abs(targetalpha-this._alph...
- unfittoprint0
fuck.
- steadyvibe0
Where in my code would i want to put this?
- steadyvibe0
FUCK?
- unfittoprint0
yeah, NT's fucking HTML filter___
sURreAl________________anyWaY....
http://www.anarchitecture.net/fa…