Hi everyone, I’m new to flash and actionscript and have been having a problem. I will try to explain the best I can.
I’m tring to have it when you click on a thumbnail, it loads a larger image over the scene.
Here is an example, since I’m sure that my desc. is awlful. link My scrolling thumbnails are based off of the tutorial on [URL=“http://www.kirupa.com/developer/mx2004/thumbnails.htm”]kirupa.com.
Here is my site. and action script. (architecture is only one that has any images on it currently for testing)
cliparray = [];
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
thumbnails = [];
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
thumbnails* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
image* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
thumbnails_fn(i);
}
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
// The scaleButton function takes 2 parameters. The name of
// the thumb thats being rolled over/out and the size to scale
// the thumb up or down by.
function scaleButton(btn:MovieClip, s:Number)
{
// We test this on every frame
btn.onEnterFrame = function()
{
// If the scale is at 95...
if(btn._xscale < s)
{
// then scale the thumb back up to 100(onRollOut)
btn._xscale += 1;
btn._yscale += 1;
}
// Otherwise, if the thumb is at 100...
else if(btn._xscale > s)
{
// scale the thumb down to 90(onRollver)
btn._xscale -= 1;
btn._yscale -= 1;
}
}
};
function thumbNailScroller() {
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 9;
var tot = 0;
tscroller.onEnterFrame = function() {
if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
if (_root._xmouse>=(hit_right._x-40)){
for (var obj in cliparray) {
cliparray[obj]._x -= scroll_speed;
}
if (cliparray[0]._x<-cliparray[0]._width) {
cliparray[0]._x = cliparray[cliparray.length-1]._x+cliparray[cliparray.length-1]._width+15;
var j = cliparray.splice(0, 1);
cliparray = cliparray.concat(j);
}
} else if (_root._xmouse<=(hit_left._x+40)) {
for (var obj in cliparray) {
cliparray[obj]._x += scroll_speed;
}
if (cliparray[cliparray.length-1]._x>hit_right._x) {
cliparray[cliparray.length-1]._x = cliparray[0]._x-(cliparray[cliparray.length-1]._width+15);
var j = cliparray.splice(cliparray.length-1, 1);
cliparray = j.concat(cliparray);
}
}
}
}
};
function thumbnails_fn(k) {
// Makes the filter available to use in the Movie.
import flash.filters.DropShadowFilter;
// Creates a variable with info about the Filter settings
// Distance, Angle, Color, Alpha, Blur X, Blur Y, Strength, Quality, Inner, Knock Out, Hide
var myDropShadowFilter = new DropShadowFilter (4,45,0x000000,.5,5,10,2,15,false,false,false);
// Applies the filter to the object named myObject
thumbnail_mc.filters = [myDropShadowFilter];
var yy = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
cliparray.push(yy);
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = 15+(target_mc._width+15)*k;
target_mc.pictureValue = k;
tot += target_mc._x;
target_mc.onRollOver = function() {
this._alpha = 70;
thumbNailScroller();
scaleButton(this, 95);
};
target_mc.onRollOut = function() {
this._alpha = 100;
scaleButton(this, 100);
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
Any advice and help with be greatly appreciated. I have been all over google with no luck.