PDA

View Full Version : ** Function =() & Scene **



The_Vulcan
September 20th, 2003, 10:51 AM
I have a movie with a number of scenes.....
On the home scene there are a number of movie buttons that take you to different scenes....

From those scenes you can return to the home scene..... the problem is that when I attach the below code to the home scene... The buttons will take you to a different scene, but when you return to home, they stop working....

How is this code affecting the buttons, why do they work the first time you visit the scene, but then not when returning...

removing this code solves the problem, but I won't a work around, but as I dont know what the problem is I carn't figure it out.......

Any ideas ????




t1 = new Color(_root.t1);

myColorTransform = new Object();
myColorTransform = {ra: random(100) , ga: random(100) , ba: random(100) , aa: '100' };


_root.bb.onPress = function(){

myColorTransform = {ra: random(100) , ga: random(100) , ba: random(100) , aa: '100' };

t1.setTransform(myColorTransform);
}

kode
September 20th, 2003, 04:53 PM
I think you're overwriting the instance name of the movie clip (?) t1, since you're giving the same name to the Color object instance.

Try using a different name for the Color object instance.
var t1_color = new Color(_root.t1);

The_Vulcan
September 20th, 2003, 11:27 PM
Thanx Kode

That solved the problem....

I still dont understand why the goto_scene buttons work the first time you enter the home scene, but then not when returning...
Even if you hadn't use the change color button, it would still be stuffed......

kode
September 21st, 2003, 02:18 PM
You're welcome. ;)

And that's because the first time you define the Color object instance, t1 is still the instance name of the movie clip. When you return to that frame, t1 is no longer the instance name, but the Color object instance. Makes sense? :P