UCE0001: ';' expected. Insert a semicolon at the end. BCE0044: expecting :, found ';'.

hello. I’m japanese studenrs. I try to make intaractive contents. such as traditional house game.
and now make TV. then
I confronted with this error. I try repeatedly. and I cant deal with it. Can someone help?

class ControlMovie extends MonoBehaviour
	 var movieTexture:MovieTexture[];	
	 var i:int=0;							
function Start()
		renderer.material.mainTexture = movieTexture*;*

_ audio.clip = movieTexture*.audioClip;_

function Update(){

if (movieTexture*.isPlaying &&Input.GetMouseButton(0) ){*

_ movieTexture*.Stop();

* i++;*

* if(i==6){ *

* i=0;*
* }*
_ renderer.material.mainTexture = movieTexture*;
audio.clip = movieTexture.audioClip;*_

_ }else(movieTexture*.Stop&&Input.GetMouseButton(0)){

* }*
* }*

> Blockquote

The problem that is causing this error is that you’re writing C# like javascript.

Variable declarations in C# are not the same as in javascript.
Instead of

 var movieTexture:MovieTexture[];  
 var i:int=0;     

the syntax is

MovieTexture[] movieTexture;
int i =0;

Now, once you fix that, you’ll have more problems, specifically:


movieTexture<em>.Stop is a function, and thus has to be called like movieTexture_.Stop() BUT it’s a function, so it can’t be called in the else block anyway. On top of that, there’s no condition that goes with else, only else if:
(My guess is that you want to see if it’s not playing)
}else if(!movieTexture*.isPlaying()&&Input.GetMouseButton(0)){
where the ! means “not”.
Now that I’ve looked at it for a minute, I think your if statement needs to be restructured like this, so that it’s not redundant:



renderer.material.mainTexture = movieTexture*;*
audio.clip = movieTexture*.audioClip;*
This logic says “If I clicked, Then check to see if the movie is playing. If it is, stop it. If it’s not start it.”
Now, once all those errors get fixed, you’re still going to have some problems, because you create an array of MovieTexture, but you never initialize that array. Perhaps you intend to initialize it from the editor, in which case it should be:
public MovieTexture[] movieTexture;
if you intend to do it from script though, you’ll have to say
MovieTexture[] movieTexture = new MovieTexture[10] ;//or whatever your size is