Fade Out MC With Actionscript Function
Hello,
could someone send me a function which fades out a MC? I use FlashMX. I can't use any component and i need to use a function because i can only use one frame. I tryied to created it but until now i had no success.
Thanks, Miguel
FlashKit > Flash Help > Flash MX
Posted on: 09-24-2002, 12:40 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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!
Actionscript To Fade In/fade Out Picture Depending On Frame?
I've searched the board but I can't figure out the answer to my question. I just want to fade in/out a movieclip. I can do this with tweens, but I'm really interested in how this would be done with actionscript.
How could I make it so that the fade in occurs with frames 1-15, stops, and then starting with 16 fades out?
I do have some code that will import a picture into a movieclip and fade it in, but I'm not sure how to alter the code so that the pic fades out on frame 16. The code below is fairly detailed... I would not mind a basic solution!!
Thanks for your help!
PHP Code:
init = function () {
this.myContainer = this.createEmptyMovieClip("cont", 1);
cont._x = 0;
cont._y = 130;
this.myContainer._alpha = 0;
this.myContainer.loadMovie("picture.jpg");
this.preloadJpg();
};
preloadJpg = function() {
this.onEnterFrame = function() {
if (this.myContainer.getBytesLoaded()>100 && this.myContainer.getBytesLoaded()>=this.myContainer.getBytesTotal()) {
this.fadePicIn();
}
};
};
fadePicIn = function() {
if(this.myContainer._alpha < 100){
this.myContainer._alpha += 10;
} else {
this.onEnterFrame = undefined;
}
}
this.init();
Help With Content Fade In/fade Out Button Actionscript
Hello to all you people who are far, far more clever than me!
I've been searching the discussion pages for the answer to this, and I've found a few posts that are similar, but because the problems are just slightly different from mine I just don't understand what is going on. I've tried looking in the Flash MX help and that just confused me more!
I will attempt to explain my problem clearly. I have 5 buttons on the main (Scene 1) timeline. Each of these link to a different frame with different content on the main timeline (Scene 1) that is labeled and the links work fine. However, instead of clicking on the buttons and just having the old content disappear and be replaced by the new content, I would like the the old content to fade out and the new content to wipe on.
I have created the motion tweens for each content area (fade out, wipe on), but I know that somehow I am supposed to let the buttons know which button has been clicked and also which part of the timeline to play (which content to fade out and what frame to jump to to fade in). This is to do with variables and stuff but I just can't get my head around it - no matter how hard I try. I get confused with what you're supposed to label and where, and what script needs to be on the very first frame and what needs to be on each button. I know I'll get it one day... hopefully.
If you could help me it would be greatly appreciated, or if this question has already been answered could you please direct me to that post?
Thanking you in advance.
Baffled: Fade In Fade Out Function
this code is so not working, am i missing something very subtle?
all it does is fade in and out an object when you roll over it.
_root.block2.tn.onRollOver= function(){
glow = true
}
_root.block2.tn.onRollOut=function(){
glow = false
}
if(glow == true){
fadein(block2.tn)
}else{
fadeout(block2.tn)
}
function fadein(n){
if (n._alpha<100){
n._alpha +=10
}
}
function fadeout(n){
if(n._alpha>0){
n._alpha -=10
}
}
Fade In Fade Out Pictures With Actionscript
I need a actionscript for the following problem.
load external *.jpgs with loadmovie in a movieclip. The picture fade in and fade out. Then the next picture will fade in and fade out.
In Flash MX folder samples is a tutorial called load_images.fla This tutorial works with click on the button.
What I want is that the movie play itself.
ThanXS
MC Actionscript Fade IN / Pause / Fade Out
Sorry guys but I need a refresher. I have been away obviously too long and my brain isnt functioning the way it should with actionscripting (if you dont use it... you lose it). Anyways here is my problem - did a search and cant find a simular situation.
I have Bitmap photos that I need to fade in and out of the movie. Here is the scenerio. Photo fade in (30 frames from 0-100), Pause (photo at 100%alpha) for 50 Frames , Photo fade out (30 Frames from 100-0. I need to do this with 4 consecutive images for a slide show appearance without TWEENING which is killing me on display performance. I seriously THANK YOU in advance and promise not to let my scripting slide after I get back into the swing of things again
Peace:Pazul
Fade In, Pause, Fade Out W/ Actionscript?
i've started with slideshow example from macromedia and want to spice it up a little.
is there a way to fade each of these images in pause for a few seconds and then fade out after they load in from my xml file.
here is my current script that advances between the images:
//
// Autoplay and advances through the slides at given interval
setInterval(advance, 5000);
function advance(nextSlideNode) {
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
loadMovieNum("logo2.swf", 0);
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
}
if anybody knows how to do this - it is greatly appreciated.
thanks.
Fade Function
I'm flying by the seat of my pants in flash. I want to have a series of photos fade from one to the next in the same frame. I made a movie with each one timed at 30 seconds. Instead of an abrupt change, how do make them fade into each other? Thanks
Fade Out Function
Hi there guys,
I have this code in flash (AS2)... check it out:
interior._visible = false;
back._visible = false;
function fadeout() {
onEnterFrame = function () {
this._alpha -= 10;
if (this._alpha <= 0) {
this._alpha = 0;
delete onEnterFrame;
}
}
}
gointerior.onRelease = function() {
interior._visible = true;
interior.gotoAndPlay(2);
fadeout();
};
stop();
I have a couple of movie clips in the layout, and a button called "gointerior"
The idea is that when I release that button, it fades out (the button). So I have created a function called fadeout(); but when I call that function and I test the movie all the movie fades out. I dont know what Im doing wrong. I think that is something related to the function path or something.
I need your help guys!
Fade Function ?
Hi thanks for the help with my depths problems yesterday guys . I have come across another problem im working on a projec right now just for expierance and im going to have to do a lot of fading in and out movieclips and contorls .
Well when i say a lot imean pritty much every littlecontrol . Anyway i may aswell devote some time to simplifing this process as it will pay off eventuly . So i am looking for a very simple fader function that will deturmine based on the _alpha propery of a varible weather it should be faded in or out
So if _alpha is 100 itll fade it out 0 and itll fade in so i only have to launch the function in the onx events .
Im not realy sure where to start with this i was wondering if you guys could help me out im sure this would help everyone .
Thank you
Fade In Function ?
Hi all,
I have wrote a function to fade in a movieClip, but it doesn't seem to work and I carn't see why?
I have a MC on the stage with 0 alpha and a btn to call the function.
I'm sure it's something simple.
Code:
function fadeIn(num) {
this.onEnterFrame = function() {
this._alpha += num;
if (this._alpha>=100) {
this._alpha == 100;
delete this.onEnterFrame;
}
};
}
one_btn.onRelease = function() {
one_mc.fadeIn(10);
};
Fade Function
Hi all,
I have wrote a function to fade in a movieClip, but it doesn't seem to work and I carn't see why?
I have a MC on the stage with 0 alpha and a btn to call the function.
I'm sure it's something simple.
Code:
function fadeIn(num) {
this.onEnterFrame = function() {
this._alpha += num;
if (this._alpha>=100) {
this._alpha == 100;
delete this.onEnterFrame;
}
};
}
one_btn.onRelease = function() {
one_mc.fadeIn(10);
};
Fade In Function..plz Help...:(
Hi, here's my fade in/out function, it just doesn't work, I tried the whole day today and feel so frustrated...plz help me point out my problem, why isn't it working...
I have to like click on a button couple of times before it's working, I don't know why it doesn't work when I click on it once..
I have 3 btns, red_btn, green_btn, blue_btn
and 3 clips red, green, blue
I want to make one fade in and other 2 fade out.
ActionScript Code:
red._alpha = 100;
green._alpha = 0;
blue._alpha = 0;
MovieClip.prototype.fadeOut = function(clip, targetFadeOut, fadeSpeed){
clip.onEnterFrame = function(){
clip._alpha -= fadeSpeed;
if(clip._alpha == targetFadeOut){
delete clip.enterFrame;
}
}
}
MovieClip.prototype.fadeIn = function(clip, targetFadeIn, fadeSpeed){
clip.onEnterFrame = function(){
clip._alpha += fadeSPeed;
if(clip._alpha == targetFadeIn){
delete clip.enterFrame;
}
}
}
red_btn.onRelease = function(){
fadeIn(red, 100, 10);
fadeOut(green, 0, 10);
fadeOut(blue, 0, 10);
}
green_btn.onRelease = function(){
fadeIn(green, 100, 10);
fadeOut(red, 0, 10);
fadeOut(blue, 0, 10);
}
blue_btn.onRelease = function(){
fadeIn(blue, 100, 10);
fadeOut(green, 0, 10);
fadeOut(red, 0, 10);
}
please....
My Function Isn't Functioning/Actionscript To Call A Function Flash MX 2004
Hello,
Well in theory I know how to create a function but for some reason I am unable to call it.
Can someone take a look at it and tell me what went wrong. Basically when I go to "a certain page" I want to click on a button and have it go to another page known as "pics" it then will load a jpeg there known as jpeg loader. Now I know it works properly without a functin, but because I am lazy I do not want to write more code than I have to, there are like 300 differnt jpegs I have to load. Thus I need to create a function.
here is my AS
ActionScript Code:
//this is on frame one of my root timeline
//I am trying to call the function "display" on release of my button
omnihotelButton.onRelease = display ("J010 Omni Hotel.jpg");
//this is my function that I set up it is also on my root, but on a different frame
//this function is named display and it goes to the "pics" page and stops
where it then loads a jpeg which is et up as my variable.
//the xscale and the yscale are just setting up my size of the jpeg.
function display(jpeg){
_root.gotoAndStop("pics");
jpegLoad_mc.loadMovie(jpeg);
jpegLoad_mc._xscale=90;
jpegLoad_mc._yscale=90;
}
Help With Fade-In/Fade-Out In ActionScript
Howdy! I'm fairly new to ActionScripting but have enjoyed learning it. I have a movie clip which consists of nothing more than the two words "His Nation". At one point in my movie, I need this clip to start really small (illegibly small) and completely transparent and then slowly scale larger beyond the confines of the stage, while having it's alpha increment from 0 to 100 by the time it's at a relatively normal viewing size and then have the alpha increment back from 100 to 0.
With the ActionScript below, I've solved two of my three problems:
1. I've got the movie clip starting out really small and then scaling larger past the confines of the stage.
2. I've got the movie clip starting out transparent and slowly fading in to an alpha setting of 100.
All I need now is to figure out how to script it so that once the alpha reaches 100, it will then slowly decrement back to 0.
Also, as a side note, does my script actually stop the movie clip from scaling larger at all? It seems to keep on growing no matter what setting I put it at.
I know that I'm missing something rather simple, but any and all help will be greatly appreciated. Thanks in advance! Here's the script as it now stands:
onClipEvent(load){
scalecount=0;
alphacount=0;
}
onClipEvent(enterFrame){
do{
setProperty(hisnation,_xscale,scalecount);
setProperty(hisnation,_yscale,scalecount);
setProperty(hisnation,_alpha,alphacount);
alphacount=alphacount+.5;
scalecount=scalecount+3;
}while(scalecount<100);
}
Actionscript Fade In Then Fade Out...
I have this code on an MC and it doesn't quite work. I want the MC to fade in to 100% and then fade out back to 0%.
Here is the code:
onClipEvent(load){
_root.sparkle._alpha = 0
var myAlpha = _root.sparkle._alpha;
var myAlphaFlag = false;
}
onClipEvent(enterFrame){
// fade in the correct direction
if (myAlphaFlag<> true) {
if(_root.sparkle._alpha <100) {
//change this to speed/slow rate
_root.sparkle._alpha += 20;
}
} else {
if(_root.sparkle._alpha > 0) {
//change this to speed/slow rate
_root.sparkle._alpha -= 20;
}
}
// set the flag if it needs it
if (myAlpha = 100) {
myAlphaFlag = true;
}
if (myAlpha = 0) {
myAlphaFlag = false;
}
}
Fade In/Fade Out With Actionscript
Please I need your help!
I am making a presetation and I would like to know How to Fade In and Fade outa Text after a 8 seconds (there is a speech background). Should I convert these texts as a movieClip and Could you guys help me with the code!
Thanks!
Ricardo
[CS3] Fade In / Fade Out Using Actionscript
Hi there,
I am having trouble trying to get a simple fade-in fade-out effect which i want.
I have a main timeline.
On that main time line, i have a movie.
This movie contains 4 static frames -all with a stop(); on each. Each frame also has a forward and backward button which navigates to the next frame or previous.
What i want is when the movie is first loaded, i want it to fade up from 0 to 100. Then, as the user presses the forward/backward buttons, i would like the current frame to fade out and the next frame to fade in.
Is this possible?
Thanks in advance.
Fade In And Fade Out With Actionscript.
I am looking for a way to fade in a white movie clip over my main movie when a button is pressed.
(i.e. When you press a button, a white rectangle will fade in over all other layers and then fade out after a couple of seconds. This is to make it look like the different pages are fading in and out without having to build the transition over and over again.)
Does anyone have any idea how to do something like this?
Or the other way to do it is have the button change the opacity to 0 of all objects on the screen.
Is there any way to actionscript that?
Alpha Fade In Function?
I am trying to create a function that:
1. sets the alpha level of a mc to 0,
2. fade the instance in,
3. the code needs to be reusable.
This is what I have so far.
var a = 0
function fadeIn () {
while (a < 98) {
this._alpha = a
a = a + 5; }
}
Function Fade Not Fading
Hi
Can someone tell me whats wrong with my code. I dont know wether its because i have been looking at it for far too long that I cant see anything wrong!!! Please help.
the function is supposed to fade targetA to its destination before fading targetB to its destination.
Any takers?????
function fadeContent(targetA, targetB, destinationA, destinationB, fadespeed) {
rate = fadespeed;
targetA.onEnterFrame = function() {
rate = rate*1;
this._alpha += Math.round((destinationA-this._alpha)/rate);
if (this._alpha == destinationA) {
targetB.onEnterFrame = function() {
this._alpha += Math.round((destinationB-this._alpha)/rate);
if (this._alpha == destinationB) {
delete this.onEnterFrame;
}
};
}
};
}
Create Fade Function
im trying to create a generic fade functon that i can pass a MC instance name, a rate of fade, and start + end alphas.
The trouble im having is the bit that works out whether it need to fade in or out, i.e. if the start alpha is greater than the end , and then using that to do the actual fade.
Code:
fade = function (which, rate, strt, end) {
which._alpha = strt;
// suss out whether to use less than or greater than for the fade
if (strt<=end) {
var query = ('which._alpha>=end');
trace(query);
} else {
var query = ('which._alpha<=end');
trace(query);
}
_root.onEnterFrame = function () {
if (query) {
trace(which._alpha);
which._alpha += rate;
}
};
delete this.onEnterFrame;
};
it doesnt recognise the
Code:
if (query) {
part.
Any pointers?
thanks
Ben
Creating A Fade In Function
I'm using this fade in function. I have seen it used other times in photo galleries. Fading in by alpha each .jpg loaded into a MC. The problem I am having is working it into my existing movie. I have a main movie that loads another swf. Inside that swf it loads three diffrent .as files. So I am getting loast with the paths. I have tried everything. Putting the call to the fadeIn(); function on the first frame and putting it on the button. I'm so confused. If someone can help I can email you a zip of the files. Just send me a message. Thanks.
MovieClip.prototype.fadeIn = function() {
this.onEnterFrame = function() {
if (this._alpha<100) {
this._alpha += 5;
} else {
delete this.onEnterFrame;
}
};
};
Button Fade In And Out Function
Hi Guys,
I have this problem,
I am trying to built a function where it will fade out buttons on a screen using a rollover and fade back in on a rollout event.
The function works good on a fade out but once the fade in comes in that is where it does not want to work very well.
Any help will be much appreciated.
Thank you,
Regards
Szymek
Code:
on (rollOver) {
clearInterval(alpha_interval);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.QA);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Sucess_Stories);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Useful_Links);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.News);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Spare);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Glossary);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Time_Line);
var alpha_interval:Number = setInterval(this, "fadeImage", 50, _root.Your_Enquiry);
function fadeImage(target_mc:MovieClip):Void {
target_mc._alpha -= 5;
if (target_mc._alpha<=0) {
target_mc._visible = false;
target_mc._alpha = 0;
clearInterval(alpha_interval);
}
}
}
on (rollOut) {
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.QA);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Sucess_Stories);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Useful_Links);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.News);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Spare);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Glossary);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Time_Line);
var alpha_interval:Number = setInterval(this, "unfadeImage", 50, _root.Your_Enquiry);
function unfadeImage(target_mc:MovieClip):Void {
target_mc._visible = true;
target_mc._alpha += 10;
trace(target_mc._alpha);
if (target_mc._alpha>=100) {
target_mc._alpha = 100;
clearInterval(alpha_interval);
}
}
}
Fade Clip Function
Hi,
I am setting up a fade clip function. This is as far as I have gotten. I am just a little stuck. Do I set up another conditional? Not sure what to do! be appreciated.
Thank you!
var myHitTest = this.hitTest("play_anim");
play_anim.onRelease = function():Void{
addClip("greyRectangle_mc");
};
function addClip(greyRectangle_mc:String):Void{
var mcGreyRectangle:MovieClip = this.attachMovie("greyRectangle_mc", "mcGreyRectangle", this.getNextHighestDepth());
mcGreyRectangle._x = 0;
mcGreyRectangle._y = 0;
mcGreyRectangle._alpha -= 10;
}
Fade Clip Function
Hi,
I could use a little help with my fade clip function. For some reason which I can't quite figure out, it only decrements 1 time. Instead I want it to decrement 10X, and simply fade out.
Attached is the fla. Any takers?
Thanks in advance!
PHP Code:
stop();
stop(); var myHitTest = this.hitTest("play_anim");
play_anim.onRelease = function():Void{
addClip("greyRectangle_mc");
};
function addClip(greyRectangle_mc:String):Void {
var mcGreyRectangle:MovieClip = this.attachMovie("greyRectangle_mc", "mcGreyRectangle", 0)
mcGreyRectangle._x = 33;
mcGreyRectangle._y = 33;
mcGreyRectangle._xscale = 50;
mcGreyRectangle._yscale = 50;
mcGreyRectangle._alpha = 0;
this.onEnterFrame = function() {
if (mcGreyRectangle._alpha>=0) {
mcGreyRectangle._alpha += 10;
}
};
mcGreyRectangle.buttonTest_mc.onRelease = function():Void{
fadeClip("greyRectangle_mc");
};
}
function fadeClip(greyRectangle_mc:String):Void{
this.onEnterFrame = function() {
if (mcGreyRectangle._alpha>=100) {
mcGreyRectangle._alpha -= 10;
}
}
};
Fade Out Function Problem
Hi
I'm busy creating some website. I'm only at the beginning for the moment and i already have a strange problem.
I created some code to place the menu. when I roll over the menu it smoothly fades in and out. When I rapidly move over all my menus, some of them don't fadeout.
Can anybody help me out with it. Here is my FLA-file.
thanks in advance.
Function Should Fade In And Out Randomly
Hi
function wait(){
trace("hallo")
bubbles(); // 30 bubbles are created
clearInterval(myInt)
}
myInt = setInterval(this,"wait",5000)
that is ok but my problem is the following:
bubbles should be generated every 2 minutes (randomly) and should be faded out after approximately 20 seconds
could someone help ?
thanks
My Fade Function Being Stupid
Why wouldn't this work... What its basically doing is it calls the function fine, except it only sets op1 but won't go go deep as mc.onEnterFrame to run the fade, so basically all it does is set the opacity. Any thoughts?
Here's my code...
I'm using this to call
fade(menu_mc.model_mc.btn1, 'in', 50, 100, speed4);
And it calls this function.
function fade(mc, type, op1, op2, speed)
{
if (type == 'in')
{
mc._alpha = op1;
mc.onEnterFrame = function()
{
mc._alpha = mc._alpha + speed;
if (mc._alpha >= op2)
{
delete mc.onEnterFrame;
}
};
}
}
I get no errors
I Want To Write A Fade Function
i use top do this in AS 2.0
ActionScript Code:
MovieClip.prototype.fadein = function(){
this._alpha = 0
this.onEnterFrame = function() {
this._alpha += 10;
if (this._alpha>=100) {
this.onEnterFrame = null;
//trace("!!")
}
};
}
now i am trying to convert it to AS 3.0 with no success
ActionScript Code:
MovieClip.prototype.fadein = function(){
var MC:String=this.name
var newA:Number =0;
this.alpha = 0;
function onEnterFrame(event:Event) {
this.alpha+=.1
}
trace(this.name)
this.addEventListener(Event.ENTER_FRAME, onEnterFrame);
};
box.fadein();
please help!?
How Can I Add An Alpha Fade Out To This Function?
Hello!
I have some code that will preload and then fade in a picture. However, I need the picture to fade out again on frame 16. Is it possible to add this to the code?
ActionScript Code:
init = function () {
this.myContainer = this.createEmptyMovieClip("cont", 1);
this.myContainer._alpha = 0;
this.myContainer.loadMovie("picture.swf");
this.preloadJpg();
};
preloadJpg = function() {
this.onEnterFrame = function() {
if (this.myContainer.getBytesLoaded()>100 && this.myContainer.getBytesLoaded()>=this.myContainer.getBytesTotal()) {
this.fadePicIn();
}
};
};
fadePicIn = function() {
if(this.myContainer._alpha < 100){
this.myContainer._alpha += 10;
} else {
this.onEnterFrame = undefined;
}
}
this.init();
Fade In Function Problem
I'm loading a txt file that I use to load jpg's(no PHP):
PHP Code:
<a href="asfunction:_global.loadMovie,flag_1.jpg">flag 1
</font></a>
It works lik a charm, but now I want the "container" to fade in
the jpg's.
Code:
_global.loadMovie = function(url) {
container.loadMovie(url);
fadein();
};
function fadein() {
container._alpha = 3;
container.onEnterFrame = function() {
this._alpha += 12;
if (this._alpha>=100) {
this._alpha = 100;
}
};
}
The container fades in, but not 100% _alpha(about 40% I guess)!
What am I doing wrong?
Thanks
Fade Function Call
I have a function on root:
_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();
} else {
this.prevFrame();
}
};
and on root, a button with the code
on (rollOver){
_root.fade = true;
}
on (rollOut){
_root.fade = false;
}
This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say
on (press){
_root.fade = true;
}
the mc fades in, but I cant do another on (press) to fade out. Is this too confusing? Please help.
Sound Fade Function() ?
Hi ...
I want to make a function to fade sound, but NO CLUE TO START!!
MovieClip.protype.fade = function(soundName, fadeTo){
}
Is soundObject can do this way?? i don't know... please help!!
or anybody already make the function?? please tell me...
Fade Out Function Problem
Hi
I'm busy creating some website. I'm only at the beginning for the moment and i already have a strange problem.
I created some code to place the menu. when I roll over the menu it smoothly fades in and out. When I rapidly move over all my menus, some of them don't fadeout.
Can anybody help me out with it. Here is my FLA-file.
thanks in advance.
Simple Fade In And Out Function?
Can someone help me with a function that I can re-use and pass movie clips to and cause mc's to fade in and out?...such as
Code:
function fadeMeIn(fadewhat,fadespeed) {
if (fadewhat < 100) {
fadewhat._alpha += fadespeed;
};
and call it something like this?
_root.fadeMeIn(_root.mypages, 5)
Obviously not the correct code, but you get what Im trying to do. Instead of useing motion tweens with alpha, Id rather just do it with actionscript whenever I need to fade something in or out. Any ideas?
Thanks!
Rich
Alpha Fade Function Help Pls
hi, just getting back into flash and am trying to learn how to make all my action exist in the main timeline and cut down on stupid repeating.
the code i'm using is for 2 buttons that effect 2 other mclips so that when one button is rolled over it plays the mclips animation and then plays the head back again on rollOut. see below:
functions created:
navItemOne_mc.onEnterFrame = function() {
if (navOneFade) {
navItemOne_mc.nextFrame();
} else {
navItemOne_mc.prevFrame();
}
};
navItemTwo_mc.onEnterFrame = function() {
if (navTwoFade) {
navItemTwo_mc.nextFrame();
} else {
navItemTwo_mc.prevFrame();
}
};
button actions:
on(rollOver) {
this.navOneFade = true;
}
on(rollOut) {
this.navOneFade = false;
}
any help hugely appreciated. even a hand on TweenLite usage instead of these clunky functions - anything basically. don't hate me cause i'm stupid.
Fade In Function Problem
I'm loading a txt file that I use to load jpg's(no PHP):
PHP Code:
<a href="asfunction:_global.loadMovie,flag_1.jpg">flag 1
</font></a>
It works lik a charm, but now I want the "container" to fade in
the jpg's.
Code:
_global.loadMovie = function(url) {
container.loadMovie(url);
fadein();
};
function fadein() {
container._alpha = 3;
container.onEnterFrame = function() {
this._alpha += 12;
if (this._alpha>=100) {
this._alpha = 100;
}
};
}
The container fades in, but not 100% _alpha(about 40% I guess)!
What am I doing wrong?
Thanks
Fade Function Call
I have a function on root:
_root.fadeBox_mc.onEnterFrame = function (){
if (fade){
this.nextFrame();
} else {
this.prevFrame();
}
};
and on root, a button with the code
on (rollOver){
_root.fade = true;
}
on (rollOut){
_root.fade = false;
}
This causes a mc to fade in and out on rollover/rollout. But what I wanna make is a box that fades in when pressed on the button and fade out when pressed for the second time. But if I say
on (press){
_root.fade = true;
}
the mc fades in, but I cant do another on (press) to fade out. Is this too confusing? Please help.
Function Should Fade In And Out Randomly
Last edited by Codemonkey : 2007-02-27 at 15:02.
Hi
ActionScript Code:
function wait(){
trace("hallo")
bubbles();
clearInterval(myInt)
}
myInt = setInterval(this,"wait",5000)
that is ok but my problem is the following:
bubbles should be generated every 2 minutes (randomly) and should be faded out after approximately 20 seconds
could someone help ?
thanks
Fade In/out Function, With A Little Problem..
hi there i have a question... again
i made a function to (fade in/out) the mc on my root stage that contains the different parts of the website. this is what i got so far :
ActionScript Code:
function fadeOutImage(mc,spd,section) {
mc.spd = spd;
mc.onEnterFrame = function() {
this._alpha = this._alpha - this.spd;
if ( this._alpha <= 0 ) {
mc.loadMovie(section,1);
trace("it's all good");
this._alpha = this._alpha + this.spd;
trace("it's all good");
if ( this._alpha == 100) {
trace("it's all good");
}
}
}
}
if i run it like this it does load the new movie but it has a alpha value of 0 (i know this because i can click on the buttons that arent's visible).
i think the problem is in the :
ActionScript Code:
this._alpha = this._alpha + this.spd;
part but i can't figure it out does eanyone know where i going wrong...?
thanks a bunch.
Calling A Function That Will Fade Something In Or Out.
how would i create a function that will fade something in and out.. or basicaly increase a number for me tillt he desided end number.
i tried making a for( ) loop and adding a event listener but it didnt work for me :( i must of messed up something so i scrapped it..
can anyone help . two buttons one that will fade something in and one that will fade it out.
Actionscript Function Similar To PHPs Explode Function?
Hello everyone, first off, I'd like to say hi to everyone as this is my first post and I have joined very recently! So yeah, I'm glad to be here and yeah, hope I find what I need.
Right, well for those of you who know PHP there is a function known as explode(), which basically splits a string apart by a certain character and throws it into an array.
For example, in PHP.
PHP Code:
$string = "lol,text,omfg,wow,hi";
I can explode that string by the , character and it would split up everything and throw each little "section" into an array.
PHP Code:
$bits = explode( ',', $string );
I can now access access the bits by $bits[0], $bits[1], $bits[2], $bits[3], and $bits[4].
Now, is there anyway you can do this in Actionscript? Say I have a string in actionscript and I've datatyped it to a string.
PHP Code:
var myString:String = "text1|text2|text3|text4";
How can I explode, or break apart, the string by the | character and get the "text1", "text2", etc, strings?
Fade Movie Function Question
hello!
I would like to fade out of a movieclip before loading another, I've created a function to do this but it only seems the work on the first try. here's the script i'm using:
code:
fadeSpeed = 12;
theClip = _parent.theClip1;
_parent.theClip3 = theClip;
theClip._alpha = 99;
function fadeClip (){
trace("blah");
onEnterFrame = function (){
if (theClip._alpha >= 99) {
theClip._alpha = 99;
delete (onEnterFrame);
} else {
theClip._alpha -= fadeSpeed;
}
}
}
bttn01.onRelease = function() {
_parent.current = "1";
_parent.play();
fadeClip();
}
bttn02.onRelease = function() {
_parent.current = "2";
_parent.play();
fadeClip();
}
bttn03.onRelease = function() {
_parent.current = "3";
_parent.play();
fadeClip();
}
bttn04.onRelease = function() {
_parent.current = "4";
_parent.play();
fadeClip();
}
thanks in advance
signed: amatuer forever.
Button-function Controlling Fade...
I've been searching the forums but everything I found deals with alpha's and MC. Anyway...
I have a scroller with a few pic as well as blurred (photoshop) versions of them. When I set my xpos for my scoller I want to call a function(?) to make the Mc containing the blurred images fade to 0 everytime I call the function.
any ideas?
Fade In Function Works Only For One Movie - What's Going On?
I'm using this code:
Code:
function fadeIn(targetClip) {
onEnterFrame = function () {
if (targetClip._alpha < 100) {
targetClip._alpha += 5;
} else {
onEnterFrame = null;
targetClip._alpha = 100;
}
};
}
and it works, but only for ONE movie. I'm guessing that the onEnterFrame has something to do with it. I'm not sure what it does - being an AS
newbie.
I tried this:
Code:
function fadeIn(targetClip) {
while (targetClip._alpha < 100) {
targetClip._alpha += 5;
}
}
But that just sets alpha to zero - guessing again that it works, but it works too fast and you can't see the transition?
Any help is appreciated!
[CS3] (AS2) Adding A Fade In Function To My Images
Hello all !
I'm attempting at a portfolio site-
I have 3 buttons which load three different pictures into a movie clip
each button triggers a different picture on I would like to add a fadeIn
but I'm not sure how.
this is the code I have so far :
Code:
eygbtn1.onRelease = function() {
infoField._visible = true;
startLoading("eyg1.jpg");
};
function startLoading(whichImage) {
loadMovie(whichImage, "imageLoader");
_root.onEnterFrame = function() {
infoLoaded = imageLoader.getBytesLoaded();
infoTotal = imageLoader.getBytesTotal();
percentage = Math.floor(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
}
};
}
I am also trying to add a movie into the mix (with a fourth button)
but when I try loading an external movie by changing from the JPG to a MOV
file it doesn't respond.
any help would be greatly appreciated - thanks !! )
Problem With Dynamic Fade Function
Hey guys, I have created a fadein Function for a project I am working on.
Code:
MovieClip.prototype.fadeIn = function(speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>90) {
break;
}
};
};
The problem is it doesnt break out of the function once the movie clips _alpha has exceeded 90. It just keeps increasing the _alpha of the MC, a trace shows that the _alpha property keeps rising.
I have tried every which way to figure out how to stop the effect once the condition is met. Anybody have any ideas?
Thanks
Preload And Fade-in Function Problem
Hi
I created 2 functions:
- 1 for preloading my image
- and another 1 after the image is loaded to fade that iemage in.
But i'm having trouble converting it to a function that is usable for more than 1 image. So I don't have to retype the code every time.
Can some1 help me with it.
|