A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: fade text in and out?

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    343

    fade text in and out?

    I created a text field dynamically. That works great. Now I want to fade the text in and out. I tried putting it into a mc and changing the alpha, but that didn't work. Any ideas?

  2. #2
    Noor._alpha = 0 ! nooor83's Avatar
    Join Date
    Aug 2005
    Posts
    252

    here u go !

    i dun think that can be done using a dynamic text field..even if it's within a mc but my idea is to create another movie clip with a borderless rectangle in it (it's color depeneds on ur background color) and put it above the movie that has the dynamic text and make it's alpha = 100 for fade out effect and make alpha=0 for fade in effect..

    but for fade in and fade out effect u gotta use setInterval() , clearInerval() functions..

    let me know if it works..

    good luck

    Noor

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    343
    Thanks for the reply. I created another mc dynamically with a higher depth, and put it over the text. The text still shows through it. Any ideas on what I'm doing wrong? I'm trying to keep everything dynamic.

    Thanks again.

  4. #4
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    put this on the MC....
    Code:
    onClipEvent (load) {
    	this._alpha = 0;
    	this.onEnterFrame = function() {
    		if (this._alpha<100) {
    			this._alpha += 5;
                     trace(this._alpha);
    		} else if (this._alpha>=100) {
    					trace("It's Done!");
    					delete this.onEnterFrame;
    		}
    	};
    }

  5. #5
    Senior Member
    Join Date
    Nov 2002
    Location
    Maryland, USA
    Posts
    428
    That or put a movie clip on top of the text that fades in with the bacground and out to display teh text.

  6. #6
    Noor._alpha = 0 ! nooor83's Avatar
    Join Date
    Aug 2005
    Posts
    252

    read this carefully..

    hey gamist,

    the thing is (NOT) to create an empty movie clip and just put on the other movie clip (BUT) create a movie clip with a white borderless rectangle in it and then put it above the movie and control it's alpha to get the fade in , fade out effect..

  7. #7
    Senior Member
    Join Date
    Jun 2001
    Posts
    343
    I used the code below and put it at a higher depth than the text, but for some reason the text always shows:


    //Function that draws the rectangle
    function drawRectangle(nameOfMC,left,right,top,bottom,boxCo lor,lineColor,depthNumber) {
    _root.createEmptyMovieClip(nameOfMC,depthNumber);
    with(nameOfMC) {
    beginFill(boxColor, 100);
    lineStyle(1, lineColor, 100);
    moveTo(left,top);
    lineTo(right,top);
    lineTo(right,bottom);
    lineTo(left,bottom);
    lineTo(left,top);
    }
    }

  8. #8
    Noor._alpha = 0 ! nooor83's Avatar
    Join Date
    Aug 2005
    Posts
    252
    i didn't work much with creating movie contents dynamicly, why don'tu try to create a movie and put a rectangle in at (DESIGN TIME)..that is going to work..i have just tried that,,

    Good Luck,

    Noor

  9. #9
    Senior Member
    Join Date
    Jun 2001
    Posts
    343
    Thanks. I just created a mc the old fashioned way like you recommended. It worked. I was just hoping to have my whole movie dynamic.

    Thanks again for your help.

  10. #10
    Noor._alpha = 0 ! nooor83's Avatar
    Join Date
    Aug 2005
    Posts
    252
    i know what u meant..u wanted to be unique..u r a capricorn if im not worng..but something is gifted, accept it..

    Good Luck,

    Noor

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center