ex10_RSS_Reader_6.swf |
ActionScript2.0(Flash Lite2.1)
index_xml = new XML(); index_xml.onLoad = startIndexMenu; index_xml.load("./feed.xml"); index_xml.ignoreWhite = true; function startIndexMenu(success) { if (success == true) { var item = index_xml.firstChild.childNodes; item.shift(); nodeNum = item.length; var temp:Array = []; _global.dateArray = new Array(); _global.creatorArray = new Array(); _global.titleArray = new Array(); _global.linkArray = new Array(); _global.descriptionArray = new Array(); for (i=0; i<nodeNum; i++) { temp[i] = item[i].firstChild; temp[i] = temp[i].nextSibling; _global.dateArray[i] = temp[i].firstChild.nodeValue; temp[i] = temp[i].nextSibling.nextSibling; _global.creatorArray[i] = temp[i].firstChild.nodeValue; temp[i] = temp[i].nextSibling; _global.titleArray[i] = temp[i].firstChild.nodeValue; temp[i] = temp[i].nextSibling; _global.linkArray[i] = temp[i].firstChild.nodeValue; temp[i] = temp[i].nextSibling; _global.descriptionArray[i] = temp[i].firstChild.nodeValue; } date = _global.dateArray[0]; creator = _global.creatorArray[0]; title = _global.titleArray[0]; link = _global.linkArray[0]; description = _global.descriptionArray[0]; _global.position = 0; } } rewindButton.onRelease = function() { if (_global.position == 0) { _global.position = 0; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } else { _global.position = _global.position-1; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } }; topButton.onRelease = function() { _global.position = 0; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; }; forwordButton.onRelease = function() { if (_global.position == (nodeNum-1)) { _global.position = (nodeNum-1); date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } else { _global.position = _global.position+1; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } }; var key_obj:Object = new Object(); key_obj.onKeyDown = function():Void { var code = Key.getCode(); // or getAscii() if (code == 52 || code == Key.LEFT) { if (_global.position == 0) { _global.position = 0; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } else { _global.position = _global.position-1; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } } else if (code == 53 || code == Key.UP) { _global.position = 0; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } else if (code == 54 || code == Key.RIGHT) { if (_global.position == (nodeNum-1)) { _global.position = (nodeNum-1); date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } else { _global.position = _global.position+1; date = _global.dateArray[position]; creator = _global.creatorArray[position]; title = _global.titleArray[position]; link = _global.linkArray[position]; description = _global.descriptionArray[position]; } } } Key.addListener(key_obj);
ダウンロード
0 件のコメント:
コメントを投稿