[ascoders] AW: [ascoders]schwierigkeiten mit setInterval

  • From: "Timo H." <t.hoelzer@xxxxxxxxx>
  • To: <ascoders@xxxxxxxxxxxxx>
  • Date: Mon, 14 Oct 2002 09:44:11 +0200

Hallo kleiner Tipp am Rande:

Dank der autosize-Eigenschaft der Textfield-Klasse kann
man auf das manuelle Kerning der einzelnen Letters verzichten.
Vorteil: es funzt mit "jedem Font"

kleines Beispiel (copy&paste into 1st Frame):

text="Dieser Texteffekt ist nur mit MX-actionscript erzeugt!"
l=text.length
i=0
startX=10
startY=300
LibaryFont=false
textFormat=new TextFormat()
textformat.font="Arial"
textformat.size=18
textformat.color=0xFFFFFF


_root.createEmptyMovieClip("textEffect",1)
_root.textEffect.onEnterFrame = function(){
        this.i = _root.i
        this.count++
        if(this.i<_root.l){
                _root.createEmptyMovieClip("letter"+this.i,this.i+10)
                _root["letter"+i].createTextField("substring",1,0,0,100,100);
                _root["letter"+i].substring.text=_root.text.charAt(this.i)
                _root["letter"+i].substring.autoSize=true
                _root["letter"+i].substring.type="dynamic"
                _root["letter"+i].substring.selectable=false
                if(_root.LibaryFont){
                        _root["letter"+i].substring.embedFonts=true
                }
                
_root["letter"+this.i].substring.setTextFormat(_root.textFormat);
                Twidth = _root["letter"+this.i].substring._width
                Theight = _root["letter"+this.i].substring._height
                _root["letter"+this.i].yhome=_root.startY
                _root["letter"+this.i]._x=_root.startX
                _root["letter"+this.i]._y=random(100)-100
                _root["letter"+i].onEnterFrame=function(){
                        this.elasticSlide(this.yhome,.8,.2)
                }
                _root.startX+=Twidth-2
                _root.i++
        }else{
                delete(_root.textEffect.onEnterFrame)
        }

}
MovieClip.prototype.elasticSlide = function (targetY, friction,  ratio) {
        this.addy = this.addy * friction + (targetY - this._y) * ratio
        this._y += this.addy

}

gruß Timo

------------------------------------------------------
Archiv   : //www.freelists.org/archives/ascoders/
Optionen : //www.freelists.org/list/ascoders
------------------------------------------------------

Other related posts: