Advertisement
Advertisement
| 02.27.2008 at 02:01AM PST, ID: 23196398 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: |
var dataXML:XML = new XML();//create xml object
var titleArr = new Array();//title array object
var urlArr = new Array();//url array object
var imgArr = new Array();//img array object
var originX = Stage.width / 2;//xPos of the middle node
var originY = Stage.height / 2;//yPos of the middle node
var DEPTH = 1000;
var perspective = 500;//change this to get different results
//this is how fast the items spin. The higher you go, the slower it goes.
//You can also make it a negative to get it to rotate the opposite way ie:
//var toRadians = Math.PI / -180;
var toRadians = Math.PI / 180;
fscommand("fullscreen", "true")
/*Load the XML Data*/
dataXML.ignoreWhite = true;
dataXML.onLoad = function() {
var pageLength = dataXML.firstChild.childNodes.length;//Length of XML
cursorLocation._visible = follower._visible = false;
origin._x = originX;
origin._y = originY;
for (i = 0; i < pageLength; i++) {
var title = dataXML.firstChild.childNodes[i].attributes.title;//title atr in the xml
var erl = dataXML.firstChild.childNodes[i].attributes.url;//url atr in the xml
var img = dataXML.firstChild.childNodes[i].attributes.isrc;//img atr in the xml
var title = title;
var erlArr = erl;
titleArr.push(title);//put titles into an array
urlArr.push(erlArr);//put urls into an array
imgArr.push(img);//put imgs into an array
}
buildUI();
};
dataXML.load("data.xml");
function buildUI() {
cursorLocation._visible = follower._visible = false;
origin._x = originX;
origin._y = originY;
for (var x = 0; x < titleArr.length; x++) {
temp = this.attachMovie("item", "item" + x, DEPTH++);
temp.id = x;
temp.txt.text = titleArr[x];
myImageHolder.loadMovie(nodes[i].attributes.isrc);
temp.xPosition = (240 - Math.random() * 480);
temp.yPosition = (100 - Math.random() * 50);
temp.zPosition = (100 - Math.random() * 160);
if (int(Math.random() * 100) % 2 > 0) {
temp.yPosition = temp.yPosition * -1;
}
temp.onRelease = function() {
getURL(urlArr[this.id]);
/////////////////////////////////////////////
/*Insert you're own onRelease function here*/
/////////////////////////////////////////////
};
temp.onRollOver = function() {
trace("You just rolled over "+titleArr[this.id]+imgArr[this.id]);
//////////////////////////////////////////////
/*Insert you're own onRollOver function here*/
//////////////////////////////////////////////
}
temp.onRollOut = function() {
trace("You just rolled over "+titleArr[this.id]);
/////////////////////////////////////////////
/*Insert you're own onRollOut function here*/
/////////////////////////////////////////////
}
this.attachMovie("connector","connector" + x,400 + x);
eval("connector" + x)._x = origin._x;
eval("connector" + x)._y = origin._y;
nodes.push(temp);
}
}
|