Jump to content
Fórum Script Brasil
  • 0

Flash + php + mysql + lightbox com paginação


xShacka

Question

Galera SEGUINTE:

Carrego minhas informações através de uma AS q se conecta com um php q se conecta ao Bd:

var pos = 0;
var cont = 0;
var objEnvia = new LoadVars();
var objRecebe = new LoadVars();

rMovie._visible = false;

//////////////////////////////////
objRecebe.onLoad = function(ok)
{

    function checkScroll()
    {

        if (mc_cont._height > mask._height + 10)
        {

            rMovie._visible = true;
            scrollMc.init();

        }
        else
        {

            rMovie._visible = false;

        }

    }

    mc_cont.mc_forum._visible = false;
    if (this.tamanho == "0")
    {
        error._alpha = 100;

    }
    else
    {
        error._alpha = 0;
    }

    for (var b = 0; b < this.tamanho / 3; ++b)
    {

        mc_cont.mc_forum.duplicateMovieClip("mc_forum" + b,b,{});
        mc_cont["mc_forum" + b]._y = mc_cont["mc_forum" + b]._y + pos;

        //////////////////////////////////
        if (this["logo" + cont] == undefined)
        {
            mc_cont["mc_forum" + b].c1._visible = false;
        }
        else
        {

            load_imagem(this["logo" + cont],mc_cont["mc_forum" + b].c1.ft1.ftDentro,mc_cont["mc_forum" + b].c1.ft1);

            mc_cont["mc_forum" + b].c1.cliente.htmlText = this["cliente" + cont];
            mc_cont["mc_forum" + b].c1.cliente.autoSize = true;

            mc_cont["mc_forum" + b].c1.logoMaior = this["logomaior" + cont];
            mc_cont["mc_forum" + b].c1.cidade.htmlText = this["cidade" + cont];

            mc_cont["mc_forum" + b].c1.target = this["id" + cont];
            mc_cont["mc_forum" + b].c1.cliente = this["cliente" + cont];
            mc_cont["mc_forum" + b].c1.target2 = this["logomaior" + cont];

            posicao = cont;
            trace("posicao 1: " + posicao);
            mc_cont["mc_forum" + b].c1.onPress = function()
            {
                getURL("java script:abrirSB('img', '" + this.cliente + "', '" + this.target + "');");
            };
            mc_cont["mc_forum" + b].c1.onRollOver = function()
            {
                TweenMax.to(this.fd,2,{_alpha:70, ease:Strong.easeOut});
            };
            mc_cont["mc_forum" + b].c1.onRollOut = function()
            {
                TweenMax.to(this.fd,2,{_alpha:10, ease:Strong.easeOut});
            };
        }


        ++cont;

        if (this["logo" + cont] == undefined)
        {
            mc_cont["mc_forum" + b].c2._visible = false;
        }
        else
        {
            load_imagem(this["logo" + cont],mc_cont["mc_forum" + b].c2.ft2.ftDentro,mc_cont["mc_forum" + b].c2.ft2);

            mc_cont["mc_forum" + b].c2.cliente.htmlText = this["cliente" + cont];
            mc_cont["mc_forum" + b].c2.cliente.autoSize = true;

            mc_cont["mc_forum" + b].c2.cidade.htmlText = this["cidade" + cont];

            mc_cont["mc_forum" + b].c2.target = this["logomaior" + cont];
            mc_cont["mc_forum" + b].c2.cliente = this["cliente" + cont];

            posicao = cont;
            trace("posicao 2: " + posicao);
            mc_cont["mc_forum" + b].c2.onPress = function()
            {

                trace(this.target);
                getURL("java script:abrirSB('img', '" + this.cliente + "', '" + this.target + "');");

            };
            mc_cont["mc_forum" + b].c2.onRollOver = function()
            {
                TweenMax.to(this.fd,2,{_alpha:70, ease:Strong.easeOut});
            };
            mc_cont["mc_forum" + b].c2.onRollOut = function()
            {
                TweenMax.to(this.fd,2,{_alpha:10, ease:Strong.easeOut});
            };
        }


        ++cont;

        if (this["logo" + cont] == undefined)
        {
            mc_cont["mc_forum" + b].c3._visible = false;
        }
        else
        {

            load_imagem(this["logo" + cont],mc_cont["mc_forum" + b].c3.ft3.ftDentro,mc_cont["mc_forum" + b].c3.ft3);

            mc_cont["mc_forum" + b].c3.cliente.htmlText = this["cliente" + cont];
            mc_cont["mc_forum" + b].c3.cliente.autoSize = true;

            mc_cont["mc_forum" + b].c3.cidade.htmlText = this["cidade" + cont];

            mc_cont["mc_forum" + b].c3.target = this["logomaior" + cont];
            mc_cont["mc_forum" + b].c3.cliente = this["cliente" + cont];

            posicao = cont;
            trace("posicao 3: " + posicao);
            mc_cont["mc_forum" + b].c3.onPress = function()
            {
                trace(this.target);
                getURL("java script:abrirSB('img', '" + this.cliente + "', '" + this.target + "');");
            };
            mc_cont["mc_forum" + b].c3.onRollOver = function()
            {
                TweenMax.to(this.fd,2,{_alpha:70, ease:Strong.easeOut});
            };
            mc_cont["mc_forum" + b].c3.onRollOut = function()
            {
                TweenMax.to(this.fd,2,{_alpha:10, ease:Strong.easeOut});
            };
        }
        ++cont;
        /////////////////////////////
        mc_cont["mc_forum" + b].linha_dica._y = mc_cont["mc_forum" + b].foto1._height + 12;
        pos = pos + mc_cont["mc_forum" + b].linha_dica._y;
    }
    var scrollMc = new MDScroll(rMovie, mc_cont, mask);
    rMovie._visible = false;
    mc_cont.setMask(mask);
    checkScroll();
};
objEnvia.sendAndLoad(_global.php + "clientes.php",objRecebe,"POST");

