Comunidad de diseño web y desarrollo en internet online

Problema con link en XML!!!!

Citar            
MensajeEscrito el 29 Ago 2006 03:22 pm
hola amigos!!!! como les va, espero que bien. Bueno paso a comentarles mi problema.
Cabe aclarar que el codigo no es mio. Lo adapte + o - a mis necesidades
El problema es que por ejemplo, como puedo hacer para que al hacer click en un icono de mi menu, no haga un trace sino que cargue una pelicula (en algun nivel superio), previamente definido en el xml. Estuve probando y no lo logro... Realmente necesito de su ayuda.

aqui esta el codigo A.S.

Código :

fscommand("fullscreen", "true");
fscommand("allowscale", "false");
Stage.scaleMode = "noScale";
///////////////////////////


import mx.utils.Delegate;

var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;

var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
   var nodes = this.firstChild.childNodes;
   numOfItems = nodes.length;
   for(var i=0;i<numOfItems;i++)
   {
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes[i].attributes.tooltip;
      t.icon.inner.loadMovie(nodes[i].attributes.image);
      t.r.inner.loadMovie(nodes[i].attributes.image);
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
   }
}

function over()
{
   home.tooltip.tipText.text = this._parent.toolText;
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y - this._parent._height/2;
   home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
   home.tooltip._alpha = 100;
}

function out()
{
   delete home.tooltip.onEnterFrame;
   home.tooltip._alpha = 0;
}

function released()
{
   trace(this._parent.toolText);
}

function moveTip()
{
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y - this._parent._height/2;
}

xml.load("icons.xml");

function mover()
{
   this._x = Math.cos(this.angle) * radiusX + centerX;
   this._y = Math.sin(this.angle) * radiusY + centerY;
   var s = (this._y - perspective) /(centerY+radiusY-perspective);
   this._xscale = this._yscale = s*100;
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
   speed = (this._xmouse-centerX)/2500;
}



y este es mi XML:

Código :

<icons>

<icon image="icon1.png" tooltip="E Learning" />

<icon image="icon2.png" tooltip="Charlas" />

<icon image="icon3.png" tooltip="Widgets" />

<icon image="icon4.png" tooltip="Consultoria" />

<icon image="icon5.png" tooltip="Compass"/>

<icon image="icon6.png" tooltip="Productos" />

<icon image="icon7.png" tooltip="Identidad" />

<icon image="icon8.png" tooltip="Apple iMac" />

<icon image="icon9.png" tooltip="Servicios" />

<icon image="icon10.png" tooltip="Cursos" />

</icons>


Desde ya muchisimas Gracias!!!!!!!!!

PD: Realmente necisto su ayuda.

Por jorgelina

6 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 29 Ago 2006 11:17 pm
Bueno primero que todo debes crear una nueva propiedad a tus tags de XML que diga pelicula="peli.swf" quedaría

Código :

<icons>
<icon image="icon1.png" tooltip="E Learning" pelicula="pelicula1"/>
</icons>


En el bucle de carga del XML ya sabes ese de

Código :

for(var i=0;i<numOfItems;i++)
   {
      var t = home.attachMovie("item","item"+i,i+1);

agregas esta linea

Código :

t.pelicula = nodes[i].attributes.pelicula;


por ultimo en la función released quedaría así

Código :

function released()
{
   _root.mc.loadMovie(this._parent.pelicula);
}


donde mc es el Movie Clip donde quieres cargar la película

Espero que eso funcione, prueba y nos cuentas

Por rubencho176

Claber

301 de clabLevel

3 tutoriales

 

Colombia

firefox
Citar            
MensajeEscrito el 29 Ago 2006 11:23 pm
Muchisimas gracias , ya lo habia solucionado haciendo exactamente eso.
Pero ahora me surge otro problema. cuando carga la pelicula(archivo.swf)
No la puedo cargar en un nivel superior y el menu en cuestion sigue funcionado(osea los botones siguen trabajando)
Como podria solucionar esto???


Desde ya muchisimas gracias

Por jorgelina

6 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 30 Ago 2006 03:33 pm
Bueno me parece que los tutoriales que necesitas son estos, me parece que ya sabes como hacer el 1 y el 2 así que te puedes saltar al 3
http://64.182.62.176/flv/carousel.flv
http://64.182.62.176/flv/carousel2.flv
http://64.182.62.176/flv/carousel3.flv

Por rubencho176

Claber

301 de clabLevel

3 tutoriales

 

Colombia

firefox

 

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