Error with SetNewMediaUrl of class MediaUrlChanger

0 views
Skip to first unread message

Carlos

unread,
Dec 14, 2009, 2:05:15 PM12/14/09
to realXtend
I`m using the samplemediaurl.py script with a MediaUrlChanger like
this:
"class MediaUrlChanger(rxactor.Actor):
def GetScriptClassName():
return "samplemediaurl.MediaUrlChanger"

def EventCreated(self):
super(self.__class__,self).EventCreated()
print "samplemediaurl.MediaUrlChanger"
self.MyMediaUrlPrim = None
self.MyMediaUrl = ""
self.RefreshData()

def EventTouch(self,vAvatar):
self.RefreshData()

if(self.MyMediaUrlPrim != None):
# self.MyMediaUrlPrim.SetNewMediaUrl(self.MyMediaUrl)
self.MyMediaUrlPrim.SetNewMediaUrl("http://www.theURL.com")
else:
print "Target prim for mediaurl change not found"

def RefreshData(self):
myfreedata = self.rexGetPrimFreeData()
paramlistlines = myfreedata.splitlines()

templocalid = self.GetPrimLocalIdFromUUID(paramlistlines[0])
self.MyMediaUrlPrim = self.MyWorld.GetActorByLocalID(str
(templocalid))
self.MyMediaUrl = paramlistlines[1]
"
The error message in the console when i run the script is:
"HandleEvent_TouchStart exceptions.SystemError Referencia a objeto no
establecida como instancia de un objeto. <traceback object at
0x038C0E57>"
Any ideas?
Thanks
Carlos Lorenzo

Mikko Pallari

unread,
Dec 15, 2009, 2:32:35 AM12/15/09
to realxtend
It would seem like that the variable MyMediaUrlPrim is null when the touch event is triggered. And since the MyMediaUrlPrim is fetched from the scene by id that is described in the RexPrimFreeData field, I would suspect that the error is in there.

Cheers,
Mikko

Reply all
Reply to author
Forward
0 new messages