Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : function call from array


iaustin
3/22/2006 11:39:05 PM
//The code appear to work but, it iwll not execute a function. (just copy &
paste the code into the actionscript window to see what i mean.

I've tried many verisos of the code with no success.

Any help would be greatly appreciated.

stop();
myArray = new
Array(0,1,"module1",2,3,"module2",4,5,6,"module3",7,8,9,10,11,12,"module4",13,13
0,14,15,16,17,"module4",18,19,20,21,22);//add or remove
step=0;//
onMouseDown = fnext;
function fnext(){
step++;
trace(step);
for(var n in myArray){
if(field1=myArray);
module1();
// switchpaths

function module1(){
if(field1="module1"){
mypath = "module1/contents/screen";
trace('hi');
trace("mypath now========================"+mypath);
}
}

function module2(){
if(field1="module2"){
mypath = "module2/contents/screen";
trace('hi');
trace("mypath now========================"+mypath);
}
}

function module3(){
if(field1="module3"){
trace('ho');
mypath = "module3/contents/screen";
trace("mypath now======================="+mypath);
}
}

function module4(){
if(field1="module4"){
trace('hie-de ho 4');
mypath = "module4/contents/screen";
trace("mypath now========================"+mypath);
}
}
}
//end

}
kglad
3/22/2006 11:45:47 PM
Jeckyl
3/23/2006 12:00:00 AM
Is this really what you meant to reply?

[quoted text, click to view]

iaustin
3/23/2006 12:12:44 AM
kglad
3/23/2006 3:23:43 AM
come on, what? it's not my fault your code doesn't work.

i have no idea what you're trying to do, it's not clear what field1 is or
whether it's defined and it's anything but clear what that for-loop is supposed
to do and it's unclear why there's no n used in your for-loop but it is almost
certainly problematic.
AddThis Social Bookmark Button