View Single Post
  #1  
Old 04-26-2009, 07:19 PM
DBurks2818 DBurks2818 is offline
Member
 
Join Date: Feb 2009
Posts: 8
Trouble transitioning from one vizard

...file to another.

Hey all,

I'm having a lot of trouble getting one vizard file to transition to another by way of a button. I was able to get it to work once, but now it will no longer work upon creating a new button and giving it the same functionality. I'm also putting all of this within a different scene from the main one, if that helps.

Code:
import viz
viz.go()
viz.clearcolor(0,0,1)

Next = viz.addButton()

def onButton(obj,state):
    if obj == Prev:
        if state == viz.DOWN:
         vizact.onbuttondown(Next, execfile('Vizard1.py'))
        else:
         Prev.remove()
         MainMenu.remove()
         Nxt.remove()
         Tutorial.remove()
         Previous.remove()
         MainBtn.remove()
         Next.remove()
viz.callback(viz.BUTTON_EVENT,onButton)
And 'Vizard1.py'...

Code:
import viz

viz.go()
viz.clearcolor(0,0,1)

building = viz.add('level1.3ds')
building.setPosition( 0, 0, 10)
building.setScale( 7.5, 7.5, 7.5 )
Why won't this work with the button I've created? Is there another/more efficient way to do this without just putting all of the code in one file and putting the entire destination file into the source file and using scenes?

It would be nice if someone could help me figure this out by Friday, as it's urgent.

Thanks for any help provided.

Last edited by DBurks2818; 04-26-2009 at 07:19 PM. Reason: Needed to fix title.
Reply With Quote