Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
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);
}
Eu fiz o seguinte, no arquivo .php ou .htm, coloquei as imagens, <a href></a>, coloquei o js, css, tudo normal...
FIcaria assim entao:
no html, coloco as iamgens
no botao no .fla
on (release) {
espero que ajude..