Comunidad de diseño web y desarrollo en internet online

Vincular

Citar            
MensajeEscrito el 23 May 2007 11:19 am
Buenas a todos, buscando por la red e encontrado un archivo que es un scroll con botones, pero no consigo vincular el boton para cargar un swf externo o ir a una Url.
Les pongo la web por si alguien me puede ayudar
http://www.ffiles.com/flash/user_interface/group_94_scroll/

Tambien les pongo el codigo:

Código :

var itens:Array = new Array ("info", "Tooltip", "Random Position", "Combo Box", "Galeria Prev Next");


Gracias por todo

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 23 May 2007 02:53 pm
debajo del arreglo anterior creas otro arreglo con las URLs:

Código :

var URLs:Array = new Array ("info.html", "Tooltip.html", "RandomPosition.html", "ComboBox.html", "GaleriaPrevNext.html");

y ANTES del: novoItem.btn_mc.onRollOver = function ()
colocas esto:

Código :

novoItem.URL = URLs[a];

y dentro de la siguiente funcion colocas el getURL():

Código :

    novoItem.btn_mc.onRelease = function ()  {
        _global.selMenu = this._parent.iD;
        this._parent.txt_mc.colorTo("0xcccccc", 1);
        this.enabled = false;
        this.useHandCursor = false;
        getURL(this.URL, _blank);  //********************** nueva linea
        Slctd();
    };

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 23 May 2007 04:57 pm
Muchas grácias por responder tan rápido.
Ahora mismo lo pruebo.
Un saludo

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 23 May 2007 05:28 pm
No me ha funcionado :cry:
Posteo todo el codigo por si hay algo mal hecho :oops:
¿Puedo cargar un swf externo en vez de ir a una Url? ¿Como?

Código :

var itens:Array = new Array ("info", "Tooltip", "Random Position", "Combo Box", "Galeria Prev Next", "Load Blur", "Filtro XML", "Elastico Motion", "Resize Style", "Tooltip", "Random Position", "Combo Box", "Galeria Prev Next", "Load Blur");
var swfs:Array = new Array ("informacion.swf", "tooltip.swf", "random.swf", "combo.swf", "galeria.swf", "load.swf", "filtro.swf", "elastico.swf", "resize.swf", "tooltip.swf", "random.swf", "combo.swf", "galeria.swf", "load.swf");
var URLs:Array = new Array ("http://www.info.html", "Tooltip.html", "RandomPosition.html", "ComboBox.html", "GaleriaPrevNext.html");
//
// Cria uma função para ser realizada em todos os itens, menos no clicado
function Slctd () {
   for (var a:Number = 0; a < itens.length; a++) {
      if (a != selMenu) {
         novoItem = eval ("item" + a);
         novoItem.txt_mc.colorTo ("0x666666", 1);
         novoItem.btn_mc.enabled = true;
         novoItem.btn_mc.useHandCursor = true;
      }
   }
}
// Aqui faz um calculo para ver quantos cliques serão possíveis
var qtClick:Number = (Math.floor (itens.length - (_parent.mask_sub_mc._height / item_mc._height)));
// Cria-se uma variável com valor igual a de cliques, só que a quantidade de itens original nunca vai ser alterada 
var qtOrig:Number = qtClick;
// Mostra quantos itens tem no total
_parent.show_txt.text = itens.length + " ITENS";
// Aqui faz um cauculo para ver se o scroll é necessário ou não
if ((Math.floor (itens.length - (_parent.mask_sub_mc._height / item_mc._height))) <= 0) {
   _parent.scroll_sub_mc._visible = false;
}
for (var a:Number = 0; a < itens.length; a++) {
   duplicateMovieClip ("item_mc", "item" + a, a + 10);
   //
   item_mc._visible = false;
   item_mc.removeMovieClip ();
   //
   novoItem = eval ("item" + a);
   novoItem._y += (novoItem._height) * a;
   novoItem.iD = a;
   //
   //
   novoItem.txt_mc.tit_txt.autoSize = "left";
   novoItem.txt_mc.tit_txt.text = _root.addZero ((a + 1), 2) + " " + itens[a].toUpperCase ();
   novoItem.btn_mc._width = novoItem.txt_mc._width;
   //
   novoItem.mask_mc.alphaTo (100, 0, "", a * 0.05);
   novoItem.mask_mc.tween ("_xscale", 100, 1.5, "easeOutExpo", a * 0.05);
   novoItem.mask_mc.tween ("_x", 0, 1, "easeOutExpo", a * 0.05);
   novoItem.txt_mc.alphaTo (100, 1, "", a * 0.05);
   novoItem.txt_mc.tween ("_x", 0, 1, "easeOutExpo", a * 0.05);
   //
   novoItem.URL = URLs[a];
   
    novoItem.btn_mc.onRelease = function ()  {
        _global.selMenu = this._parent.iD;
        this._parent.txt_mc.colorTo("0xcccccc", 1);
        this.enabled = false;
        this.useHandCursor = false;
        getURL(this.URL, _blank);  //********************** nueva linea
        Slctd();
    };
   //
   
   novoItem.btn_mc.onRollOver = function () {
      this._parent.txt_mc.colorTo ("0x999999", 1);
      _root.somOver ();
   };
   novoItem.btn_mc.onRollOut = function () {
      this._parent.txt_mc.colorTo ("0x666666", 1);
   };
   novoItem.btn_mc.onRelease = function () {
      _global.selMenu = this._parent.iD;
      _parent.swf_txt.text = swfs[this._parent.iD];
      //
      this._parent.txt_mc.colorTo ("0xcccccc", 1);
      //
      this.enabled = false;
      this.useHandCursor = false;
      Slctd ();
   };
}

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 24 May 2007 01:21 pm
para cada elemento del menu
¿quieres abrir una pagina del explorador en una nueva ventana? o ¿quieres que se carguen los SWFs en la misma ventana?

