# Do I NEED Converting AS1 to AS2?

**URL:** https://forum.kirupa.com/t/do-i-need-converting-as1-to-as2/171551
**Category:** Uncategorized
**Created:** [December 6, 2005, 2:20pm UTC](https://forum.kirupa.com/t/do-i-need-converting-as1-to-as2/171551 "2005-12-06T14:20:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![rui\_silva1](https://avatars.discourse-cdn.com/v4/letter/r/8e7dd6/32.png) [@rui\_silva1](https://forum.kirupa.com/u/rui_silva1)
#### Post date: [December 6, 2005, 2:20pm UTC](https://forum.kirupa.com/t/do-i-need-converting-as1-to-as2/171551/1 "2005-12-06T14:20:31Z")

</div>

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\*.x_pagew;  
page.\_y = positions_.y_pageh;  
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+(i_5);  
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;
