HI Kirupa
I have this main swf that was writen for flashplayer6 AS1.
Now i need it to load some swf with database integration and v.2 components so it was writen for player7 AS2.
The problem is that wend i load the movie with the components they behave strange (they work but have some bugs) , if i put it in a stand alone html it works fine.
Do I NEED Converting AS1 to AS2 ??? Because if i change the version player of the mais movie for version 7 it doesnot work.
The code it’s below:
Tanks in advance for your time
#include “lmc_tween_as1.as”
init();
_xscale = 140;
_global.out = function() {
trace(arguments);
};
function init() {
data = [];
srcfile = “menu.xml”;
loadXML(srcfile,data);
}
function loadXML(file, data) {
var source_xml = new XML();
var th = this;
source_xml.ignoreWhite = true;
source_xml.onLoad = function(success) {
th.parseXMLNode(this.firstChild,data);
th.buildMenu(th.main_mc,data);
};
source_xml.load(file);
}
function parseXMLNode(node, data_arr) {
for (var i = 0; i<node.childNodes.length; i++) {
var n = node.childNodes*;
var nodeObj = {};
for (var j in n.childNodes) {
switch (n.childNodes[j].nodeName) {
case “label” :
//trace(n.childNodes[j].nodeType)
nodeObj.label = n.childNodes[j].firstChild.nodeValue;
break;
case “data” :
nodeObj.data = n.childNodes[j].firstChild.nodeValue;
break;
case “subitems” :
nodeObj.subitems = [];
parseXMLNode(n.childNodes[j],nodeObj.subitems);
break;
}
}
data_arr.push(nodeObj);
}
}
function buildMenu(timeline, data) {
//
level = 0;
pagew = 100;
pageh = 100;
positions = [{x:1.9, y:0.1}, {x:2, y:1}, {x:1, y:2}, {x:1, y:1}, {x:0, y:2}, {x:0, y:1}, {x:2, y:0}];
//
timeline.setMask(mask_mc);
//
timeline.destx = timeline.desty=10;
timeline.desth = timeline.destw=300;
//
timeline.label = “ESAD Caldas da Rainha”;
timeline.page.onPress = function() {
main_mc.tween(["_width", “_height”, “_x”, “_y”],[this._parent.destw, this._parent.desth, this._parent.destx, this._parent.desty],1);
};
timeline.bg_mc._alpha = 40;
createPages(timeline,data);
}
function createPages(basepage, data) {
// compute scale
// attach clips
for (var i = 0; i<data.length; i++) {
var page = basePage.attachMovie(“page”, “page”+i+"_mc", basepage.$depth++);
page.num = i;
page.$depth = 1;
//
page._x = positions*.xpagew;
page._y = positions.ypageh;
page._width = pagew;
page._height = pageh;
//
page.label = data.label;
page.data = data*.data;
//
var pt = {x:+10, y:+10};
page.globalToLocal(pt);
page.destx = pt.x+10;
page.desty = pt.y+10;
//
page.desth = page.destw=Math.pow(3, level)910;
//
page.bg_mc._alpha = 20+(i5);
page.bg_mc.onPress = function() {
holder_mc.loadMovie(‘movie’+this._parent.label+’.swf’,100);
goToPage(this._parent);
};
//holder_mc.loadMovie(‘movie’+ this._parent.num +’.swf’, 77);
if (data*.subitems.length>0) {
level++;
createPages(page,data*.subitems);
level–;
}
}
}
function goToPage(page) {
if (page != zoomed) {
main_mc.tween(["_width", “_height”, “_x”, “_y”],[page.destw, page.desth, page.destx, page.desty],1,“easeinoutsine”);
zoomed = page;
} else {
goToPage(page._parent);
holder_mc.loadMovie(“movie”+page._parent.label+’.swf’,100);
}
}
_root.createEmptyMovieClip(“holder_mc”,100); //100=topmost level
holder_mc._x=10;
holder_mc._y=10;
//i reference number from the loop of objects
page.ref = 1;