On Rollover Fade In / Rollout Fade Out
hi i have a picture that should fade in on rollover and fade out on rollout.
i also searched the forums and tried this code:
Code: stop(); t1._alpha = 0; function fadeOut() { t1._alpha -= 5; if (t1._alpha == 0) { clearInterval(myIntervalId); } } function fadeIn() { t1._alpha += 5; if (t1._alpha >= 100) { clearInterval(myIntervalId); } } t1.onRollOut = function() { myIntervalId = setInterval(fadeOut, 50); }; t1.onRollOver = function() { myIntervalId = setInterval(fadeIn, 50); }; now it fades in and out again but after that it won't fade in again.. and its kinda "un-smooth" (maybe cuz of fps?)
thx for help nico
ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 01-12-2005, 06:25 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Quick Fade In / Fade Out On RollOver / RollOut
While taking a break from trying to figure out how to accomplish something in Flash MX 2004, I stumbled upon a site that is a perfect example of what I'm trying to do.
http://www.aperfectcircle.com
The project I'm working on has a circular navigation system with eight buttons around the circumference of the circle. The actual buttons are just symbols, so I want to have the name of the link quickly fade in above the middle of the circle when you mouseover a button, and then the name quickly fades out when the mouse leaves that button's hit area. I don't want to use tweened animation in a MC on the button's over state, because I want the fading to be totally smooth if you quickly move from one button to another, or if you move the mouse out of the hit area before it has fully faded in. I know there is a way to do this with hitstate and _alpha, but I have never used these commands before, and I can't find a very clear example of how to implement this behaviour with them.
So, in short, I need to put a script on a button, that will fade in another MC on rollover, and fade it out on rollout.
Please look at the site mentioned above to see exactly what I'm talking about, and thanks for any insight you can provide.
MC Fade On RollOver/RollOut Problem
I'm trying to fade my mc using goto actions on the timeline of the mc. The first time you rollover and then rollout, the AS works as expected. After that it appears to not execute the rollover again, but instead jumps to the rollout code. What am I doing wrong? Any help is appreciated. Thanks
MC Fade On RollOver/RollOut Problem
I'm trying to fade my mc using goto actions on the timeline of the mc. The first time you rollover and then rollout, the AS works as expected. After that it appears to not execute the rollover again, but instead jumps to the rollout code. What am I doing wrong? Any help is appreciated. Thanks
RollOver/rollOut With Text Fade Problems
I seem to be having a unique problem with my current project...
What I need to do is a simple fade in out of text beside a button when it is rolled over/off.
I searched this forum and tried many different aproaches to it. As of now I have a basic "gotoandplay" action attached to a rollOver and rollOut of the button. (As you can tell I just switched from flash 5 and miss my telltarget...)
Like so:
__________________________________________
on (rollOver) {
with (_root.PHOTOfadeinout) {
gotoAndPlay("in");
}
}
on (rollOut) {
with (_root.PHOTOfadeinout) {
gotoAndPlay("out");
}
___________________________________________
This seems to work fine is you arrow over everything SLOW, but when you just graze a button with the pointer then it tends to fade in the text but not fade it out. Or you can be on the button and once you leave it then it won't fade out the text.
Again, the action script I'm using should work, and from what I've been reading for the last hour doing it that way has been sudjested many-a-time...
What I was wondering is if there is some actionscipt that I could use that will constantly check to see if the mouse is over the button? That way it won't get "hung up" and show the Fadeinout movie unless it's supposed to.
Attached is a file of my buttons.
Thanks very much...
RollOver Button Fade In...rollOut Button Fade Out
ok, maybe this is simple but i cant get it to work....
i want to make a button (a circle) and when i roll over it a block of text or something should fade in and then stop at a fully visible state. it should wait at that state of appearance until the mouse rolls out of the button's hit area which should cause the the text block to fade out showing the button in it's normal Up state...i can't figure out what i have to do (scripting or MC wise) to make this work...please help me! thanks!
*Julie
Taking A Button And Making It Fade In And Out On Rollover And Rollout
hello,
i am trying to modify some code i have for expaning rollover buttons,
i want to use alpha to have it start at 50% transparency, then when you rollover it slowly goes to 100%... then when you roll off, it slowly goes back to 50%.
whats happens now, is that it starts at 100% transparency and just fades to nothing on rollover, the Rollout is doing nothing
This is my code so far, it invloves a button inside of a MC,
the MC code is this
onClipEvent (load) {
fade = 50;
}
onClipEvent (enterFrame) {
if (this._alpha > fade) {
this._alpha += 2;
} else if (this._alpha < fade) {
this._alpha -= 2;
}
}
the button code is this..
on (rollOver) {
fade = 130;
}
on (rollOut) {
fade = 100;
}
AS2 - Refine My Code...it Sucks : Six Clips Fade. Rollover One...other Fade Out
So I have six movie clips. When you rollover one I want the other five to fade out. this code that I did works but it has a potential to break with quick strokes. Any help would be great thanks. I also have a button surrounding the six clips that fade all back up. The reason for that is while they are going from clip to clip i dont want them to fade in a out.
------Here is a link of what im trying to acheiving.------
http://www.stellamccartney.com/us/en/beauty/
Thanks alot everyone.
------And here is my code-------
import mx.transitions.Tween;
import mx.transitions.easing.*;
function fadeOut(mc) {
var begin = 100;
var end = 25;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeOut, begin , end , time , true);
}
function fadeIn(mc) {
var begin = 25;
var end = 100;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeIn, begin , end , time , true);
}
btnOff.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by6._alpha != "100") {
fadeIn(by6);
}
};
by1.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by2.onRollOver = function() {
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by3.onRollOver = function() {
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by4.onRollOver = function() {
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by5.onRollOver = function() {
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by6.onRollOver = function() {
if (by6._alpha != "100") {
fadeIn(by6);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
};
[CS3] My Code Sucks : Six Clips Fade. Rollover One...other Fade Out
So I have six movie clips. When you rollover one I want the other five to fade out. this code that I did works but it has a potential to break with quick strokes. Any help would be great thanks. I also have a button surrounding the six clips that fade all back up. The reason for that is while they are going from clip to clip i dont want them to fade in a out.
------Here is a link of what im trying to acheiving.------
http://www.stellamccartney.com/us/en/beauty/
Thanks alot everyone.
------And here is my code-------
import mx.transitions.Tween;
import mx.transitions.easing.*;
function fadeOut(mc) {
var begin = 100;
var end = 25;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeOut, begin , end , time , true);
}
function fadeIn(mc) {
var begin = 25;
var end = 100;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeIn, begin , end , time , true);
}
btnOff.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by6._alpha != "100") {
fadeIn(by6);
}
};
by1.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by2.onRollOver = function() {
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by3.onRollOver = function() {
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by4.onRollOver = function() {
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by5.onRollOver = function() {
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by6.onRollOver = function() {
if (by6._alpha != "100") {
fadeIn(by6);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
};
Refine My Code : Six Clips Fade. Rollover One...other Fade Out
So I have six movie clips. When you rollover one I want the other five to fade out. this code that I did works but it has a potential to break with quick strokes. Any help would be great thanks. I also have a button surrounding the six clips that fade all back up. The reason for that is while they are going from clip to clip i dont want them to fade in a out.
------Here is a link of what im trying to acheiving.------
http://www.stellamccartney.com/us/en/beauty/
Thanks alot everyone.
------And here is my code-------
import mx.transitions.Tween;
import mx.transitions.easing.*;
function fadeOut(mc) {
var begin = 100;
var end = 25;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeOut, begin , end , time , true);
}
function fadeIn(mc) {
var begin = 25;
var end = 100;
var time = .1;
var myTween:Tween = new Tween(mc, "_alpha", Regular.easeIn, begin , end , time , true);
}
btnOff.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by6._alpha != "100") {
fadeIn(by6);
}
};
by1.onRollOver = function() {
if (by1._alpha != "100") {
fadeIn(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by2.onRollOver = function() {
if (by2._alpha != "100") {
fadeIn(by2);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by3.onRollOver = function() {
if (by3._alpha != "100") {
fadeIn(by3);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by4.onRollOver = function() {
if (by4._alpha != "100") {
fadeIn(by4);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by5.onRollOver = function() {
if (by5._alpha != "100") {
fadeIn(by5);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by6._alpha != "25") {
fadeOut(by6);
}
};
by6.onRollOver = function() {
if (by6._alpha != "100") {
fadeIn(by6);
}
if (by1._alpha != "25") {
fadeOut(by1);
}
if (by2._alpha != "25") {
fadeOut(by2);
}
if (by3._alpha != "25") {
fadeOut(by3);
}
if (by4._alpha != "25") {
fadeOut(by4);
}
if (by5._alpha != "25") {
fadeOut(by5);
}
};
My Fade Out / Fade In Script. Fade Out Works, Why Not Fade In? Any Ideas?
Hello all,
Hopefully this is just a simple problem with my code.
I have a container on the stage. When the loaded clip gets to the last frame it triggers the decreaseAlpha() function on the root level. This fades the current container out and works fine.
However I also want it to load the next clip(which it does) and fade that clip in. This doesn't work. It doesnt' fade in, can anyone point me in the right direction?
Thanks!!
Code:
function decreaseAlpha(boxName, clipName){
boxName.onEnterFrame = function(){
if(boxName._alpha > 0){
boxName._alpha -= 15;
}if(boxName._alpha < 5){
delete boxName.onEnterFrame;
increaseAlpha(boxName, clipName);
}
}
}
function increaseAlpha(boxName, clipName){
loadMovie(clipName, boxName);
boxName._alpha = 0;
boxName.onEnterFrame = function(){
if(boxName._alpha < 100){
boxName._alpha += 15;
}if(boxName._alpha == 100){
delete subboxName.onEnterFrame;
}
}
}
My Fade Out / Fade In Script. Fade Out Works, Why Not Fade In? Any Ideas?
Hello all,
Hopefully this is just a simple problem with my code.
I have a container on the stage. When the loaded clip gets to the last frame it triggers the decreaseAlpha() function on the root level. This fades the current container out and works fine.
However I also want it to load the next clip(which it does) and fade that clip in. This doesn't work. It doesnt' fade in, can anyone point me in the right direction?
Thanks!!
Code:
function decreaseAlpha(boxName, clipName){
boxName.onEnterFrame = function(){
if(boxName._alpha > 0){
boxName._alpha -= 15;
}if(boxName._alpha < 5){
delete boxName.onEnterFrame;
increaseAlpha(boxName, clipName);
}
}
}
function increaseAlpha(boxName, clipName){
loadMovie(clipName, boxName);
boxName._alpha = 0;
boxName.onEnterFrame = function(){
if(boxName._alpha < 100){
boxName._alpha += 15;
}if(boxName._alpha == 100){
delete subboxName.onEnterFrame;
}
}
}
Rollover Fade In Fade Out
I am building a swf and need to have a few rollovers. There will be on main picture and when you rollover the subtitles I want the picture to fade out and the new one fade in. I remember doing this years ago but dont know how for cs3.
Tanks
Button Rollout Fade
Ok, here's the problem: I'm creating a menu at work. The client wants the buttons to be 60% alpha, and switch to 100% alpha on rollover. So far so good.
The problem is that they want the alpha channel to fade back to 60% over several frames when the person rolls off the button. Since there isn't a button state for Rolloff, I can't simply drop an alpha fade movie clip in like I could with a fade in. (At least to my knowledge.)
I've tried several options so far, but none of them workover time: they simply drop the alpha down by one iteration, or back to 60% instantly. Does anyone know of an actionscript that can make a button (Or a movie clip it sits in) fade fout over time on a Rolloff action?
Sound To Fade On Rollout
I have sound attached to some buttons. ok it plays fine, but when i rollout the sound stops to abruptly it sounds terrible. How can i make it so the sound fades out for around 2 seconds instead of just stopping.
My code:
on (rollOver) {
mysound = new Sound();
mysound.attachsound("spooky");
mysound.start(0,1);
mysound.setVolume(100);
}
on (rollOut) {
mysound.stop();
}
Your help is appreciated.
Fade Button Out On RollOut
I know this seems really, really basic, but there's got to be another way to do this. I want The button to fade into a brighter color when you mouse over, then fade out (in a different way it fades in) on rollOut. I searched the tutorials on the site and I found out how to make it play backwards on rollOut, but I don't want it to do that. I want it to have a completely different animation on rollOut than rollOver. Right now I got it working, but not the way I want it to. On the "up" frame of the button, I have a movie clip fade out, and on the "over" frame I have it fade in. The only problem that this causes is when I jump to another part of the movie, the "up" animation plays again, and it looks really bad when it does because it's kind of out of nowhere.. Is there another method of having a rollOut animation other than the method I'm using? I'd really appreciate it. Thanks!
[F8] Sound Fade-out On Rollout
Hullo,
I'm currently trying to add a short sound to a button (about 2 seconds of audio), so that the sound begins playing on rollover, and then I want it to quickly fade out on rollout (If rollout occurs before the sound has reached the end as opposed to just abruptly cutting out).
Is there an easy way to do this?
Any help would be much appreciated. Thanks, and hope you had a Merry Christmas.
Dr. Cabbageface
Rollout Fade-out Not Working
Hello
I attach Movies(menu description) from the library fading them in and out.
What I like to achieve is that they fades in on Rollover, fades out on Rollout,
fades in on Release while fading out the description of last pressed, but at the same time the Rollover and Rollout effect for the description should still work.
At the moment nearly everything works except for the fade out.
Why?
PHP Code:
//import classes
import mx.transitions.Tween;
import mx.transitions.easing.*;
swfArray = new Array("page1.swf", "page2.swf", "page3.swf", "page4.swf", "page5.swf", "page6.swf", "page7.swf", "page8.swf");
var prevCon:MovieClip = this.createEmptyMovieClip("empty", this.getNextHighestDepth());
var prevCon_M:MovieClip = this.createEmptyMovieClip("empty_M", this.getNextHighestDepth());
//mcs to fade out (this with alpha 100);
prevCon._x = 100;
prevCon._y = 0;
prevCon_M._x = 45;
prevCon_M._y = 220;
var n:Number;
//memorize last pressed
function fadeTrans(myPrevClip:MovieClip, myClip:MovieClip) {
fadeOut = new Tween(myPrevClip, "_alpha", None.easeNone, 100, 0, 1, true);
fadeOut.onMotionFinished = function() {
fadeIn = new Tween(myClip, "_alpha", None.easeNone, 0, 100, 1, true);
removeMovieClip(myPrevClip);
fadeIn.onMotionFinished = function() {
for (j=1; j<=8; j++) {
_root["btn"+j].enabled = true;
}
//enable buttons
_root["btn"+n].enabled = false;
//but not last pressed
};
};
}
function fadeIn_M(myClip:MovieClip) {
new Tween(myClip, "_alpha", None.easeNone, 0, 100, 1, true);
}
function fadeOut_M(myClip:MovieClip) {
new Tween(myClip, "_alpha", None.easeNone, 100, 0, 0.5, true);
}
for (var i = 1; i<=8; i++) {
this["btn"+i].ID = i;
this["btn"+i].onRollOver = function() {
this.gotoAndStop("over");
var con_M:MovieClip = this._parent.createEmptyMovieClip("con_M"+this.ID, this._parent.getNextHighestDepth());
con_M._x = 45;
con_M._y = 220;
con_M._alpha = 0;
this.onEnterFrame = function() {
con_M.attachMovie("ITEM"+[this.ID], "ITEM"+[this.ID], 10);
fadeIn_M(con_M);
delete this.onEnterFrame;
};
};
this["btn"+i].onRollOut = this["btn"+i].onReleaseOutside=function () {
this.gotoAndStop("up");
fadeOut_M(con_M);
};
this["btn"+i].onRelease = function() {
//trace(this);
n = this.ID;
for (j=1; j<=8; j++) {
this._parent["btn"+j].enabled = false;
this._parent["btn"+j].gotoAndStop("up");
}
//disable buttons
var con:MovieClip = this._parent.createEmptyMovieClip("con"+this.ID, this._parent.getNextHighestDepth());
con._x = 100;
con._y = 0;
con._alpha = 0;
con.loadMovie(swfArray[this.ID-1]);
this.onEnterFrame = function() {
var percent:Number = Math.ceil((con.getBytesLoaded()/con.getBytesTotal())*100);
//trace(percent);
if (percent>=100) {
//after swf is loaded, do the Tween
delete this.onEnterFrame;
trace("prev= "+prevCon);
trace("con= "+con);
this.gotoAndStop("press");
fadeTrans(prevCon, con);
prevCon = con;
var con_M:MovieClip = this._parent.createEmptyMovieClip("con_M"+this.ID, this._parent.getNextHighestDepth());
con_M._x = 45;
con_M._y = 220;
con_M._alpha = 0;
this.onEnterFrame = function() {
con_M.attachMovie("ITEM"+[this.ID], "ITEM"+[this.ID], 1);
fadeTrans(prevCon_M, con_M);
prevCon_M = con_M;
delete this.onEnterFrame;
};
}
//end if
};
//end onEnterFrame
};
//end onRelease
}
//end for
Fade Sound Object On Rollout
I have a navi system that loops a number of different library sounds on(rollOver) of different buttons, which are all mc's. the client wanted the buttons to loop their sound, yet this means that the only easy way to stop the sound on rollout is by using stopAllSounds but this causes the sound to stop suddenly and inteferes with a background loop that is also there. is there any way to fade the sound object out on rollout, i've seen a few sound fade things but they seem to be overly complex for what i need. i suppose a generic fade() function would do the trick, a bit of guidance as to how i could approach this would be much appreciated.
Thanks.
Fade Sound Object On Rollout
I have a navi system that loops a number of different library sounds on(rollOver) of different buttons, which are all mc's. the client wanted the buttons to loop their sound, yet this means that the only easy way to stop the sound on rollout is by using stopAllSounds but this causes the sound to stop suddenly and inteferes with a background loop that is also there. is there any way to fade the sound object out on rollout, i've seen a few sound fade things but they seem to be overly complex for what i need. i suppose a generic fade() function would do the trick, a bit of guidance as to how i could approach this would be much appreciated.
Thanks.
Alpha Fade In, Tint Fade In And Then Fade Out
Just wondering, do u guys usually use actionscript to do alpha and tint fade? or just use the propeties tween control?
i heard that using actionscript will be better as it will not lag if the user's computer is slow....
here is to get a better idea what i'm trying to achieve using tweening
http://h-y-p-h-e-n-s.net/main.swf
To Alpha fade in, white tint fade in and then fade out white tint to original state.
I knoww how to script the alpha fade in but i have problem with the tint fade. I also have read through every line of http://actionscript.org/tutorials/ad...de/index.shtml
but i just don't know how to go about implementing it to my case.
i will really appreciate it if u can help enlighten me
Alpha Fade In, Tint Fade In And Then Fade Out
Just wondering, do u guys usually use actionscript to do alpha and tint fade? or just use the propeties tween control?
i heard that using actionscript will be better as it will not lag if the user's computer is slow....
here is to get a better idea what i'm trying to achieve using tweening
http://h-y-p-h-e-n-s.net/main.swf
To Alpha fade in, white tint fade in and then fade out white tint to original state.
I knoww how to script the alpha fade in but i have problem with the tint fade. I also have read through every line of http://actionscript.org/tutorials/ad...de/index.shtml
but i just don't know how to go about implementing it to my case.
i will really appreciate it if u can help enlighten me
Alpha Fade In, Tint Fade In And Then Fade Out
Last edited by PixelSense : 2004-02-01 at 01:54.
Just wondering, do u guys usually use actionscript to do alpha and tint fade? or just use the propeties tween control?
i heard that using actionscript will be better as it will not lag if the user's computer is slow....
here is to get a better idea what i'm trying to achieve using tweening
http://h-y-p-h-e-n-s.net/main.swf
To Alpha fade in, white tint fade in and then fade out white tint to original state.
I knoww how to script the alpha fade in but i have problem with the tint fade. I also have read through every line of http://actionscript.org/tutorials/ad...de/index.shtml
but i just don't know how to go about implementing it to my case.
i will really appreciate it if u can help enlighten me
How Do I Do This Fade Rollover?
Hi. I found this fade rollover button on a tute page, but can't a) find it again and b) work out how it's done.
I tried emailing the author but I think he's disappeared.
http://www.jamesgladwin.com/Pages/mo..._rollover.html
Thanks - Summer
Rollover Fade
Does anyone know how to do this rollOver effect?
http://www.museum.wa.gov.au/default...Sheet=perth.css
Enter flash site and look at the rollOver buttons. I have the bar moving over each button but can't get it to fade out.
See attached.
Any ideas?
Thanks.
Rollover Fade
Does anyone know how to do this rollOver effect?
http://www.museum.wa.gov.au/default...Sheet=perth.css
Enter flash site and look at the rollOver buttons. I have the bar moving over each button but can't get it to fade out.
See attached.
Any ideas?
Thanks.
Fade In On Rollover
I need my picture to fade in on the rollover of a button. Here's my script
ActionScript Code:
on (rollOver) {
if (a_mc._alpha < 100) {
a_mc._alpha=100;
}
}
It did not work when i put _alpha++; b/c I think the code just play's through once
anyone know how I can fade in my pic on the rollover of a button?
Sandman9
Rollover Fade Out
I'm trying to get an effect when you roll off of a button, which has a movie clip in the over state, the button fades back to the over state. Check out
http://juniatwork.mrtio.com/[/url]
the buttons used at the top of the page. Not the best example, but i like how when you roll off of them, no matter where you are, they just fade out rather than abruptly stopping. I don't know really anything about actionscripting, so please be gentle with your wording if that is what i need to do to get this effect. thanks for any help..
Fade Away On Rollover...
This should be an easy one, hope I'm asking this in the right place...
I saw a movie where there were little squares covering the whole screen, and when your mouse comes within a certain distance of a given square it fades away, never to return. Eventually you're revealling an image beneath all the squares.
I did some searching but had little luck finding a thread on this. Anyone point me in the right direction?
Thanks in advance.
bc1 ... this is my first post.
Rollover Fade In Problem
i cant figure how to make my buttons fade into different colors when rolled over. for example: the buttons color is black, when mouse goes over it fades in white. please help!
Fade In Graphics On Rollover
this should be a simple script. what i need is a loop to fade in a graphic (this will be repeated to fade in 15 different images by mousing over them)
here's the basic code:
on (rollOver) {
setProperty("movie 1", _alpha, "100");
}
i'm hoping to keep a "for" loop (or whichever type is best) inside this on (rollOver) command.
i rember somthing about 1++ to go through the steps. also, 5 steps from _alpha=0 to _alpha=100 should work just fine.
tia
Fade Out A Button On Rollover
Hi buddies.
Im trying to fade out a button with actionscript on rollover. I don't know how to do that.
It's just a button. No MC.
Any ideas?
I need help please!
Thanks a lot in advance guys
How Do I ... Rollover Button... Fade Off
Quick question ...
I have made a button which fades on, when you rollover it... but what I would like to know is how to make it fade out ... with or without the cursor over the button... essentially this is a mini button which activates a movie clip with a photograph... and I would like have the button be fluid... rather than have it just blip off when the mouse cursor shifts off of the button...
any help would be greatly appreciated..
you can reach me at this alternate email address...for any answers you might have or come up with...
ceo@derelictdesigns.com
thank you.
[F8] Actionscript - Fade - Rollover
Here is what I have so far.
I am new to Flash but do a decent amount of php and xml.
This shows the images but they do not fade in and I can't get rollovers to work.
Goal:
to get each image to fade in individually
to enable a rollover for each image
xml_data = new XML();
xml_data.ignoreWhite = true;
xml_data.onLoad = load_xml;
xml_data.load("xml/myspace.xml");
function load_xml(loaded) {
if (loaded) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
} else {
content = "file not loaded!";
}
/* VARIABLES */
mod = 4;
x_start = 5;
x_jump = 90;
y_start = -49;
y_jump = 54;
for (i=0; i<total; i++) {
img_sml = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
img_lrg = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
if(i==0) { iy = y_start; }
if(i%mod==0) { iy += y_jump; ix = x_jump-(x_jump*2) + x_start; ix += x_jump; }
else { ix += x_jump; }
//trace(ix+" x "+iy);
_root.attachMovie("photo","photo"+i, i, {_x:ix, _y:iy});
eval("photo"+i)._alpha = 100; // Set alpha to 100 to see images
eval("photo"+i)._xscale = (eval("photo"+i)._xscale/1.5);
eval("photo"+i)._yscale = (eval("photo"+i)._yscale/1.5);
eval("photo"+i).loadMovie(img_sml, "photo"+i);
// Not working.. ?
if(eval("photo"+i)._alpha<100) {trace("alpah"+i+"= "+eval("photo"+i)._alpha); eval("photo"+i)._alpha += 2; }
else { eval("photo"+i)._alpha = 100; }
// Checking x,y placement
//trace(eval("photo"+i)._x +" x "+ eval("photo"+i)._y);
// Not working...
eval("photo"+i).onRollOver = function() { trace("HERE"); }
}
}
*** XML
<?xml version="1.0" encoding="iso-8859-1"?>
<node>
<image>
<thumb>images/img_photos/img_thumb/100005928.jpg</thumb>
<lrg>images/img_photos/img_lrg/100005928.jpg</lrg>
</image>
<image>
<thumb>images/img_photos/img_thumb/100303208.jpg</thumb>
<lrg>images/img_photos/img_lrg/100303208.jpg</lrg>
</image>
<image>
<thumb>images/img_photos/img_thumb/102791648.jpg</thumb>
<lrg>images/img_photos/img_lrg/102791648.jpg</lrg>
</image>
<image>
<thumb>images/img_photos/img_thumb/104448404.jpg</thumb>
<lrg>images/img_photos/img_lrg/104448404.jpg</lrg>
</image>
</node>
Any help getting on the right track is appreciated.
Jon
Fade Up Pic On Text Rollover
I have a menu across the top of the page and need to have a photo elsewhere in the page fade up when a menu item is rolled over.
The way I have been doing this has been bogging things down significantly, I think and I'm hoping someone can give me an alternate method.
Here's the code I currently have on each movie clip (containing a photo) that needs to fade up or down based upon what nav item is rolled over:
onClipEvent(Load) {this._alpha = 0; //initialize photo to hidden} //end on Load
onClipEvent(enterFrame) {
if (_root.navItem == "Tab1") { //check to see if mouse is over tabif (this._alpha < 100) { //fade up
this._alpha = this._alpha + 20;
} //end fade up } else { //if mouse not over tabif (this._alpha > 0 ) { //fade out if necessary
this._alpha = this._alpha - 20;
} // end fade out } //end if mouse
} //end enterFrame
I was wondering if there is, for example, code I could put on the tab itself to only fire the movie clip fade when the tab is rolled over, instead of having the movie clip itself check constantly. Some sort of "while the mouse is over the movie clip, fade up, else fade out" kind of thing.
TIA,
Carolyn
Make A Mc Fade In On Rollover
I am trying to make a mc fade in on rollover. So far I have this but it seems to do it all at once.
Code:
for (i=0; i>= 100; i++){
b1_btn._alpha = i;
}
Can Someone Please Help Rollover Fade In/out Issues
Hello everyone. I am new to these forums and would greatly appreciate help on this one. I lifted some script from another post here and have tried to format it to my needs. Here's what needs to happen. On rollover a movieclip must fade in, wait, and then fade out. When I attach the script below to the movie clip this all happens correctly.
BUT subsequent rollovers must continue fade in (if currently fading in), fade back in (if currently fading out), or reset pause duration (if currently waiting). Any help will recieve a verbal reward for helping me retain my sanity.
ActionScript Code:
mc.onRollOver = function() {
status = 0;
variation = 2;
function inc_alpha() {
if (mc._alpha<100) {
mc._alpha += variation;
}
}
setInterval(inc_alpha, 10);
function wait() {
if (mc._alpha>=100) {
status += 1;
}
}
setInterval(wait, 100);
function dec_alpha() {
if (status == 1) {
if (mc._alpha>0) {
mc._alpha -= variation;
}
}
}
setInterval(dec_alpha, 10);
};
Fade Images On Rollover
i am pretty new to flash (last night at about 11:00 pm) and need to know how to "fade" images in when. i don't know the lingo yet so here is a site that shows what i am talking about.
http://www.timtadder.com/index3.html
rollover the images on bottom right and see how the large images "fades" in. i have everything else (the thumbnails and large image) from a tutorial already set up. just need to know how to add the fade. and i do not want it as a slideshow.
thank you
Alpha Fade On Rollover
wow, i think this is like the 5th time i'm asking this question, no one could help-
ok, i'll ask it differently this time. I just want the button to fade out on rollover. at the same time, i would like text (that is loaded externally in a text field called "caption") to fade in also on rollover.
i've tried sooooo many things - scavenging this board and others.
suggestions pleasepleaseplease thanks!
Alpha Fade On Rollover
wow, i think this is like the 5th time i'm asking this question, no one could help-
ok, i'll ask it differently this time. I just want the button to fade out on rollover. at the same time, i would like text (that is loaded externally in a text field called "caption") to fade in also on rollover.
i've tried sooooo many things - scavenging this board and others.
suggestions pleasepleaseplease thanks!
Fade Alpha Of Mc With RollOver
Hey shockers,
Im trying to achieve an effect like this . Down the bottom where the two sections are low alpha until rollover, then the sections go to high alpha etc.
I tried the on(rollOver){
_root.mcName._alpha = 100;
This did change the alpha but the clip contains input boxes that I now cant use, plus I get the hand cursor.
Any help or direction of tuts appreciated
Fade Between Images On Rollover.
Hi guys,
I was hoping someone may be able to help me with this :-)
I have a thumbnail gallery that is populated by an XML file which is working fine but I want the thumbnails to fade to colour when you roll over them and stay coloured when selected.
Time is really of the essence with this one!!
so if anyone can point me in the right direction you would really help me from scrambling in around banging my head against a brick wall I'd really appreciate it.
Here's the XML
ActionScript Code:
<project client="Client" projName="Project02" year="2001" movPath="0">
<images>
<image path="projects/imgs/project02_01.jpg" thumbCol="project_2_work_thumb_col_01.jpg" thumbBw="project_2_work_thumb_bw_01.jpg"/>
<image path="projects/imgs/project02_02.jpg" thumbCol="project_2_work_thumb_col_02.jpg" thumbBw="project_2_work_thumb_bw_02.jpg"/>
<image path="projects/imgs/project02_03.jpg" thumbCol="project_2_work_thumb_col_03.jpg" thumbBw="project_2_work_thumb_bw_03.jpg"/>
<image path="projects/imgs/project02_04.jpg" thumbCol="project_2_work_thumb_col_04.jpg" thumbBw="project_2_work_thumb_bw_04.jpg"/>
<image path="projects/imgs/project02_05.jpg" thumbCol="project_2_work_thumb_col_05.jpg" thumbBw="project_2_work_thumb_bw_05.jpg"/>
<image path="projects/imgs/project02_06.jpg" thumbCol="project_2_work_thumb_col_06.jpg" thumbBw="project_2_work_thumb_bw_06.jpg"/>
</images>
<gallery>
<image title="Project02" main="images/project02_01.jpg" thmb="thumbnails/project_2_work_thumb_col_01.jpg" bw="thumbnails/project_2_work_thumb_bw_01.jpg"/>
<image title="Project02" main="images/project02_02.jpg" thmb="thumbnails/project_2_work_thumb_col_02.jpg" bw="thumbnails/project_2_work_thumb_bw_02.jpg"/>
<image title="Project02" main="images/project02_03.jpg" thmb="thumbnails/project_2_work_thumb_col_03.jpg" bw="thumbnails/project_2_work_thumb_bw_03.jpg"/>
<image title="Project02" main="images/project02_04.jpg" thmb="thumbnails/project_2_work_thumb_col_04.jpg" bw="thumbnails/project_2_work_thumb_bw_04.jpg"/>
<image title="Project02" main="images/project02_05.jpg" thmb="thumbnails/project_2_work_thumb_col_05.jpg" bw="thumbnails/project_2_work_thumb_bw_05.jpg"/>
<image title="Project02" main="images/project02_06.jpg" thmb="thumbnails/project_2_work_thumb_col_06.jpg" bw="thumbnails/project_2_work_thumb_bw_06.jpg"/>
</gallery>
<projectInfo imgPath="projects/imgs/project02_info.jpg">
<summary><![CDATALorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud.]]></summary>
</projectInfo>
</project>
and here is the actionscript.
ActionScript Code:
MyXML = new XML();
MyXML.ignoreWhite = true;
MyXML.onLoad = function(success) {
numimages = this.firstChild.firstChild.nextSibling.childNodes.length;
spacing = 44;
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.firstChild.nextSibling.childNodes[i];
this.thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._y = i*spacing;
this.thumbHolder._x = 0;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
this.thumbLoader.loadMovie(this.picHolder.attributes.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
this.thumbHolder.onRelease = function() {
loader.loadMovie(this.main);
title_txt.text = this.title;
};
}
};
MyXML.load("xml_example.xml");
Thanks in advance for any help or pointers guys.
Cheers.
Actionscript To Load Random External Movie, Fade In, Wait, Fade Out, Repeat
Hello,
I'm trying to construct some AS3 that will load a random one of several external swf files, fade the instance in, wait 5 seconds, fade the instance out, and load a new random movie (it can be the same one; I don't want to get too complicated at this point).
I could do this with no problem using older methods, but the client insists this is written in 3.
Please help; I'm at my wits end!
Newbie Question - Fade In Fade Out While Trning On And Turning Off A Music Loop
Hello everyone,
This is what I want to accomplish. I want to make my music loop fade in when turning on and fade out while turning off. I'm attaching the .fla of what I have now.
Currently the music loop stops abruptly when the pause button is clicked and starts suddenly when the play button is clicked. I want to smooth this action out and make it fade in when play button clicked fade out when pause button clicked. Hope you got my point.
I have added my sample .fla to show how have I added the music loop and the buttons.
Have this chunk of action script in it to load the music loop and play it infinitely.
PHP Code:
mySound = new Sound();
mySound.attachSound("myloop");
mySound.start("0", "999");
This bit on the puse button with an instance name pauseBTN
PHP Code:
on (release) {
mySound.stop();
playing = false;
playBTN._visible = true;
pauseBTN._visible = false;
}
and this bit on to the play button with an instance name playBTN
PHP Code:
on (release) {
if (playing != true) {
mySound.start(0, 999);
playing = true;
playBTN._visible = false;
pauseBTN._visible = true;
}
}
Please find my attachment here:
Thanks in advance
Multiple Fade In Fade Out Events On Different Sentences From A Text File?
Hi there
i've just learned to use flash to produce a flash doc that displays the tibetan mind training slogans. they're basically 59 sentences: be a child of illusion, always maintain a joyful state of mind etc etc.
anyway, i'm wondering if anyone knows how i can make it easier to achieve this. at present i've done it by creating individual fade in fade out events along a time line. but it strikes me that it should be possible to create just one fade in, fade out event and get flash to apply this event to all subsequent sentences. even better would be if i could just get flash to pull each sentence from a plain text file. does anyone know how to do this? maybe actionscript can do this. then it would be easy to create a flash file for learning anything from vocabulary to history quotes!
you can view it here:
http://www.geocities.com/tamsin_dev...saverfinal7.swf
here's the flash file
http://www.geocities.com/tamsin_dev...saverfinal7.fla
also, how can introduce a random element into this, so that any of the 59 slogans will be picked.
if you need any further info please contact me at tamsin_devas@yahoo.co.uk i can send you the slogan source files as well if you want.
eventually i want to create a screen saver.
thanks for any help you can provide. i'll write your name in tibetan if you want.
tamsin
Image Fade In & Out With Mouse Rollover
I'm trying to have images in my movie fade in when the mouse rollsover and the fade out when the mouse rolls out. I'm seeing alot of neat stuff with this effect.
example site.
http://www.wddg.com
Fade In/out Rollover Effect Problem
I have around 50 buttons in a swf, and I wanna make those rollover effects that leave a tray behind, so I used this script:
on (rollOver) {
setProperty("_root.fadein", _x, "12.9");
setProperty("_root.fadein", _y, "72.3");
_root.fadein.gotoAndPlay(2);
}
on (rollOut) {
setProperty("_root.fadein", _x, "-425.9");
setProperty("_root.fadein", _y, "28.5");
setProperty("_root.fadeout", _x, "12.9");
setProperty("_root.fadeout", _y, "72.3");
_root.fadeout.gotoAndPlay(2);
}
the fadein is a movie that gives the innitial effect, the fadeout movie leaves a tray, that desapears.
the problem is that the tray effect resumes only to two links, on the third passage the first one interrupts.
does anyone know a simple and effective actionscript???
any help welcome.
thanks in.advance
Rollover Fade In/out And Loader Problems
Hello.
I am currently making a website for my wife and her artwork, but I have run into a few snags in the actionscript department. This website is my first real attempt at making a functional flash site, so I am fairly new to most of the programming involved. Have had many many years of experience with HTML and CSS though.
Our problem is this:
We have a set of thumbnails in a grid, that on rollover, begin playing a 10 frame mc that plays from 50% opacity at frame 1 to 100% opacity at frame 5. On rollout, it plays from frame 5-10 which does the same as what I just explained but in reverse so it reverts back to its 50% opacity state.
The rollover code is:
PHP Code:
on (rollOver) {
_root.thumbholder.elephantmov.play();
}
on (rollOut) {
_root.thumbholder.elephantmov.play();
}
The scripting per frame in the timeline of the fading thumbnail movieclip, is to stop at frame 1, 5, and gotoandplay (1) on the tenth frame.
Now, it all works, but the problem is that when one moves the mouse beyond the borders of the thumnail too quickly, the movie stops at 100% opacity, when we want it to always be at 50% opacity in the rollout state. Can anyone come with a recommendation to alter the code so that this will be possible?
And also, is there somehow to make a movie stop loading the rest of the movie at a specific frame? The site we are making features a language choice at the first frame, and we don't want the loading to begin until the appropriate flag has been clicked, and the preloader starts.
Thanks a lot in advance for any help. Would be much appreciated.
On Rollover Fade Dyn. Created Textfields?
Hi all,
Trying to make my dynamic created textfields fade with an onRollOver.
I know the basics i.e. Dyn.
1 -Textfield in a MC and
2 - embed the fonts
So here is a part of my AS
ActionScript Code:
for (child = 3; child < count; child++) {
//mc's holders for the dyn textfields
holder = _root.createEmptyMovieClip ("mcLocationHolder" + child, 10 + child);
.....
.....
.....
//here my dynamic textfields
_root.holder.createTextField (["location" + child], 200 + child, 0, (67.5 * position + 20), 301, 47.5);
with (_root.holder["location" + child]) {
//some format code
multiline = true;
wordWrap = true;
.....
....
}
//onrollover fade FX per holder
_root.holder["location" + child]._alpha = 100;
_root.holder["location" + child].onRollOver = function () {
_root.holder["location" + child]._alpha -= 5;
if (_root.holder["location" + child]._alpha <= 0) {
delete _root.holder["location" + child].onRollOver;
}
};
I have embed the font by New font and linkage.
You guessed it, it ain't working. Any tips???
PS i see my textfield react on
ActionScript Code:
_root.holder["location" + child]._alpha = 100;
when i put embedFonts = true in my with () state
But the onrollover function doesn't work ;(
Grtz,
Horizontal Menu Fade In And Out On Rollover
Guys i have this menu that gets the number of buttons and subbuttons depending on the xml file. it attaches the buttons to an empty movie click. the same's happening to the subbuttons - they get attached to a different empty mc. everything works fine there. My question is how do make the subbutons in that mc to fade in on rollOver of a button one by one and then fade out again one by one on rollOut. I will probably need to set up some sort of a loop. just having a hard time on where to start. Can somebody sort of push me in the right direction? here are the fla and the xml files. Thanks guys.
[edit]bump..why can't we upload fla's anymore?
i know this is a lot to ask but the AS is attached in a txt file for anybody who can help
[/edit]
|