Page is a not externally linkable
galahad2 - 7:11 pm on Apr 7, 2008 (gmt 0)
The carousel is based on the ones demo'd at www.gotoandlearn.com. I followed the second of the tutorials and have got to the point where I've created a movie clip inside a movie clip inside a movie clip (required for the carousel) and have the accompanying ActionScript working, however when I preview the SWF file I only see the "filler shape" of the innermost movie clip, not the image file (.png) that it's supposed to contain. The three movie clips are called item (the outermost), icon (inside item) and inner (the innermost). The outermost one ("item") is the one set to "export to ActionScript". The images are grabbed from an XML file. The ActionScript is as follows: var numOfItems:Number; //don't declare yet as number of items will be read from XML var xml:XML = new XML(); xml.onLoad = function() for (var i=0;i<numOfItems;i++) xml.load("icons.xml"); function mover () The XML file: <?xml version="1.0" encoding="iso-8859-1"?> <icon image="icon1.png" /> <icon image="icon2.png" /> </icons> The XML file seems to be read (to a degree) by the ActionScript, because if I had a new "icon" item, the carousel "grows" another item accordingly (although as before, it only displays the background shape of the image "placeholder" movie clip). Amyone got any ideas?
I'm having a problem with a Flash carousel player which I'm trying to set up, where each of the carousel items is a different file (at present I'm trying to test with images but in time these will be FLV video files).
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 = 130; //skew the perspective so items further back are smaller
var home:MovieClip = this; //create variable to be used inside the XML for loop later as we can't use "this" inside that loop
xml.ignoreWhite = true;
{
var nodes = this.firstChild.childNodes; //i.e the XML file hierarchy
numOfItems = nodes.length;
for (var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.icon.inner.loadMovie (nodes[i].attributes.image); //load the image files
}
}
{
var t = this.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
}
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s:Number = (this._y - perspective)/(centerY + radiusY - perspective); //add the new perspective variable to the calculation
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)/2000;
}
<icons>