///////////////////////////////// CARREGAR IMAGENS
function load_imagem(img, clip, clip2)
{
    clip._alpha = 0;
    clip2._alpha = 0;
    var w = clip._width;
    var h = clip._height;
    var fx = clip._x;
    var fy = clip._y;
    var b = new MovieClipLoader();
    var a = new Object();
    a.onLoadInit = function()
    {
        clip._x = fx + (w - clip._width) / 2;
        clip._y = fy + (h - clip._height) / 2;
    };
    a.onLoadProgress = function(clip, bytesLoaded, bytesTotal)
    {
        clip2.pct._alpha = 100;
        clip2.pct.htmlText = a + "%";
              var a = Math.round(bytesLoaded / bytesTotal * 100);
    };
    a.onLoadComplete = function()
    {
        TweenMax.to(clip2,2,{_alpha:100, ease:Strong.easeOut});
        TweenMax.to(clip,2,{_alpha:100, ease:Strong.easeOut});
    };
    b.addListener(a);
    b.loadClip(img,clip);
}
e tudo isso carrega normal e abre o lightbox o q eu quero fazer é abrir lightbox porem sem precisar sair da imiagem e clicar para abrir a outra simplesmente com a flexinha pra ir para a proxima e to usando shadowbox alguém teria como me ajudar ?! aa segue o php tb caso ajuda
<?php

include "conecta.php";

$sql="SELECT * FROM tbclientes ORDER BY cliente ASC";
$res = mysqlexecuta($id,$sql);
$var_url = "";
$n = 0;

// Mostrando valores
while($row = mysql_fetch_array($res)){
    $var_url .= "&id$n=".$row[0]."&cliente$n=".$row[1]."&cidade$n=".$row[2]."&logo$n=".$row[3]."&logomaior$n=".$row[4];
    $n++;
}
// Adicionando um valor com a quantidade de valores contidos nesta variável
$var_url .= "&tamanho=$n";

// Codificamos a string para UTF-8 e mostramos a string
print $var_url;

?>

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...