Forum Moderators: open
The ActionScript used within the Flash file is:
import mx.utils.Delegate;
var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 30;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.03;
var perspective:Number = 250;
var home:MovieClip = this;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
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++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}
function over()
{
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}
function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}
function released()
{
trace(this._parent.toolText);
}
function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
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)/4500;
}
The XML file is this:
<icons>
<icon image="icon1.png" tooltip="Customer 1" />
<icon image="icon2.png" tooltip="Customer 2" />
<icon image="icon3.png" tooltip="Customer 3" />
<icon image="icon4.png" tooltip="Customer 4" />
</icons>
I tried changing the ActionScript code as follows (I actually need to have FLV files playing within the carousel items)
1. Replaced reference "image" with "video"
t.icon.inner.loadMovie(nodes[i].attributes.video);
t.r.inner.loadMovie(nodes[i].attributes.video);
2. Changed the XML file so I now have "video.xml" with the following code:
<?xml version="1.0" encoding="iso-8859-1"?>
<icons>
<icon video="video01.flv" tooltip="Customer 1" />
<icon video="video02.flv" tooltip="Customer 2" />
<icon video="video03.flv" tooltip="Customer 3" />
</icons>
However the SWF of the carousel now doesn't appear to load the videos (or show them, anyway), and trace() doesn't show up anything AFAICT.
Interestingly the objects do load- I can see their outlines if I do "Show redraw regions" within the SWF at runtime.
Is there a problem with displaying FLV files in this way? These appear to load as objects but will not display on the carousel…