Valentina Crashing Director

prothero prothero at geol.ucsb.edu
Mon Aug 20 15:18:52 CDT 2007


Ruslan or anybody:
I just got a copy of the Valentina Xtra for Director. It's very  
complete, but crashing Director, even with the Field_Media example. I  
have Director MX2004, running on an Intel Mac Pro.

Based on the Tutorial 1 and example in the Field_Example, I create an  
empty database using the "makeOrOpenImageDbase" method below. This  
creates the dbase and makes a table. Then, when I stop the movie, I  
close the database using the same method as the Field_Media example.

Is there anything I could be doing wrong? The log shows no errors in  
opening or shutting down the dbase.
Bill


--Parent script member
property iDb  --ref to image database

--a button click gets here.
on makeOrOpenImageDbase me
   dbFPath = _movie.path&"testImageDb.vdb"
   me.makeOrOpenDbase(dbFPath)
end

on makeOrOpenDbase me,dbFPath
   iDb = CreateOrOpenDatabase(dbFPath)
   if not objectP(iDb) then
     baAlert "Error creating image database: "&string()
     exit
   end if
end


--In a parent script member
--This has the db open and initialization scripts
----
property Valentina
property gDb
property macSN,winSN

--Create or Open a database
--This will either open or make a new dbase. The path to the dbase is  
dbPathName
on CreateorOpenDatabase me,dbPathName
   if not objectP(Valentina) then
     me.init()
   end if
   gDb = new(Xtra "VDatabase", #kLocal)
   --Try to open it and if it doesn't open, create it
   gDb.open(dbPathName)
   if Valentina.lastError then
     gDb.Create(dbPathName, #kDscDatBlbInd)
   end if
   if(not objectP(gDb)) then
     baAlert("Cannot create VDatabase Xtra!")
     return 0
   end if
   return gDb
end


on init me
   macSN = "myGoodMacSN"
   winSN = "myGoodWinSN"
   Valentina = 0
   gDb = 0
   me.InitValentina()
end

--
-- This is standard steps to init an example of V4MD.
--
on InitValentina me
   Valentina = new (Xtra("Valentina"))
   if not objectP(Valentina) then
     baAlert "Cannot set reference to Valentina Xtra!"
   end if
   -- Initialize database engine.
   Valentina.Init(8 * 1024 * 1024,macSN,winSn,"")
   if Valentina.cacheSize = 0 then
     baAlert ("Could not initialize Valentina. See V4MD_Log.txt file  
for errors")
     exit
   end if
   -- Turn on logging.
   Valentina.debugLevel = #kLogParams

   -- Examples display into the Message Window the user messages.
   -- So we disable output of debug messages into this window.
   Valentina.logToMessageWindow = true
   Valentina.logToFile(true, false)
end

--This is the method I use to make a dBase Table
on makeImageDbaseStructure me
   tblObj = iDb.CreateTable("mapImages")
   if checkForDbError() then exit
   tblObj.CreateVarCharField("imageName",64, #fIndexed)
   if checkForDbError() then exit
   tblObj.CreateShortField("lat")
   if checkForDbError() then exit
   tblObj.CreateShortField("lon")
   if checkForDbError() then exit
   tblObj.CreateVarCharField("symbolType", 32,#fIndexed)
   if checkForDbError() then exit
   tblObj.CreateVarCharField("symbolMemberName", 128,#fIndexed)
   if checkForDbError() then exit
   tblObj.CreateVarCharField("imageFileName",256,#fIndexed)
   if checkForDbError() then exit
   tblObj.CreateVarCharField("imageType",32,#fIndexed)
   if checkForDbError() then exit
   tblObj.CreatePictureField("image",1000,#fIndexed)
   if checkForDbError() then exit
end


William A. Prothero
Earth Education Online and
Univ Calif Santa Barbara
2106 Las Canoas Rd
Santa Barbara, CA. 93105
http://earthednet.org/





More information about the Valentina mailing list