Fivez
asked on
passing variables
How can I pass variables to this function ? Now I've written the following:
_root.sector(foto, "Spector<br>Foto<br>België <br>uitgev oerd in 2002");
This does not work, the only thing working is declaring the variable before calling the function:
nieuwesector = "foto";
nieuweinfo = "Spector<br>Foto<br>België <br>uitgev oerd in 2002";
_root.sector(nieuwesector, nieuweinfo );
This is my function sector:
function sector(nieuwesector,nieuwe info) {
nsector = nieuwesector +"knop";
_root.nieuwesector._visibl e = true;
nieuwefoto = "po"+nieuwesector+"1.jpg";
fotoclip2.loadMovie("../Fl ash/foto/n ieuwefoto" );
_root.oudesector._visible = false;
_root.info = nieuweinfo;
oudesector = nieuwesector;
}
_root.sector(foto, "Spector<br>Foto<br>België
This does not work, the only thing working is declaring the variable before calling the function:
nieuwesector = "foto";
nieuweinfo = "Spector<br>Foto<br>België
_root.sector(nieuwesector,
This is my function sector:
function sector(nieuwesector,nieuwe
nsector = nieuwesector +"knop";
_root.nieuwesector._visibl
nieuwefoto = "po"+nieuwesector+"1.jpg";
fotoclip2.loadMovie("../Fl
_root.oudesector._visible = false;
_root.info = nieuweinfo;
oudesector = nieuwesector;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It does no longer work.....
nieuwesector, nieuweinfo,oudesector are variable declared in the top layer/1st frame of my movie,
the function below is also declared in that same layer/1st frame
function sector(nieuwesector,nieuwe info) {
_root.nieuwesector._visibl e = true; // does not work
_root.oudesector._visible = false; // works
nieuwefoto = "po"+nieuwesector+"1.jpg"; // works
fotoclip2.loadMovie("../Fl ash/foto/" +nieuwefot o); // works
_root.info = nieuweinfo; // works
_root.informatie._visible= true; // works
oudesector = nsector;
}
nieuwesector, nieuweinfo,oudesector are variable declared in the top layer/1st frame of my movie,
the function below is also declared in that same layer/1st frame
function sector(nieuwesector,nieuwe
_root.nieuwesector._visibl
_root.oudesector._visible = false; // works
nieuwefoto = "po"+nieuwesector+"1.jpg";
fotoclip2.loadMovie("../Fl
_root.info = nieuweinfo; // works
_root.informatie._visible=
oudesector = nsector;
}
*this*, is what you are trying to do:
function sector(nieuwesector,nieuwe info) {
_root[nieuwesector]._visib le = true; // this line
_root.oudesector._visible = false;
nieuwefoto = "po"+nieuwesector+"1.jpg";
fotoclip2.loadMovie("../Fl ash/foto/" +nieuwefot o);
_root.info = nieuweinfo;
_root.informatie._visible= true;
oudesector = nsector;
}
function sector(nieuwesector,nieuwe
_root[nieuwesector]._visib
_root.oudesector._visible = false;
nieuwefoto = "po"+nieuwesector+"1.jpg";
fotoclip2.loadMovie("../Fl
_root.info = nieuweinfo;
_root.informatie._visible=
oudesector = nsector;
}
If you have placed function in separate layer and you are calling it from some other layer. This will work if function layer is placed top. But, vice versa is not working. It may be loading problem i think... I don't know why?
I hope some Experts will explain about this.
Thanks