Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

ricardo coelho designer

Flash Lightbox xml

Recommended Posts

Pessoal boa tarde estou finalizando um site e me fiquei agarrado num lightbox, eu até fiz um funcionar mas sem imagem dinamica, mas nesse caso eu não estou conseguindo, no caso esse código deixa as imagens rodando na tela, o que eu gostaria é que, quando clicasse abra em um light box segue abaixo o código que retirei de do site ffiles.com, fico no aguardo.

 


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; //set initial speed to not moving at all
var perspective:Number = 30;
var home:MovieClip = this;
var mouseRA:Number;
var mouseRB:Number;

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("item001","item001"+i,i+1);
	t.angle = (i * ((Math.PI*2) / numOfItems)) * -1; //listing direction
	t.onEnterFrame = mover;
	t.toolText = nodes[i].attributes.tooltip;
	t.linkName = nodes[i].attributes.linkadd;
	t.icon.inner.loadMovie(nodes[i].attributes.item);
	t.ref.inner.loadMovie(nodes[i].attributes.item);
	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()
{
//fscommand("exec", this._parent.linkName);
//trace(this._parent.toolText);
//flb.carrega(this._parent.linkName);

}





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

}

xml.load("database.xml");

function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (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.onMouseDown = function()
{
/*var dir = 1;
if(this._ymouse < centerY - 50)
{
	dir = -1;
}
speed = (this._xmouse-centerX)/15000 * dir;*/
mouseRA = this._xmouse;
}

this.onMouseUp = function()
{
mouseRB = this._xmouse;
if(mouseRA == mouseRB)
{
	speed = 0;
}
else
{
	if((speed < 0 && mouseRA > mouseRB) ||(speed > 0 && mouseRA < mouseRB))
	{
		speed = 0;
	}
	speed += (mouseRB-mouseRA)/7500 * -1;
}
}

 

 

Lembrando o clique fica nesse pedaço

 

function released()

{

//fscommand("exec", this._parent.linkName);

//trace(this._parent.toolText);

//flb.carrega(this._parent.linkName);

 

}

Compartilhar este post


Link para o post
Compartilhar em outros sites

Eu fiz o seguinte, no arquivo .php ou .htm, coloquei as imagens, <a href></a>, coloquei o js, css, tudo normal...

FIcaria assim entao:

 

<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="js/lightbox++.js" type="text/javascript"></script>
<script type="text/javascript">
function GroupDelegate(id) {
var objLink = document.getElementById(id);
Lightbox.prototype.start(objLink);
}
</script>

no html, coloco as iamgens

<a id="img1" title="O Conceito" rel="lightbox[img]" href="img/imagens1.jpg"></a>
<a id="img2" title="Portaria" rel="lightbox[img]" href="img/empreendimento3.jpg"></a>
<a id="img3" title="Fachada" rel="lightbox[img]" href="img/empreendimento1.jpg"></a>

 

 

no botao no .fla

on (release) {
getURL("javascript:GroupDelegate('img3')");
}

 

espero que ajude..

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.