senti ho trovato qualche difetto quindi a casa l'ho testato e questo funziona, fai una prova prima con un file txt
codice:
create_scrollimg.txt
&img1=foto1.jpg&url1=http://www.rempox.it&
&img2=foto2.jpg&url2=http://www.rempox.it&
&img3=foto3.jpg&url3=http://www.rempox.it&
&img4=foto4.jpg&url4=http://www.rempox.it&
&img5=foto5.jpg&url5=http://www.rempox.it&
&img6=foto6.jpg&url6=http://www.rempox.it&
&img7=foto7.jpg&url7=http://www.rempox.it&
&img8=foto8.jpg&url8=http://www.rempox.it&
&img9=foto9.jpg&url9=http://www.rempox.it&
codice:
// nella libreria c'è un clip box concatenato "box"
createEmptyMovieClip("content_bar",1)
content_bar._x=0
content_bar._y=0
elenco = new LoadVars()
elenco.onLoad=function(success){
// se il txt è stato caricato con successo
if(success){
I=1 // contatore documenti
while(this["img"+I] != undefined){
_level0.maxfoto=I
_level0.content_bar.attachMovie("box","box"+I, I)
mc=eval(_level0.content_bar["box"+I])
mc._x=100*I-100
mc.createEmptyMovieClip("pic",1)
mc.pic.loadMovie(this["img"+I]) // dati da asp
mc.url=this["url"+I] // dati che arrivano da asp
mc.pic._alpha=0
mc.onEnterFrame=function(){
car=this.pic.getBytesLoaded()
tot=this.pic.getBytesTotal()
if(car==tot && car >1024){
// caricata foto
this.pic._alpha=100
delete this.onEnterFrame
}
}
mc.onRollOver=function(){
_level0.stato="stop"
}
mc.onRollOut=function(){
_level0.stato="play"
}
mc.onPress=function(){
_level0.stato="stop"
trace(this.url)
}
mc.onRelease=function(){
_level0.stato="play"
}
I++
}
_level0.action_scroll()
}
}
elenco.load("create_scrollimg.txt")
function action_scroll(){
stato = "play"
ID=1
ID_box=1
content_bar.onEnterFrame=function(){
if(_level0.stato == "play"){
if(this._x > (-100*ID)){this._x-=5}
else{
if(_level0.ID_box<=_level0.maxfoto){
this["box"+ID_box]._x=100*(_level0.maxfoto-1)+100*ID
ID++
ID_box++
this._x-=5}
else{ID_box=1;}
}
}
}
}
per vederlo
http://www.rempox.it/forum/gallery/t...o_gallery.html
Ciao