1

我目前正在开展一个项目,将我一天的活动放在一个 24 小时钟面周围。最后的结果是一个时间管理应用程序,它可以让你在一天中找到可以更熟练地使用的空间;然而; 我遇到了一些麻烦,那就是将每个电影剪辑(每个都代表一个活动)分配到钟面上的正确位置。

我正在使用 XML 文件从中提取时间,并且计算电影剪辑应放置在时钟上的角度是相对于中央电影剪辑完成的。

for (i = 0; i < TimeSheet.length; i++) { var counter = i + 1;

        sortXML(TimeSheet);
    }
}

}; 函数 sortXML(TimeSheet){

var activity = TimeSheet[i].firstChild.nodeValue;
var description = TimeSheet[i].firstChild.nextSibling.childNodes;
var HrStart = TimeSheet[i].firstChild.nextSibling.nextSibling.childNodes;
var MinStart = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.childNodes;
var HrEnd = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;
var MinEnd = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;

var place = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;
var creativity = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;
var usefulness = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;
var enjoyment = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;
var focus = TimeSheet[i].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;



category = TimeSheet[i].nodeName;


HourStart = parseInt(HrStart, 10);
MinuteStart = parseInt(MinStart, 10);
HourEnd = parseInt(HrEnd, 10);
MinuteEnd = parseInt(MinEnd, 10);

Creativity = parseInt(creativity, 10);
Focus = parseInt(focus, 10);
Usefulness = parseInt(usefulness, 10)

var TimeSpent = ((HourEnd*60)+MinuteEnd) - ((HourStart*60)+MinuteStart) ;
//var ActivityMinutes = (HourStart*60)+MinuteStart;
var TimeStart = (HourStart*60)+MinuteStart;
var BobPlacement = ((TimeStart/1440)*360) // where the bob gets blaced on the circle
//var BobPlacement = (360/1440)*TimeStart;

//var radius = 150 + Usefulness;
var radius = 200 + (Usefulness/2);
var xcenter = _root.bobCentral._x;
var ycenter = _root.bobCentral._y;
var degree = (BobPlacement + 180)*-1;;
var radian;

radian = (degree/180)*Math.PI;
newBob._x = xcenter+Math.cos(radian)*radius;
newBob._y = ycenter-Math.sin(radian)*radius;




/*trace("-----------------------------------");
trace("category = "+category);
trace("activity = " + activity);
trace("Description = " + description);
trace("time start = " + HourStart + ":" + MinuteStart);
trace("time end = " + HourEnd + ":" + MinuteEnd);
trace("Duration of activity = "+TimeSpent);

trace("place = "+ place);
trace("creativity = "+ creativity);
trace("usefulness = "+ usefulness);
trace("enjoyment = "+ enjoyment);
trace("focus = "+ focus);
trace("Time Started = "+ TimeStart);
trace("palce on circle = "+ BobPlacement);
*/

dupeMC(TimeSheet, category, activity, description, HourStart, MinuteStart, TimeSpent, Creativity, Focus, Usefulness);

} function dupeMC(TimeSheet, category, activity, description, HourStart, MinuteStart, TimeSpent, Creativity, Focus, Usefulness){

bob.duplicateMovieClip("bob"+i, i);

newBob = eval("bob"+i);

任何帮助将非常感激

如果我提出这个问题的方式令人困惑,我提前道歉。

4

0 回答 0