ciao a tutti.
ecco il mio problema:
Ho un swf principale che contiene un menu e un clip filmato vuoto chiamato mc_testo.
Il menu carica altri file swf dall'esterno.
I file esterni riproducono una breve animazione creata sulla linea temporale.
Alla fine dell' animazione in un fotogramma c'è inserito del codice per far apparire il testo che dovrebbe apparire nel mio swf principale.
Ora, i file vengono caricati al click sui pulsanti del menu (l'animazione funziona), ma non viene eseguito il codice che c'è nel fotogramma!
Quindi il testo non appare! e ora non so proprio come fare. credo sia un problema di percorso...
potete aiutarmi?
vi posto il codice che ho nel fotogramma:
----------------------------------------------------------------------
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,2000)
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,th is.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>=500){
this.onEnterFrame = function(){
if(this._alpha>=0){
this._alpha-=5;
}else if(this._alpha<0){
loadMovie("flash/1_resistenza.swf",_self);
}
}
}
}
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="Arial"
mt.size=14
mt.color=0x000000
mt.bold=true
mt.multiline=true;
mt.wordWrap=true;
str="testo che dovrebbe apparire"
init(str,mt,524)
stop();
----------------------------------------------------------------------
grazie!!