************ MainのA Script ************


loadUrl = "s2.xml";// 読み込むXMLファイル名
this.fXMLInit();// XMLを初期化
this.stop();
System.useCodePage = true;// 初期化完了
menu_array = new Array();// メニュー変数群
function fXMLInit() {// 説明:menu_arrayを初期化
var aLoad_xml = new XML();// 読み込むXML
var aXML_obj = new Object();
aLoad_xml.load(loadUrl);
aLoad_xml.ignoreWhite = true;
aLoad_xml.owner_mc = this;
aLoad_xml.onLoad = function() {
aXML_obj = this.owner_mc.fXMLtoObject(aLoad_xml);// XMLをオブジェクト化
menu_array = aXML_obj.root[0].works[0].work;// メニュー変数群にset
};
}
function fXMLtoObject(in_xml) {
var out_obj = new Object();// XMLを配列形態のObjectに変換
for (var i in in_xml.attributes) {
out_obj[i] = in_xml.attributes[i];
}
var aNdName;
var aNdType;
var aNdValue;
var aChildNodes_array = in_xml.childNodes;// ノードを持つ場合は配列表示
for (var i = 0; i<aChildNodes_array.length; i++) {
aNdName = aChildNodes_array[i].nodeName;
aNdType = aChildNodes_array[i].nodeType;
aNdValue = aChildNodes_array[i].nodeValue;
if (aNdType == 3) {
out_obj.ndValue = aNdValue;
}
if (aNdType == 1 && aNdName != null) {
if (out_obj[aNdName] == null) {
out_obj[aNdName] = new Array();
out_obj[aNdName][0] = arguments.callee(aChildNodes_array[i]);// 再帰呼び出し
} else {
out_obj[aNdName].push(arguments.callee(aChildNodes_array[i]));
}
}
}
return out_obj;
}
function fSetTextNull () {
profile_mc.fSetText("","","");// profile_mcに文章をset
}
function fSetText() {
var aNow_num = Number(oldName.substring(3, 5));
var aTitle = menu_array[aNow_num-1].title;
var aProfile = menu_array[aNow_num-1].profile[0].name;
var aCaption = menu_array[aNow_num-1].caption[0].ndValue;
var aTemp_str = new String();
for (var i = 0; i<aCaption.length; i++) {
var a1Word = aCaption.charAt(i)
var a1Code = aCaption.charCodeAt(i)
if (a1Code != 9 && a1Code != 13 && a1Code != 10) {// "\t""\r""\n"ではない場合
aTemp_str += a1Word;
}
}
aCaption = aTemp_str
profile_mc.fSetText(aTitle, aCaption, aProfile);
}

var oldXS = 50;// Menuボタンの移動
var oldYS = 50;
var oldName = "sub01_mc";
function fMovePipopa(inX, inY, inXS, inYS, inName) {
var oldPos = selection_mc[oldName].fGetZeroPos();
var oldX = oldPos.x;
var oldY = oldPos.y;
var aX = lm_mc._x;
var aY = lm_mc._y;
var aXS = lm_mc._xscale;
var aYS = lm_mc._yscale;
pipopa_mc.fMove(oldX, oldY, oldXS, oldYS, inX, inY, inXS, inYS, aX, aY, aXS, aYS);
this.fSetOldMC(inName, inXS, inYS);
}
function fSetOldMC(inName, inXS, inYS) {
oldName = inName;
oldXS = inXS;
oldYS = inYS;
}
function fSetSelectColor() {
selection_mc.fSetSelectColor(oldName);
}
// ********* LoadとUnload **********************************
function fLoadMovie() {
var aNow_num = Number(oldName.substring(3, 5));// Loadすべき画像ファイル
var aJPG = menu_array[aNow_num-1].img[0].large;
lm_mc.fLoadMovie(aJPG);
}
function fUnLoadMovie() {
lm_mc.fUnLoadMovie();
}