PDA

View Full Version : Assigning vars to MC instances


Bernie X
03-02-2002, 09:41 AM
The expression 'my_scene._alpha=100;' doesn't work.

If I use 'scene_01._alpha=100;' that works. Any suggestions?

function sceneSwitch (my_scene) {
// i=0;
// while (i<4){
if ( my_scene==_root.scene_01) {
my_scene=_root.scene_01;
my_scene._alpha=100;
// doesn't wrk
}
// else{
setProperty (main01, _alpha, 0);
// this works
// }
// i++;
// }
}

Billy T
03-02-2002, 01:15 PM
whatcha wanna do?

Bernie X
03-02-2002, 02:37 PM
Each button, on(release), calls the function sceneSwitch, and a passes a param to the function. For example:

//object aaction to go to scene_02 MC
on(release){
sceneSwitch(scene_02);
}

The function is suppose to chk the parameter vs other MCs

Here is the algorithm:

function sceneSwitch (my_scene) {

if ( value passed == a MC on the root) {
my_scene._alpha=100; //make the MC visible
}
}

Billy T
03-02-2002, 11:30 PM
are you using scenes or frame labels? Scenes cause problems when actionscripting...

pinkaboo
03-03-2002, 01:09 PM
[crosspost]

other thread (http://www.actionscript.org/forums/showthread.php3?s=&threadid=9709&highlight=function+sceneSwitch)

tg
03-03-2002, 04:50 PM
ya, this thread has been done two or three times with a slightly different wording each time.