Using the above link, can anyone tell me how i can go about creating such an
animation using dynamic movie clips that are loaded from the library at
runtime? my movie clips are named mc1,mc2,mc3,mc4, and mc5. Any and all help
on this issue is appreciated. Thank you
___________
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412.243.9119
Thank you Rob, i went through the tutorials, and now have a working carousel
using part I of the tutorials......i would like to know however how to add
different items from the library into the carousel instead of just the same
item multiple times.
This is the code i have so far:
stop();
var numOfItems:Number= 5;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
//var perspective:Number = 150;
var tooltip:MovieClip = this.attachMovie ("tooltip","too;tip",1000)
tooltip._alpha = 0;
//var xml:XML = new XML ();
//xml.ignoreWhite = true;
//xml.onLoad( = function ()
//(
// var nodes = this.firstChild.childNodes;
// numOfItems = nodes.length;
// for (var i=0;i<numOfItems;i++)
// (
for (var i=0;i<numOfItems;i++)
{
var t= this.attachMovie ("item","item"+i,+i+1);
t.angle = i * ((Math.PI*2) / numOfItems);
t.onEnterFrame = mover;
}
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) / 1500;
}
Any suggestions as to what to add or change to achieve my goal? My items are
named item, item1, item2, item3, and item4 in the library. Any and all help is
appreciated. Thank you
Adapted from the code @ gotoandlearn.com.
var icons:Array = new Array();
icons.push("name1", "name2", "name3");
var numOfItems:Number = icons.length;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
for(var i=0; i<numOfItems;i++)
{
var t = this.attachMovie(icons[i], "item"+i, i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = 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)/1500;
}
var icons:Array = new Array();
icons.push("name1", "name2", "name3");
var numOfItems:Number = icons.length;
var radiusX:Number = 250;
var radiusY:Number = 75;
var centerX:Number = Stage.width/2;
var centerY:Number = Stage.height/2;
var speed:Number = 0.05;
for(var i=0; i<numOfItems;i++)
{
var t = this.attachMovie(icons[i], "item"+i, i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = this._y / (centerY+radiusY);