473,732 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fade movieclip on mouseout

toxicpaint
58 New Member
Hi Everyone,

I've had a look around but couldn't find any answers so thought I'd ask you lot. :)

I'm using actionscript 2.0. What I have on my stage is a button that when you mouse over it, pops up a movie clip. Then when you move you mouse off it, it disappears after about 3 seconds. What I'd like it to do is fade out after 3 seconds rather than disappearing. For some reason this seems to be pretty much impossible with my existing code. Please help!

This is what I have so far:
Expand|Select|Wrap|Line Numbers
  1. on (rollOut) {
  2.     function wait() {
  3.    var myInterval = setInterval(function () {        
  4.           _root.nigeria_text._visible = false;
  5.       clearInterval(myInterval);
  6.    }, 3*500);
  7. }
  8. wait();
  9. }
  10.  

Cheers,

Tom
Jul 14 '09 #1
3 3513
toxicpaint
58 New Member
There must be an answer to this! Anyone? =/
Aug 7 '09 #2
unauthorized
81 New Member
@toxicpaint
How about you just reduce the MovieClip's alpha property by 0.0334 every 100ms? Just make sure you disable it so your users won't click it again while it fades.

Expand|Select|Wrap|Line Numbers
  1. // note that I just pulled this code out of thin air after 5+ years of having no contact with as2
  2. function fade_step()
  3. {
  4.     _root.nigeria_text.alpha -= 0.0334; // what happens on underflow?
  5.     updateAfterEvent(); // docs says you must call this
  6.     if(_root.nigeria_text.alpha > 0) setInterval(fade_step, 100);
  7. }
  8.  
  9. // call this once to begin fading
  10. setInterval(fade_step, 100);
  11.  
Aug 7 '09 #3
toxicpaint
58 New Member
Nice one. :)

Your message is too short please enter 20 characters or more.
Aug 7 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7286
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void fade(System.Windows.Forms.Panel fP){ for (int i = 255; i >= 0;i--){ System.Threading.Thread.Sleep(10); fP.BackColor = System.Drawing.Color.FromArgb(i, 255,255,255); System.Windows.Forms.Application.DoEvents();
1
4354
by: jase_dukerider | last post by:
Hi I have an assignment to hand in shortly for which I am after some guidance. The task is to read a WAV file, request a fade in /out time for the track from the user and the do the fade by modifying the binary file then writing it as a new file I have attached my code so far but do not know how to do the fade and how to write it as a new file. Please help! #include <stdio.h> #include <stdlib.h> #include <string.h>
4
3532
by: Chris Lieb | last post by:
Hi, I am writing a class in JavaScript to cause a repeating fade effect. The fade class takes care of the fading and the rgb class takes care of manipulating rgb values: function rgb(red, green, blue) { // private variable initialization this.red = red; this.green = green;
2
2696
by: Emil | last post by:
Hi, if you open the link below and click on "Show Me" and then "Toggle Transition" Button you will see a wonderfull fade in / fade out transition of 2 pictures. http://msdn.microsoft.com/library/default.asp?url=/workshop/author/filter/reference/filters/fade.asp I want to have the same effect in Visual C++, dosen't matter with / or without GDI+, but no .NET. I have a simple dialog with some controls and I
18
9654
by: hopper | last post by:
I am having a memory block today and for the life of me cant seem to get it right. Can someone help me with code to fade text in 8 seconds after the page has loaded. This is what i have but i dont want it to appear straight away. How do i add an 8 second delay to the text fading in.?? <html> <head> <script language="javascript"> col=255;
1
4432
by: veenathi | last post by:
i am trying to write code for coping a certain portion of movieclip into another movieclip. for that i draw big stage movieclip. (stage_mc).Then i draw small rectangle movieclips on the stage movieclip. (rect_mc) Now what i want, is that the area of the stage_mc that the rect_mc is drawn on, should be made into another movieclip. So that portion of the stage_mc which had been selected by the rect_mc, becomes a new movieclip newMC_mc. ...
2
4500
sumaiya
by: sumaiya | last post by:
I know how to load dynamic images in a movieclip sPhoto.loadMovie('http://localhost/1.jpg'); I have two movieclips "mcMain" and "mcArticle" mcMain ---- mcArticle --- mcPhoto mcPhoto is inside mcArticle and is suppose load an image dynamicaly I am using the above code but it does not work. Please Help. My code is given below onClipEvent(load) {
1
2377
by: nagraj | last post by:
hi i have a problem in flash .how to call a movieclip to another movieclip give _root
1
3572
by: chromis | last post by:
Hi, This should be really simple to do and has really got me stumped. I have a movieclip inside a button, the button is called my_btn and the movieclip is called my_movie. What i want to happen is the movieclip goes to frame two when the button is rolled over, so i added this code to test the reference to the button: my_button.onRollOver = function() { trace(this.my_movie); }
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9447
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9307
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.