Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 07-29-2003, 02:06 PM   #1
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,409
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default letter fading

how do i fade text in a dynamic text field? i attach code to fade it, the text box fades but not the text inside it, is there a way to do it?
stealthelephant is offline   Reply With Quote
Old 07-29-2003, 02:20 PM   #2
JGizmo
Flash slave
 
JGizmo's Avatar
 
Join Date: Dec 2002
Location: UK
Posts: 504
Default

I find this code which can help you in search of the matrix
ActionScript Code:
/***Author: Ilyas USAL (pom)     Title: The Matrix has you...     Date: 06/06/2003 ***/ // To make it run smoother _quality = "MEDIUM"; /*** Functions ***/ // fade out and stop when _alpha inferior to 35 - no parameters function fadeOut(){     this._alpha -= 5;     if (this._alpha < 45) delete this.onEnterFrame; } // fade out and remove clip when _alpha inferior to 10 - no parameters function fadeToBlack(){     this._alpha -= 5;     if (this._alpha < 10){         delete this.onEnterFrame;         this.removeMovieClip();     } } // Create a new clip with a letter in it // x: _x position ; y: _y position ; size: size of the letter MovieClip.prototype.createLetter = function (x,y,size){     // Create and position the new clip     var mc = this.createEmptyMovieClip("letter"+this.dep,this.dep++);     mc._x = x;     mc._y = y;     // Create a new TextField in the clip     mc.createTextField("t",0,0,0,size,size);     // Choose a random letter     var myChar = Math.round(Math.random()*87)+36;     mc.t.text = chr(myChar);     // Create the TextFormat, format the text and embed the font     var tf = new TextFormat();     tf.size = size;     tf.font = "Courier New";     tf.selectable = false;     tf.color = "0x00ff00";     mc.t.setTextFormat(tf);     mc.t.embedFonts = true;     // Fade the letter until its _alpha = 35     mc.onEnterFrame = fadeOut; } // Create a trail of letters function createTrail(){     // Create new clip and position it randomly     var clip = this.createEmptyMovieClip("trail"+i,i++);     clip._x = Math.round(random(Stage.width)/10)*10;     clip._y = clip.y = -10;     // Choose a random size for the letters, and set the spacing     var size = random(10)+15;     clip.spacing = size + 2;     // onEnterFrame, create a new letter that will wade out.     // if we're at the bottom of the screen, fade out the whole trail     clip.onEnterFrame = function(){         this.y += this.spacing;         this.createLetter(0,this.y,size);         if (this.y > Stage.height) this.onEnterFrame = fadeToBlack;     } } // Create a new trail every 100 milliseconds setInterval(this,"createTrail",100);
Key is: fading the movieclip which contains the textfield not the text itself.
__________________
:===: H A P P Y . . . F L A S H I N G :===:
JGizmo is offline   Reply With Quote
Old 07-29-2003, 02:25 PM   #3
stealthelephant
The Thread Collector
 
Join Date: May 2003
Location: the far side
Posts: 1,409
Send a message via AIM to stealthelephant Send a message via MSN to stealthelephant
Default

i'm a dumbass, i was thinking about something else and talking about another

i think i will stay with my own, kinda far into it at the moment, hope it doesnt run to heavily on the cpu though

thanx for the code though, i will look at it anyways
stealthelephant is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:48 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.