I have created a thumbnail in my photo gallery and all are working fine. thumbnails are on left side (Up-Down).
when i change category, by default thumbnail do not go to the first image.
Following is the scenario:
“Category1” button have 25 images
“Category2” button have 10 images.
Now i am on 15th image in “Category1” at that point, when i click on “Category2” command button, thumbnail loaded for “Category2” shows last few image of thumbnail. To see the first image of “Category2” i have to scroll up.
Can you please let me know what changes i have to made in this code; so it show the first thumbnail when i change category?
Following is the thumbnail code i am using.
function thumbnails_fn (k)
{
thumbnail_mc.createEmptyMovieClip (“t” + k, thumbnail_mc.getNextHighestDepth ());
tlistener = new Object ();
tlistener.onLoadInit = function (target_mc)
{
target_mc._y = hit_left._y + (eval (“thumbnail_mc.t” + k)._height + 5) * k;
target_mc.pictureValue = k;
target_mc.onRelease = function ()
{
p = this.pictureValue;
// Draw Picture
setPicture §;
};
target_mc.onRollOver = function ()
{
this._alpha = 50;
thumbNailScroller ();
};
target_mc.onRollOut = function ()
{
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader ();
image_mcl.addListener (tlistener);
image_mcl.loadClip (thumbnails[k], "thumbnail_mc.t" + k);
}
function thumbNailScroller ()
{
this.createEmptyMovieClip (“tscroller”, 1000);
scroll_speed = 10;
tscroller.onEnterFrame = function ()
{
if ((_root._xmouse >= thumbnail_mc._x) && (_root._xmouse <= thumbnail_mc._x + thumbnail_mc._width))
{
if ((_root._ymouse >= (hit_right._y - 40)) && (thumbnail_mc.hitTest (hit_right)))
{
thumbnail_mc._y -= scroll_speed;
}
else if ((_root._ymouse <= 100) && (thumbnail_mc.hitTest (hit_left)))
{
thumbnail_mc._y += scroll_speed;
}
}
else
{
delete tscroller.onEnterFrame;
}
};
}
Category1.onRelease = function ()
{
category_fn (“Category1”);
};
function category_fn (category)
{
if (_root.levelChild.childNodes[attr].attributes.Menu == category)
{
var loader:MovieClipLoader = new MovieClipLoader ();
var myListener:Object = new Object ();
loader.addListener (myListener);
loader.loadClip (info_xml[0].attributes.thumbnail, thumbnail_mc);
myListener.onLoadInit = function (target_mc)
{
setPicture (0);
for (i = 0; i < itemTotal; i++)
{
thumbnails* = info_xml*.attributes.thumbnail;
thumbnails_fn (i);
}
};
}
}
[URL=“http://www.actionscript.org/forums/editpost.php3?do=editpost&p=627406”]