[FONT=verdana, arial, helvetica][SIZE=2]I’ve set up a dynamic carousel that refers to an XML page for icon images and labels above called tooltips. I want to be able to click on the icons in the carousel that will then link me to another URL. But the only thing I want to have to change is the URL in the XML, not have to change anything in the flash file. What would be the actionscript for the released function? Thanks!
Here is the code for the carousel:
[/SIZE][/FONT]
import mx.utils.Delegate;
[COLOR=#000087]var[/COLOR] numOfItems:[COLOR=#000087]Number[/COLOR];
[COLOR=#000087]var[/COLOR] radiusX:[COLOR=#000087]Number[/COLOR] = 300;
[COLOR=#000087]var[/COLOR] radiusY:[COLOR=#000087]Number[/COLOR] = 75;
[COLOR=#000087]var[/COLOR] centerX:[COLOR=#000087]Number[/COLOR] = [COLOR=#000087]Stage[/COLOR].[COLOR=#000087]width[/COLOR] / 2;
[COLOR=#000087]var[/COLOR] centerY:[COLOR=#000087]Number[/COLOR] = [COLOR=#000087]Stage[/COLOR].[COLOR=#000087]height[/COLOR] / 2;
[COLOR=#000087]var[/COLOR] speed:[COLOR=#000087]Number[/COLOR] = 0.05;
[COLOR=#000087]var[/COLOR] perspective:[COLOR=#000087]Number[/COLOR] = 130;
[COLOR=#000087]var[/COLOR] home:[COLOR=#000087]MovieClip[/COLOR] = [COLOR=#000087]this[/COLOR];
[COLOR=#000087]var[/COLOR] tooltip:[COLOR=#000087]MovieClip[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]attachMovie[/COLOR]("[COLOR=blue]tooltip[/COLOR]","[COLOR=blue]tooltip[/COLOR]",10000);
tooltip.[COLOR=#000087]_alpha[/COLOR] = 0;
[COLOR=#000087]var[/COLOR] xml:[COLOR=#000087]XML[/COLOR] = [COLOR=#000087]new[/COLOR] [COLOR=#000087]XML[/COLOR]();
xml.[COLOR=#000087]ignoreWhite[/COLOR] = [COLOR=#000087]true[/COLOR];
xml.[COLOR=#000087]onLoad[/COLOR] = [COLOR=#000087]function[/COLOR]()
{
[COLOR=#000087]var[/COLOR] nodes = [COLOR=#000087]this[/COLOR].firstChild.childNodes;
numOfItems = nodes.[COLOR=#000087]length[/COLOR];
[COLOR=#000087]for[/COLOR]([COLOR=#000087]var[/COLOR] i=0;i<numOfItems;i++)
{
[COLOR=#000087]var[/COLOR] t = home.[COLOR=#000087]attachMovie[/COLOR]("[COLOR=blue]item[/COLOR]","[COLOR=blue]item[/COLOR]"+i,i+1);
t.angle = i * (([COLOR=#000087]Math[/COLOR].[COLOR=#000087]PI[/COLOR]*2)/numOfItems);
t.[COLOR=#000087]onEnterFrame[/COLOR] = mover;
t.toolText = nodes*.attributes.tooltip;
t.icon.inner.[COLOR=#000087]loadMovie[/COLOR](nodes*.attributes.image);
t.r.inner.[COLOR=#000087]loadMovie[/COLOR](nodes*.attributes.image);
t.icon.[COLOR=#000087]onRollOver[/COLOR] = over;
t.icon.[COLOR=#000087]onRollOut[/COLOR] = out;
t.icon.[COLOR=#000087]onRelease[/COLOR] = released;
}
}
[COLOR=#000087]function[/COLOR] over()
{
home.tooltip.tipText.[COLOR=#000087]text[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].toolText;
home.tooltip.[COLOR=#000087]_x[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_x[/COLOR];
home.tooltip.[COLOR=#000087]_y[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_y[/COLOR] - [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_height[/COLOR]/2;
home.tooltip.[COLOR=#000087]onEnterFrame[/COLOR] = Delegate.create([COLOR=#000087]this[/COLOR],moveTip);
home.tooltip.[COLOR=#000087]_alpha[/COLOR] = 100;
}
[COLOR=#000087]function[/COLOR] out()
{
[COLOR=#000087]delete[/COLOR] home.tooltip.[COLOR=#000087]onEnterFrame[/COLOR];
home.tooltip.[COLOR=#000087]_alpha[/COLOR] = 0;
}
[COLOR=#000087]function[/COLOR] released()
{
?????????????????????????
}
[COLOR=#000087]function[/COLOR] moveTip()
{
home.tooltip.[COLOR=#000087]_x[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_x[/COLOR];
home.tooltip.[COLOR=#000087]_y[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_y[/COLOR] - [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].[COLOR=#000087]_height[/COLOR]/2;
}
xml.[COLOR=#000087]load[/COLOR]("[COLOR=blue]icons.xml[/COLOR]");
[COLOR=#000087]function[/COLOR] mover()
{
[COLOR=#000087]this[/COLOR].[COLOR=#000087]_x[/COLOR] = [COLOR=#000087]Math[/COLOR].[COLOR=#000087]cos[/COLOR]([COLOR=#000087]this[/COLOR].angle) * radiusX + centerX;
[COLOR=#000087]this[/COLOR].[COLOR=#000087]_y[/COLOR] = [COLOR=#000087]Math[/COLOR].[COLOR=#000087]sin[/COLOR]([COLOR=#000087]this[/COLOR].angle) * radiusY + centerY;
[COLOR=#000087]var[/COLOR] s = ([COLOR=#000087]this[/COLOR].[COLOR=#000087]_y[/COLOR] - perspective) /(centerY+radiusY-perspective);
[COLOR=#000087]this[/COLOR].[COLOR=#000087]_xscale[/COLOR] = [COLOR=#000087]this[/COLOR].[COLOR=#000087]_yscale[/COLOR] = s*100;
[COLOR=#000087]this[/COLOR].angle += [COLOR=#000087]this[/COLOR].[COLOR=#000087]_parent[/COLOR].speed;
[COLOR=#000087]this[/COLOR].[COLOR=#000087]swapDepths[/COLOR]([COLOR=#000087]Math[/COLOR].[COLOR=#000087]round[/COLOR]([COLOR=#000087]this[/COLOR].[COLOR=#000087]_xscale[/COLOR]) + 100);
}
[COLOR=#000087]this[/COLOR].[COLOR=#000087]onMouseMove[/COLOR] = [COLOR=#000087]function[/COLOR]()
{
speed = ([COLOR=#000087]this[/COLOR].[COLOR=#000087]_xmouse[/COLOR]-centerX)/2500;
}