actionscript 1 to actionscript 2
- joeyd69
- Born


- Joined: Mar 14, 2007
- Posts: 2
- Status: Offline
i have created this flash file in flash 5, however i recently purchased flash mx and now as it uses actionscript 2.0 my game will not play.
can anyone help me convert my actionscript 1.0 script into actionscript 2.0 script
can anyone help me convert my actionscript 1.0 script into actionscript 2.0 script
Code: [ Select ]
boardxoffset = 0;
boardyoffset = 25;
tilewidth = 35;
tileheight= 35;
board = new Array();
board[0] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
board[1] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1);
board[2] = new Array(1, 2, 2, 2, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1);
board[3] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 1);
board[4] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 1);
board[5] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1);
board[6] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 0, 1);
board[7] = new Array(1, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 1);
board[8] = new Array(1, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 1);
board[9] = new Array(1, 0, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 1);
board[10] = new Array(1, 0, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 0, 1);
board[11] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1);
board[12] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
level = 10;
for (row = 0; row < board.length; row++) {
for (col = 0; col < board[row].length; col++) {
if (board[row][col] > 0) {
duplicateMovieClip ("tile" add board[row][col], "tile" add row add "_" add col, level++);
this["tile" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
this["tile" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
}
}
}
things = new Array();
things[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
things[1] = new Array(0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0);
things[2] = new Array(0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
things[3] = new Array(0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0);
things[4] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0);
things[5] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0);
things[6] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0);
things[7] = new Array(0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0);
things[8] = new Array(0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0);
things[9] = new Array(0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0);
things[10] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0);
things[11] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0);
things[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
targetscore = 90;
for (row = 0; row < things.length; row++) {
for (col = 0; col < things[row].length; col++) {
if (things[row][col] > 0) {
duplicateMovieClip ("thing" add things[row][col], "thing" add row add "_" add col, level++);
this["thing" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
this["thing" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
}
}
}
ghostStartCol = 13;
ghostStartRow = 1;
ghostSpeed = 4;
numGhosts = 4;
ghostColPositions = new Array();
ghostRowPositions = new Array();
for (num = 0; num < numGhosts; num++) {
duplicateMovieClip("ghost", "ghost" add num, level++);
ghostColPositions[num] = ghostStartCol;
ghostRowPositions[num] = ghostStartRow;
this["ghost"add num]._x = (ghostColPositions[num] * tilewidth) + boardxoffset;
this["ghost"add num]._y = (ghostRowPositions[num] * tileheight) + boardyoffset;
}
martynCol = 1;
martynRow = 1;
martynScore = 0;
martynLives = 3;
martynSpeed = 4;
martynWalking = 0;
duplicateMovieClip("martynRight", "martyn", level++);
martyn._x = martynCol * tilewidth + boardxoffset;
martyn._y = martynRow * tileheight + boardyoffset;
boardyoffset = 25;
tilewidth = 35;
tileheight= 35;
board = new Array();
board[0] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
board[1] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1);
board[2] = new Array(1, 2, 2, 2, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1);
board[3] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 1);
board[4] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 1);
board[5] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1);
board[6] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 0, 1);
board[7] = new Array(1, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 1);
board[8] = new Array(1, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 1);
board[9] = new Array(1, 0, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 1);
board[10] = new Array(1, 0, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 0, 1);
board[11] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1);
board[12] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
level = 10;
for (row = 0; row < board.length; row++) {
for (col = 0; col < board[row].length; col++) {
if (board[row][col] > 0) {
duplicateMovieClip ("tile" add board[row][col], "tile" add row add "_" add col, level++);
this["tile" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
this["tile" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
}
}
}
things = new Array();
things[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
things[1] = new Array(0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0);
things[2] = new Array(0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
things[3] = new Array(0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0);
things[4] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0);
things[5] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0);
things[6] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0);
things[7] = new Array(0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0);
things[8] = new Array(0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0);
things[9] = new Array(0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0);
things[10] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0);
things[11] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0);
things[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
targetscore = 90;
for (row = 0; row < things.length; row++) {
for (col = 0; col < things[row].length; col++) {
if (things[row][col] > 0) {
duplicateMovieClip ("thing" add things[row][col], "thing" add row add "_" add col, level++);
this["thing" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
this["thing" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
}
}
}
ghostStartCol = 13;
ghostStartRow = 1;
ghostSpeed = 4;
numGhosts = 4;
ghostColPositions = new Array();
ghostRowPositions = new Array();
for (num = 0; num < numGhosts; num++) {
duplicateMovieClip("ghost", "ghost" add num, level++);
ghostColPositions[num] = ghostStartCol;
ghostRowPositions[num] = ghostStartRow;
this["ghost"add num]._x = (ghostColPositions[num] * tilewidth) + boardxoffset;
this["ghost"add num]._y = (ghostRowPositions[num] * tileheight) + boardyoffset;
}
martynCol = 1;
martynRow = 1;
martynScore = 0;
martynLives = 3;
martynSpeed = 4;
martynWalking = 0;
duplicateMovieClip("martynRight", "martyn", level++);
martyn._x = martynCol * tilewidth + boardxoffset;
martyn._y = martynRow * tileheight + boardyoffset;
- boardxoffset = 0;
- boardyoffset = 25;
- tilewidth = 35;
- tileheight= 35;
- board = new Array();
- board[0] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
- board[1] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 1);
- board[2] = new Array(1, 2, 2, 2, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1);
- board[3] = new Array(1, 0, 0, 0, 0, 0, 2, 0, 2, 0, 2, 0, 0, 0, 1);
- board[4] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 1);
- board[5] = new Array(1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 0, 0, 0, 0, 1);
- board[6] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 0, 1);
- board[7] = new Array(1, 2, 2, 2, 0, 2, 2, 2, 2, 0, 0, 0, 2, 0, 1);
- board[8] = new Array(1, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 2, 2, 0, 1);
- board[9] = new Array(1, 0, 2, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 1);
- board[10] = new Array(1, 0, 2, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 0, 1);
- board[11] = new Array(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1);
- board[12] = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
- level = 10;
- for (row = 0; row < board.length; row++) {
- for (col = 0; col < board[row].length; col++) {
- if (board[row][col] > 0) {
- duplicateMovieClip ("tile" add board[row][col], "tile" add row add "_" add col, level++);
- this["tile" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
- this["tile" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
- }
- }
- }
- things = new Array();
- things[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- things[1] = new Array(0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0);
- things[2] = new Array(0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
- things[3] = new Array(0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0);
- things[4] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0);
- things[5] = new Array(0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0);
- things[6] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0);
- things[7] = new Array(0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0);
- things[8] = new Array(0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 0);
- things[9] = new Array(0, 1, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0);
- things[10] = new Array(0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0);
- things[11] = new Array(0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0);
- things[12] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
- targetscore = 90;
- for (row = 0; row < things.length; row++) {
- for (col = 0; col < things[row].length; col++) {
- if (things[row][col] > 0) {
- duplicateMovieClip ("thing" add things[row][col], "thing" add row add "_" add col, level++);
- this["thing" add row add "_" add col]._x = (col * tilewidth) + boardxoffset;
- this["thing" add row add "_" add col]._y = (row * tileheight) + boardyoffset;
- }
- }
- }
- ghostStartCol = 13;
- ghostStartRow = 1;
- ghostSpeed = 4;
- numGhosts = 4;
- ghostColPositions = new Array();
- ghostRowPositions = new Array();
- for (num = 0; num < numGhosts; num++) {
- duplicateMovieClip("ghost", "ghost" add num, level++);
- ghostColPositions[num] = ghostStartCol;
- ghostRowPositions[num] = ghostStartRow;
- this["ghost"add num]._x = (ghostColPositions[num] * tilewidth) + boardxoffset;
- this["ghost"add num]._y = (ghostRowPositions[num] * tileheight) + boardyoffset;
- }
- martynCol = 1;
- martynRow = 1;
- martynScore = 0;
- martynLives = 3;
- martynSpeed = 4;
- martynWalking = 0;
- duplicateMovieClip("martynRight", "martyn", level++);
- martyn._x = martynCol * tilewidth + boardxoffset;
- martyn._y = martynRow * tileheight + boardyoffset;
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
March 14th, 2007, 6:27 am
- IceCold
- Guru


- Joined: Nov 05, 2004
- Posts: 1254
- Loc: Ro
- Status: Offline
not relly sure, but it could be from the duplicateMovieClip.
Try to use it as: mc.duplicateMovieClip("new instance", depth);
Also instead of "add" instruction use "+".
i.e.:
duplicateMovieClip ("tile" add board[row][col], "tile" add row add "_" add col, level++);
will become:
var crtClip = this["tile" + board[row][col]];
crtClip.duplicateMovieClip("tile"+row+"_"+col, level++);
Try to use it as: mc.duplicateMovieClip("new instance", depth);
Also instead of "add" instruction use "+".
i.e.:
duplicateMovieClip ("tile" add board[row][col], "tile" add row add "_" add col, level++);
will become:
var crtClip = this["tile" + board[row][col]];
crtClip.duplicateMovieClip("tile"+row+"_"+col, level++);
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 2 posts
- Users browsing this forum: No registered users and 64 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
