pois bem...
estou modificando um website em flash pra um amigo q tem uma web radio...
peguei um template flash na net...
na pagina inicial tem algumas imagens q defini como anuncios... sao varias...
existem dois botoes (o que avança e o que retrocede nessas imagens)
quero colocar pra que essas imagens mudem automaticamente, tipo de 3 em 3 segundos
aparecem 3 imagens por vez, quero que elas troquem de 3 em 3 segundos automaticamente...
e quando chegar ao final delas, quero que recomece o clico novamente...
sei que deve ser coisa facil de modifica no codigo...
mais aindao nao entendo muito de actions scripts
sao varios codigos e nao sei bem em qual mexer...
var filename_list = new Array(); var url_list = new Array(); var url_target_list:Array = new Array(); var title_list = new Array(); var description_list = new Array(); var filepath:String = "thumbnails/"; var flashmo_xml = new XML(); flashmo_xml.ignoreWhite = true; flashmo_xml.onLoad = function() { var nodes:Array = this.firstChild.childNodes; for(var i=0;i<nodes.length;i++) { filename_list.push(nodes[i].attributes.filename); url_list.push(nodes[i].attributes.url); url_target_list.push(nodes[i].attributes.target); title_list.push(nodes[i].attributes.title); description_list.push(nodes[i].attributes.description); } } flashmo_xml.load("anuncios.xml"); tn_group_area._visible = false;
this.onEnterFrame = function() { if( flashmo_xml.loaded ) play(); else gotoAndStop(2); }
penso que deve ser nesse...
tn_group.tn._visible = false; tn_group_area._visible = true; tn_group.setMask( tn_group_area ); import mx.transitions.Tween; import mx.transitions.easing.*; var fm_show_no:Number = 2; // number of thumbnails showing at a time var total:Number = filename_list.length; var distance_x:Number = tn_group.tn._width + 5; var i:Number = 0; var start_from:Number = 0; var current:Number = 0; fm_title.text = ""; fm_description.text = ""; fm_description_bg._visible = false; for( ; i < total; i++ ) { tn_group.tn.duplicateMovieClip("tn"+i, i); tn_group["tn"+i].preloader._width = 0; tn_group["tn"+i].tn_button._visible = false; tn_group["tn"+i].txt = (i+1); tn_group["tn"+i].tn_no = i; tn_group["tn"+i]._x = i * distance_x; tn_group["tn"+i].tn_button.onRollOver = function() { this._parent._parent._parent.fm_title.text = title_list[this._parent.tn_no]; this._parent._parent._parent.fm_description.text = description_list[this._parent.tn_no]; this._parent._parent._parent.fm_description_bg._visible = true; } tn_group["tn"+i].tn_button.onRollOut = function() { this._parent._parent._parent.fm_title.text = ""; this._parent._parent._parent.fm_description.text = ""; this._parent._parent._parent.fm_description_bg._visible = false; } tn_group["tn"+i].tn_button.onRelease = function() { getURL( url_list[this._parent.tn_no], url_target_list[this._parent.tn_no] ); } } function move_it() { if( total - start_from <= fm_show_no ) start_from = total - 3; if( start_from < fm_show_no - 1 ) start_from = 0; position_x = start_from * distance_x - tn_group_area._x; new Tween(tn_group, "_x", Elastic.easeInOut, tn_group._x, -position_x, 1.4, true); } fm_previous.onRelease = function() { start_from -= fm_show_no; move_it(); } fm_next.onRelease = function() { start_from += fm_show_no; move_it(); }
stop(); tn_group["tn"+current].tn_pic.loadMovie( filepath + filename_list[current] ); tn_group["tn"+current].tn_pic2.loadMovie( filepath + filename_list[current] ); tn_group["tn"+current].tn_pic._alpha = 0; onEnterFrame = function() { filesize_total = tn_group["tn"+current].tn_pic.getBytesTotal(); if( filesize_total == 0 ) filesize_total = 1; percent = Math.round( tn_group["tn"+current].tn_pic.getBytesLoaded() / filesize_total * 100 ); tn_group["tn"+current].txt = "loading...\n" + percent + "%"; tn_group["tn"+current].preloader._width = percent; if( percent == 100 ) { tn_group["tn"+current].txt = ""; tn_group["tn"+current].preloader._visible = false; tn_group["tn"+current].tn_button._visible = true; tn_group["tn"+current].tn_pic._alpha += 10; } if( tn_group["tn"+current].tn_pic._alpha > 100 ) { nextFrame(); delete this.onEnterFrame; } }
if( current < total - 1 ) { current++; prevFrame(); } else { nextFrame(); }
stop();
desde ja agradeço a todos aew...
esqueci de mensionar... caso precisem olhar do que estou falando no site, segue o link do mesmo... eh bem na pagina inicial onde tem 3 imagens...
Link para o site
bom pessoal, sou novo no ramo do flash ...
pois bem...
estou modificando um website em flash pra um amigo q tem uma web radio...
peguei um template flash na net...
na pagina inicial tem algumas imagens q defini como anuncios... sao varias...
existem dois botoes (o que avança e o que retrocede nessas imagens)
quero colocar pra que essas imagens mudem automaticamente, tipo de 3 em 3 segundos
aparecem 3 imagens por vez, quero que elas troquem de 3 em 3 segundos automaticamente...
e quando chegar ao final delas, quero que recomece o clico novamente...
sei que deve ser coisa facil de modifica no codigo...
mais aindao nao entendo muito de actions scripts
sao varios codigos e nao sei bem em qual mexer...var filename_list = new Array(); var url_list = new Array(); var url_target_list:Array = new Array(); var title_list = new Array(); var description_list = new Array(); var filepath:String = "thumbnails/"; var flashmo_xml = new XML(); flashmo_xml.ignoreWhite = true; flashmo_xml.onLoad = function() { var nodes:Array = this.firstChild.childNodes; for(var i=0;i<nodes.length;i++) { filename_list.push(nodes[i].attributes.filename); url_list.push(nodes[i].attributes.url); url_target_list.push(nodes[i].attributes.target); title_list.push(nodes[i].attributes.title); description_list.push(nodes[i].attributes.description); } } flashmo_xml.load("anuncios.xml"); tn_group_area._visible = false;this.onEnterFrame = function() { if( flashmo_xml.loaded ) play(); else gotoAndStop(2); }
penso que deve ser nesse...tn_group.tn._visible = false; tn_group_area._visible = true; tn_group.setMask( tn_group_area ); import mx.transitions.Tween; import mx.transitions.easing.*; var fm_show_no:Number = 2; // number of thumbnails showing at a time var total:Number = filename_list.length; var distance_x:Number = tn_group.tn._width + 5; var i:Number = 0; var start_from:Number = 0; var current:Number = 0; fm_title.text = ""; fm_description.text = ""; fm_description_bg._visible = false; for( ; i < total; i++ ) { tn_group.tn.duplicateMovieClip("tn"+i, i); tn_group["tn"+i].preloader._width = 0; tn_group["tn"+i].tn_button._visible = false; tn_group["tn"+i].txt = (i+1); tn_group["tn"+i].tn_no = i; tn_group["tn"+i]._x = i * distance_x; tn_group["tn"+i].tn_button.onRollOver = function() { this._parent._parent._parent.fm_title.text = title_list[this._parent.tn_no]; this._parent._parent._parent.fm_description.text = description_list[this._parent.tn_no]; this._parent._parent._parent.fm_description_bg._visible = true; } tn_group["tn"+i].tn_button.onRollOut = function() { this._parent._parent._parent.fm_title.text = ""; this._parent._parent._parent.fm_description.text = ""; this._parent._parent._parent.fm_description_bg._visible = false; } tn_group["tn"+i].tn_button.onRelease = function() { getURL( url_list[this._parent.tn_no], url_target_list[this._parent.tn_no] ); } } function move_it() { if( total - start_from <= fm_show_no ) start_from = total - 3; if( start_from < fm_show_no - 1 ) start_from = 0; position_x = start_from * distance_x - tn_group_area._x; new Tween(tn_group, "_x", Elastic.easeInOut, tn_group._x, -position_x, 1.4, true); } fm_previous.onRelease = function() { start_from -= fm_show_no; move_it(); } fm_next.onRelease = function() { start_from += fm_show_no; move_it(); }stop(); tn_group["tn"+current].tn_pic.loadMovie( filepath + filename_list[current] ); tn_group["tn"+current].tn_pic2.loadMovie( filepath + filename_list[current] ); tn_group["tn"+current].tn_pic._alpha = 0; onEnterFrame = function() { filesize_total = tn_group["tn"+current].tn_pic.getBytesTotal(); if( filesize_total == 0 ) filesize_total = 1; percent = Math.round( tn_group["tn"+current].tn_pic.getBytesLoaded() / filesize_total * 100 ); tn_group["tn"+current].txt = "loading...\n" + percent + "%"; tn_group["tn"+current].preloader._width = percent; if( percent == 100 ) { tn_group["tn"+current].txt = ""; tn_group["tn"+current].preloader._visible = false; tn_group["tn"+current].tn_button._visible = true; tn_group["tn"+current].tn_pic._alpha += 10; } if( tn_group["tn"+current].tn_pic._alpha > 100 ) { nextFrame(); delete this.onEnterFrame; } }if( current < total - 1 ) { current++; prevFrame(); } else { nextFrame(); }stop();
desde ja agradeço a todos aew...
esqueci de mensionar... caso precisem olhar do que estou falando no site, segue o link do mesmo... eh bem na pagina inicial onde tem 3 imagens...
Link para o site