Game Development Community

Why is this a parse error?

by Robert Carroll · in Torque Game Builder · 10/25/2009 (5:11 pm) · 4 replies

heres my first behavior I wrote on my own but the console says it has a Parse Error on line 31. Dose anyone know the parse error. Im a n00b so if its a stupid mistake you'll know why :)

if (!isObject(WP))
{
   %template = new BehaviorTemplate(WP);
   
   %template.friendlyName = "WP";
   %template.behaviorType = "Other";
   %template.description  = "goes to a website when clicked";



}

function WP::onBehaviorAdd(%this)
{
   %this.owner.setUseMouseEvents(true);
}

function WP::onBehaviorRemove(%this)
{

}

function WP::onMouseDown(%this)
{

}


function WP::onMouseUp(%this)
{
	gotoWebPage(/"www.mlb.com/");	
}

#1
10/25/2009 (5:21 pm)
Try that:
gotoWebPage("www.mlb.com/");
#2
10/25/2009 (5:29 pm)
/"

That's the problem. You probably want it to be:
"http://www.mlb.com"
instead.

EDIT: Damn you, O'Shea. and your instant posting!
#3
10/25/2009 (5:40 pm)
kk, thanks a lot I would have never guessed a slash...?
#4
10/26/2009 (4:41 am)
a parse error is when there is a problem with the parameters in your function call.