Kevin wrote

And you can't expect images to be
> displayed after the screen is refreshed (as it is regularly in the normal
> course of using any title) if you have set the directory to some value that
> means they can't be found.
Yes of course, but I have been resetting the directory on the fly and
correctly. . .proof? because it works on a Mac, flawlessly. But breaks on a
PC. I sent you the stack off list, but perhaps we can help some others on
this list with this discussion.

--Here we set the directory to a global gRootDir
global gRootDir,gQtVersion,gShow,gCurrentPhoto
on preopenStack --this is the main stack that opens on boot
  put the filename of this stack into stackLocation
  set the itemdel to "/"
  delete the last item of stackLocation
  put stackLocation into gRootDir
  set the directory to gRootDir
end preopenStack


> 
> Why do you need to set the directory at all?  We would only set the
> directory to multiple different values for a single title in exceptional
> circumstances.  
The repeat handler needs the file list. . .I went through the reference
stack for directory, path etc. but nowhere that I found (maybe I missed it)
could I get a list of file paths relative to the current directory/current
stack location. . . . Only a list if the file names (sans paths) for any
given current directory. There are externals that do this (get full path
file names from a given folder), but the ones I know of only work on a MAC
and I wanted to cut my teeth on MetaTalk and "get to grips with the
directory thing." And the code seemed so simple.
> I would go for ensuring it is the same as the standalone on
> startUp (something you only need to do for testing purposes in a
> non-standalone environment because this happens automatically when you run
> as a standaldone), then reference everything in paths relative to that.

We did that, as seen above in the preopenStack handler

Check it out. . .maybe there is a better way:

--User is on the Caribbean Card of the main stack, hits this button:
on mouseUp
  SlideShow dTrinidad, 240, "Tr4a_ssTrini.mp3"
end mouseUp

Mainstack script custom handler:
(may not be the most efficient code but it works on a MAC)
on SlideShow tPixFolder, theRate, theMusic
  open card 1 of stack "theater" --substack is opened.
  --music stuff next
   set the filename of player "musicPlayer" to "Innersearch CD/Media/" &
theMusic
  set the playLoudness of player "musicPlayer" to 100
  start player "musicPlayer"
     --next comes the directory "affair"
  put "Innersearch CD/Media/" & tPixFolder into tShowDir
  set the directory to tShowDir
     -- of course now all the fileName refs for pix in the main stack
     -- (underneath stack "Theater" at this time)  are broken
     -- because their fName references are in specific folders like
     -- "Innersearch CD/Background-final/" or whatever
     -- and if we closed the main stack now they would all be blank.
  
  put the files into gShow
      -- here is where I found no other choice but to reset the directory
      -- to get the file list to run the show with,
      -- 100's of images in different folders
      -- an absolute work group organizational requirement
      -- where topleveling the media would be chaos
      -- for my art director, digital image team
 

--now run the show

  put 1 into x
  set the filename of image "slideShow" to line 1 of gShow

  show image "slideShow"
  move image "slideShow" from -680,-680 to  400,270 in 40 ticks
  
  repeat until the mouse is down
    set the filename of image "slideShow" to  line x of gShow
    if x = the number of lines of gShow then
      exit repeat
    end if
    wait theRate ticks with messages
    put x + 1 into x
  end repeat
  repeat with x = 80 down to 0
    set the playLoudness of player "musicPlayer" to x
    wait 2 ticks
  end repeat
  hide image "slideShow" with shrink to center slowly
  set the loc of image 1 to -680,-680
  
  stop player "musicPlayer"
  --all the above works like charm!
  
close stack "theater"
  set the directory to gRootDir

   -- Bingo! on the Mac the directory is reset correctly,
   -- all images in the Mainstack appear properly after stack 2 closes
   -- but not on a PC, running Windows 2000.
     
end SlideShow

Now in Stack "Theater" we also have, which I put in later
just to be doubly sure, in case the above handler
didn't run through:

global gRootDir
on closeStack
  set the directory to gRootDir
end closeStack

Still didn't work for on a PC.


> There are no problems referencing sub folders with relative paths - to any
> level deep you desire.  Of course, if you are setting the directory to
> different places and setting the filenames of images that isn't going to
> work - they all need to be set relative to the one location.

If you can show me a better way than the above I would be happy to implement
it, but it DOES work on a MAC. . .and the code looks pretty sound. . .

> If you *do* need to set it, ensure you set it back at the end of the handler
> - if that isn't working, chances are your handler is either stopping part
> way through due to some bug, or the value you are setting the directory back
> to has a fault in it.

If that were true it would break on a Mac. If you like I can DHL overnite to
you in Scotland a copy of the CD. You have the raw .mc stack sent to you on
email last night.
 
> put the directory into tReturnDir --store a correct, valid value
> set the directory to tWhatever
> --do whatever
> set the directory to tReturnDir
> --now set the file names of any images you plan to set

Yes, I believe the script is doing that correctly. . .

Meanwhile we are burning CD's for those extension studies students we know
for sure are MAC users and praying to the Metacard Gods of Scotland to grant
us the grace of their insight so we can get them off to the all those who
use PCs before the winter solstice (smile, next week would be better!)

Thanks!
Hinduism Today

Sivakatirswami
Editor's Assistant/Production Manager
www.HinduismToday.com
www.HimalayanAcademy.com
[EMAIL PROTECTED]


Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to