PDA

View Full Version : Vizact.call error


jaylocco
07-23-2009, 02:12 AM
hi,

I got this problem..I kept on getting error with this code


action = vizact.sequence(vizact.call(Pushed.visible,True),v izact.call(PushedWalkBtn))
vizact.onpick( PushBox, Pushed.runAction, action)

def PushedWalkBtn():
stopcollide()
carPAUSEaction()
inviscar()


and the result says

action = vizact.sequence(vizact.call(Pushed.visible,True),v izact.call(PushedWalkBtn()))
NameError: name 'PushedWalkBtn' is not defined

to what I saw in Vizard help, the syntax should be no problem which is
<vizact>.call(
func
args
)

May I know what was the problem?

THANKs

farshizzo
07-23-2009, 09:49 AM
You are referencing the PushedWalkBtn function before you define it. That is why the error says PushedWalkBtn is not defined.

Just place the function definition above the action definition and it should work:def PushedWalkBtn():
stopcollide()
carPAUSEaction()
inviscar()

action = vizact.sequence(vizact.call(Pushed.visible,True),v izact.call(PushedWalkBtn))
vizact.onpick( PushBox, Pushed.runAction, action)

jaylocco
07-23-2009, 06:51 PM
hah...silly me...thanks for correcting..;)