¿que quieres que haga cada botón?

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 24 May 2007 02:01 pm
Cargar swf externos en la misma ventana
Grácias

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 24 May 2007 02:20 pm
Ahhhh¡

entonces substituye

novoItem.URL = URLs[a];

por

novoItem.ClipExterno = swfs[a];

y cambia

getURL(this.URL, _blank);

por

Código :

ClipNuevo = _root.createEmptyMovieClip("ClipExt", 5); // esto crea un clip vacio  en la pos (0,0) para cargar el externo
ClipNuevo.loadMovie(this.ClipExterno); // esto carga el clip externo
// Si quieres que el clip externo este en cierta posición entonces cambia sus propiedades de posición, por ejemplo:
ClipNuevo._x = 200; // los valores que tu prefieras.
ClipNuevo._y = 150;

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 24 May 2007 05:52 pm
Gracias otra vez por tu tiempo desinteresado.
Un saludo

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 24 May 2007 06:22 pm
Sigue sin funcionar :cry: :cry:
Este es el error que me da:
Error opening URL "file:///Macintosh%20HD/Users/huma06fustertorandell/Desktop/HUMà02/undefined"
Y este es el codigo entero:
var itens:Array = new Array ("info","contacto","PORFOLIO WEB","fotografia social", "fotografia de estudio", "fotografia industrial", "Galeria Prev Next", "Video edicion", "Filtro XML", "Elastico Motion", "Resize Style", "Tooltip", "Random Position", "Combo Box", "Galeria Prev Next", "Load Blur");
var swfs:Array = new Array ("fotos.swf", "tooltip.swf", "random.swf", "combo.swf", "galeria.swf", "load.swf", "filtro.swf", "elastico.swf", "resize.swf", "tooltip.swf", "random.swf", "combo.swf", "galeria.swf", "load.swf");
//
// Cria uma função para ser realizada em todos os itens, menos no clicado
function Slctd () {
for (var a:Number = 0; a < itens.length; a++) {
if (a != selMenu) {
novoItem = eval ("item" + a);
novoItem.txt_mc.colorTo ("0x666666", 1);
novoItem.btn_mc.enabled = true;
novoItem.btn_mc.useHandCursor = true;
}
}
}
// Aqui faz um calculo para ver quantos cliques serão possíveis
var qtClick:Number = (Math.floor (itens.length - (_parent.mask_sub_mc._height / item_mc._height)));
// Cria-se uma variável com valor igual a de cliques, só que a quantidade de itens original nunca vai ser alterada
var qtOrig:Number = qtClick;
// Mostra quantos itens tem no total
_parent.show_txt.text = itens.length + " ITENS";
// Aqui faz um cauculo para ver se o scroll é necessário ou não
if ((Math.floor (itens.length - (_parent.mask_sub_mc._height / item_mc._height))) <= 0) {
_parent.scroll_sub_mc._visible = false;
}
for (var a:Number = 0; a < itens.length; a++) {
duplicateMovieClip ("item_mc", "item" + a, a + 10);
//
item_mc._visible = false;
item_mc.removeMovieClip ();
//
novoItem = eval ("item" + a);
novoItem._y += (novoItem._height) * a;
novoItem.iD = a;
//
//
novoItem.txt_mc.tit_txt.autoSize = "left";
novoItem.txt_mc.tit_txt.text = _root.addZero ((a + 1), 2) + " " + itens[a].toUpperCase ();
novoItem.btn_mc._width = novoItem.txt_mc._width;
//
novoItem.mask_mc.alphaTo (100, 0, "", a * 0.05);
novoItem.mask_mc.tween ("_xscale", 100, 1.5, "easeOutExpo", a * 0.05);
novoItem.mask_mc.tween ("_x", 0, 1, "easeOutExpo", a * 0.05);
novoItem.txt_mc.alphaTo (100, 1, "", a * 0.05);
novoItem.txt_mc.tween ("_x", 0, 1, "easeOutExpo", a * 0.05);
//
novoItem.btn_mc.onRollOver = function () {
this._parent.txt_mc.colorTo ("0x999999", 1);
_root.somOver ();
};
novoItem.btn_mc.onRollOut = function () {
this._parent.txt_mc.colorTo ("0x666666", 1);
};
novoItem.ClipExterno = swfs[a]
novoItem.btn_mc.onRelease = function () {
_global.selMenu = this._parent.iD;
this._parent.txt_mc.colorTo("0xcccccc", 1);
this.enabled = false;
this.useHandCursor = false;

ClipNuevo = _root.createEmptyMovieClip("ClipExt", 5); // esto crea un clip vacio en la pos (0,0) para cargar el externo
ClipNuevo.loadMovie(this.ClipExterno); // esto carga el clip externo
// Si quieres que el clip externo este en cierta posición entonces cambia sus propiedades de posición, por ejemplo:
ClipNuevo._x = 200; // los valores que tu prefieras.
ClipNuevo._y = 150
Slctd();
};
}

Por guiem

29 de clabLevel



Genero:Masculino  

safari
Citar            
MensajeEscrito el 25 May 2007 02:05 am
coloca punto y coma al final de las lineas donde esta el 150 y swfs[a]


cambia this.ClipExterno por:

this._parent.ClipExterno

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7
Citar            
MensajeEscrito el 25 May 2007 07:15 am
GRACIAS!!!!!
HA FUNCIONADO!!!! :)
MIL GRÁCIAS OTRA VEZ, UN SALUDO

Por guiem

29 de clabLevel



Genero:Masculino  

safari

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.