Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flash site and dynamic images on php how to? 1

Status
Not open for further replies.

fizzak

MIS
Feb 6, 2003
331
0
0
US
Getting into dynamic sites with php is a bit over my head. I have a client that needs me to back engineer a site for a property he bought. I have the site swf decompiled back to FLA. The site had a photo gallery that calls an images.php file.

Code:
function prevAlbum()
{
    if (album > 0)
    {
        --album;
        showAlbum();
    } // end if
} // End of the function
function nextAlbum()
{
    if (album < albums - 1)
    {
        ++album;
        showAlbum();
    } // end if
} // End of the function
function showAlbum()
{
    album_txt.text = "ALBUM " + (album + 1) + " OF " + albums;
    var imgs = imgs_xml.firstChild.childNodes;
    var _loc3 = album * 6;
    for (var _loc1 = 0; _loc1 < 6; ++_loc1)
    {
        var _loc2 = mc["img" + (_loc1 + 1) + "_mc"];
        _loc2.init(imgs[_loc3 + _loc1]);
    } // end of for
} // End of the function
function show()
{
    setProperty("", _visible, true);
    if (!imgs_xml.firstChild)
    {
        imgs_xml.load("images.php");
    } // end if
} // End of the function
function hide()
{
    setProperty("", _visible, false);
} // End of the function
function clickAt(node)
{
    _root.content_mc.content3.loadImage(node);
} // End of the function
var album = 0;
var albums = 0;
var imgs_xml = new XML();
var mc = this;
imgs_xml.ignoreWhite = true;
imgs_xml.onLoad = function (suc)
{
    if (suc)
    {
        albums = Math.floor((this.firstChild.childNodes.length + 5) / 6);
        album = 0;
        showAlbum();
        clickAt(this.firstChild.firstChild);
    }
    else
    {
        trace ("Loading failure");
    } // end else if
};
hide();

Im guessing its supposed to load thumbnails into a 6 panel grid and pop them into a larger preview area to the right of said grid. I guess im asking how to code a php file to work with this code.

Appreciated.
 
A star to you sir for leading me in the right direction. I replaced the php with an xml file containing this code...

Code:
<gallery>
<src="images/img1.jpg" thumb="images/img1t.jpg"/>
<src="images/img2.jpg" thumb="images/img2t.jpg"/>
<src="images/img3.jpg" thumb="images/img3t.jpg"/> 
<src="images/img4.jpg" thumb="images/img4t.jpg"/>
<src="images/img5.jpg" thumb="images/img5t.jpg"/>
<src="images/img6.jpg" thumb="images/img6t.jpg"/>
<src="images/img7.jpg" thumb="images/img7t.jpg"/>
<src="images/img8.jpg" thumb="images/img8t.jpg"/>
<src="images/img9.jpg" thumb="images/img9t.jpg"/>
<src="images/img10.jpg" thumb="images/img10t.jpg"/>
<src="images/img11.jpg" thumb="images/img11t.jpg"/>
<src="images/img12.jpg" thumb="images/img12t.jpg"/>
</gallery>

The thumbs are now loading however I cannot get the enlargement click to work

Code:
function loadImage(n)
{
    node = n;
    img_mc.loadMovie(n.attributes.thumb);
    loaded = false;
    this.onEnterFrame = function ()
    {
        if (loaded)
        {
            if ((img_mc._alpha = img_mc._alpha + 3) >= 100)
            {
                this.onEnterFrame = null;
                loaded = false;
            } // end if
        }
        else if (img_mc._width)
        {
            loaded = true;
            img_mc._alpha = 0;
            img_mc.onRelease = function ()
            {
                getURL(n.attributes.src, "_blank");
            };
        } // end else if
    };
} // End of the function
function hide()
{
    setProperty("", _visible, false);
} // End of the function
function show()
{
    setProperty("", _visible, true);
} // End of the function
var loaded = false;
var node;
hide();

I can see that img_mc.loadMovie(n.attributes.thumb); is calling the "thumb" in the and getURL(n.attributes.src, "_blank"); is calling the enlarged view in a pop up window but I'm getting 404's on them. I'm not sure what i'm doing wrong here unless the AS version I'm using is incorrect..
 
Problem solved:
Code:
<src="images/img1.jpg" thumb="images/img1t.jpg"/>
Is incorrect
Code:
<img src="images/img1.jpg" thumb="images/img1t.jpg"/>
Fixes the pop up problem
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top