ho questo script qui sotto.
è un effetto su testo creato interamente in AS.
il mio problema e che dopo che appare voglio che scompaia.
anche senza effetto fade. questo perchè vorrei riutilizzarlo.
si vede che mi sarò appena svegliato ma la mia testa si rifiuta
di darmi una soluzione plausibile.
potete aiutarmi perfavore!?
per farlo funzionare create un campo di testo dinamicocodice:function charPositions(tFormat,str,depth){ _root.createTextField("temp",depth,0,-300,100,400) temp.autosize=true temp.embedFonts=true temp.setNewTextFormat(tFormat) var arr=[] temp.text=str var totalWidth=temp.textWidth for(var i=0;i<str.length;i++){ temp.text=str.substr(i) arr[i]=totalWidth-temp.textWidth } return arr } function setUpText(str,forma,lineLength){ var positions=charPositions(forma,str,1000) var currentLine var lineHeight=forma.getTextExtent(str).height var finalPositions=[] for(var i=0;i<positions.length;i++){ if(positions[i]>(lineLength+subtracta)){ subtracta=positions[i] currentLine++ } var x=positions[i]-subtracta var y=lineHeight*currentLine finalPositions[i]={char:str.charAt(i),x:x,y:y} } return finalPositions } function drawNext(){ var noo=this.createEmptyMovieClip("lett"+this.count,this.count) var nextObj=charPos[this.count] noo._x=nextObj.x noo._y=nextObj.y noo.createTextField("tex",1,0,0,100,100) noo.tex.text=nextObj.char noo.tex.embedFonts=true noo.tex.selectable=false noo.tex.setTextFormat(mt) noo._alpha=30 noo.onEnterFrame=function(){ this._alpha+=5 if(this._alpha>=100){ delete this.onEnterFrame } } this.count++ if(this.count>charPos.length){ delete this.onEnterFrame } } function init(str,tForm,lineLength){ charPos=setUpText(str,tForm,lineLength) this.count=0 this.onEnterFrame=drawNext } mt=new TextFormat() mt.font="Helvetica 45 Light"//cambiate il font se non avete questo. mt.size=24//dimensione font mt.color=0xffffff//colore font mt.bold=true//se cè true dovete nel pannello di proprietà //applicare l'opzione bold, se false dovete toglierla. str=" I tuoi occhi racchiudono il segreto della tenerezza" //cambiate il testo con uno vostro. init(str,mt,390)//390 è la lunghezza del campo di testo stop();
e dategli il nome di istanza che volete.
incorporate il carattere con "all characters"
se non lo fate non funziona l'effetto.
grazie![]()

Rispondi quotando
