PDA

View Full Version : Trouble with moving carousel


uweberer
12-13-2008, 08:33 PM
I have a flash carousel for a portfolio page on my website but I can’t get the thumbnail to stop moving when the mouse hovers over. This is the actionscript:
stop();
var folder:String = "thumbnails/"; // a folder for thumbnail files + an XML file
var total:Number;
var radiusX:Number = 310;
var radiusY:Number = 90;
var centerX:Number = 400;
var centerY:Number = 150;
var speed:Number = 0.005;
tn_group_mc._visible = false;
fm_label.text = ""; fm_url.text = "";

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
total = nodes.length;

for( var i=0; i < total; i++)
{
var t = tn_group_mc.duplicateMovieClip("tn"+i, i);
t.angle = i * ((Math.PI*2)/total);
t.onEnterFrame = mover;
t.tn_mc.inner.loadMovie( folder + nodes[i].attributes.filename );
t.tn_reflection_mc.inner.loadMovie( folder + nodes[i].attributes.filename );
t.fm_label = nodes[i].attributes.label;
t.fm_url = nodes[i].attributes.url;

t.fm_button.onRollOver = function()
{
fm_label.text = "Title: " + this._parent.fm_label;
fm_url.text = "URL: " + this._parent.fm_url;
}
t.fm_button.onRollOut = function()
{
fm_label.text = "";
fm_url.text = "";
}
t.fm_button.onRelease = function()
{
getURL(this._parent.fm_url);
}
}
}
xml.load( folder + "flashmo_thumbnails.xml");

function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = this._y /(centerY+radiusY);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
speed = (this._xmouse-centerX) * 0.0001;
}

onRollOver = function()
{
fm_button.stop();
}

Any help/advice would be great - and if I can do anything for you give me a shout on my website talentshare.co.uk.

rawmantick
12-15-2008, 06:43 AM
Please format your code. If you doin't help people to figure out your problem, why should they help you?