Junior Lins
-
Total de itens
6 -
Registro em
-
Última visita
Posts postados por Junior Lins
-
-
Amigos,
Venho solicitar um HELP a vocês que são mais experientes, baixei um menu em flash e junto veio um XML, só que o problema que não consegui fazer os botões acessar um target.
Quando clicamos em um botão ele abre uma pagina em _blank com o SWF.
Abaixo segue os codigos:
XML
<?xml version="1.0" encoding= "UTF-8"?> <menu> <menu text="PRINCIPAL" url="www.paginaprincipal.com.br"> </menu> <menu text="NOSSA HISTÓRIA"> <sub text="Sub menu 1" url="SWF/sub1.swf" /> <sub text="Sub menu 2" url="SWF/sub2.swf" /> <sub text="Sub menu 3" url="SWF/sub3.swf" /> </menu> <menu text="PROJETOS"> <sub text="Sub menu 1" url="SWF/sub1.swf" /> <sub text="Sub menu 2" url="SWF/sub2.swf" /> <sub text="Sub menu 3" url="SWF/sub3.swf" /> </menu> <menu text="COMPANIA"> <sub text="Sub menu 1" url="SWF/sub1.swf" /> <sub text="Sub menu 2" url="SWF/sub2.swf" /> <sub text="Sub menu 3" url="SWF/sub3.swf" /> </menu> <menu text="CONTATO"> <sub text="Sub menu 1" url="SWF/sub1.swf" /> <sub text="Sub menu 2" url="SWF/sub2.swf" /> </menu> </menu>
CODIGO - ActionScriptimport mx.transitions.Tween; import mx.transitions.easing.*; // my_xml = new XML(); my_xml.ignoreWhite = true; my_xml.load('menu.xml'); my_xml.onLoad = function() { make_menu(); }; // // write text color with "0x" instead of "#", like this "0xFFFFFF" (white) // text color for top buttons main_text_color1 = "0xDDFF00"; main_text_color2 = "0x999999"; // text color for sub menus sub_text_color1 = "0x666666"; sub_text_color2 = "0x000000"; // // function make_menu() { for (i=0; i<my_xml.firstChild.childNodes.length; i++) { button0.swapDepths(1000); if (i>0) { button0.duplicateMovieClip("button"+i, 1000+i); sub0.duplicateMovieClip("sub"+i, 100+i); } this["button"+i].main_text_field.text = my_xml.firstChild.childNodes[i].attributes.text; this["sub"+i]._y = 0; this["button"+i]._x = i*100; this["button"+i].the_number = i; this["button"+i].onRollOver = this["button"+i].onDragOver=function () { clearInterval(check_interval); this.main_text_field.textColor = main_text_color1; // move this sub down this._parent["go_up"+this.the_number].stop(); if (this._parent["sub"+this.the_number]._y<17) { this._parent["go_down"+this.the_number] = new Tween(this._parent["sub"+this.the_number], "_y", Regular.easeIn, 0, 17, 12, false); } // move previous sub up if (open_menu != this.the_number) { this._parent["go_down"+open_menu].stop(); this._parent["go_up"+open_menu] = new Tween(this._parent["sub"+open_menu], "_y", Regular.easeOut, 17, 0, 3, false); } // open_menu = this.the_number; mouse_on_menu = "true"; }; this["button"+i].onRollOut = this["button"+i].onDragOut=function () { this.main_text_field.textColor = main_text_color2; mouse_on_menu = "false"; // clearInterval(check_interval); check_interval = setInterval(check_expanded_menus, 800); }; this["button"+i].open_url = my_xml.firstChild.childNodes[i].attributes.url; this["button"+i].onRelease = function() { if (this.open_url != undefined) { getURL(this.open_url); } }; // hide subs with no buttons if (my_xml.firstChild.childNodes[i].childNodes.length == 0) { this["sub"+i]._visible = false; } for (ii=0; ii<my_xml.firstChild.childNodes[i].childNodes.length; ii++) { if (ii>0) { this["sub"+i].s0.duplicateMovieClip("s"+ii, ii); this["sub"+i]["s"+ii]._x = ii*100; } this["sub"+i]["s"+ii].sub_text_field.text = my_xml.firstChild.childNodes[i].childNodes[ii].attributes.text; this["sub"+i].sub_c._x = this["sub"+i]["s"+ii]._x+this["sub"+i]["s"+ii]._width; // this["sub"+i]["s"+ii].onRollOver = this["sub"+i]["s"+ii].onDragOver=function () { mouse_on_menu = "true"; this.sub_text_field.textColor = sub_text_color2; }; this["sub"+i]["s"+ii].onRollOut = this["sub"+i]["s"+ii].onDragOut=function () { this.sub_text_field.textColor = sub_text_color1; mouse_on_menu = "false"; }; this["sub"+i]["s"+ii].open_url = my_xml.firstChild.childNodes[i].childNodes[ii].attributes.url; this["sub"+i]["s"+ii].onRelease = function() { if (this.open_url != undefined) { getURL(this.open_url); } }; // maintain sub menu open if mouse is on the margins too this["sub"+i].sub_a.onRollOver = this["sub"+i].sub_a.onDragOver=this["sub"+i].sub_c.onRollOver=this["sub"+i].sub_c.onDragOver=function () { mouse_on_menu = "true"; }; this["sub"+i].sub_a.onRollOut = this["sub"+i].sub_a.onDragOut=this["sub"+i].sub_c.onRollOut=this["sub"+i].sub_c.onDragOut=function () { mouse_on_menu = "false"; }; // hide hand cursor for sub menu margins this["sub"+i].sub_a.useHandCursor = false; this["sub"+i].sub_c.useHandCursor = false; // this["sub"+i]._x = this["button"+i]._x; last_button_position = 100*(my_xml.firstChild.childNodes.length); if (this["sub"+i]._x+this["sub"+i]._width>last_button_position) { this["sub"+i]._x = last_button_position-this["sub"+i]._width; } } } } function check_expanded_menus() { if (mouse_on_menu != "true" and mouse_on_menu != undefined) { if (eval("sub"+open_menu+"._y")>0) { this["go_down"+open_menu].stop(); this["go_up"+open_menu] = new Tween(eval("sub"+open_menu), "_y", Regular.easeOut, 17, 0, 3, false); // open_menu = undefined; clearInterval(check_interval); } } }
alguém pode me ajudar?
Agradeço antecipadamente.
Junior Lins
-
Amigo m_axx,
Muito obrigadoooo pela ajuda... vou te falar sobre onde eu estava errando.
Eu não estava usando um target para meu banner além de criar o MC estava no mesmo frame colocando o Script, depois li sobre como usar o loadmovie(),
então fiz o seguinte, criei um meuMC e ai numa segunda camada criei o action e deu certo... UFA!!!
VALEUUUU pela Força..
at
Jr
-
então, entendi mais ou menos...
mas para colocar um swf dentro de outro você usa a funcao loadMovie();
meuMC.loadMovie("banner.swf");
acho q era isso a sua duvida...=]
Então, eu usei o comando que você me passou, o problema que ele não aparece nada no meu swf, se eu tiro o nome (meuMC) e deixo somente o loadMovie("banner.swf"), ele aparece mas dentro do INDEX e la ele fica fixo não some quando chamo outra pagina.
Como posso passar um printScreen da minha tela pra que você veja?
peço desculpas por amolar..rsrs
at
Jr
-
ola m_axx,
vou tentar ser mais claro:
como faço pra eu colocar meu banner na pagina principal (1.swf)
Meu menu esta assim:
Principal - (1.swf)
Nossa Historia - (2.swf)
Projeto - (3.swf)
Quando coloco meu banner q tambem é um SWF, ele fica no index e no canto superior direito e não no Principal (1.swf)
sera que consegui...ser claro??...rsrs
tentei colocar o print screen aqui mas não consegui.
obrigado pela atenção.
jr
-
Ola amigos,
Tenho uma pagina totalmente em FLASH, ele tem o
INDEX.swf
e os menus que são
1.swf
2.swf e assim por diante,
tenho um banner que gostaria de jogar mas que ele so aparecesse somente no 1.swf,
que seria o 1.swf item do menu.
estou usando no MC o seguinte comando loadMovie("happyholidays.swf", 1);
Mas quando carrega o INDEX.html ele fica fixo e assim que muda o item do menu exemplo 2 ele continua la e fora de centro.
como eu faço para que ele apareça somente na pagina referente ao botao 1 e nào no index inteiro?
agradeço desde já pela atenção,
Junior Lins
Target em Menu FLASH e XML
em Flash & ActionScript
Postado
Ola, SK15,
Vi sua resposta, realmente não tinha esse comando, como muitos aqui sou aventureiro..rsrs, e graças a DEUS tem vocês pra ajudar a escapar das ignorancias..rsrs.
Minha outra pergunta é:
Eu tenho como clica no botao e ele entrar no meio de uma pagina em flash? como se fosse um MC?
agradeço novamente.
JR