Emergency Help

Thomas J McGrath III 3mcgrath at adelphia.net
Mon Jan 5 10:20:37 EST 2004


Hello to everyone here on the list.

I am in a slight panic this morning. Today is my deadline for the first 
version of my cross platform CD.

I am having a problem with a custom property. I call it pBeenVisited . 
I store whether we have visited this card before in it so that we don't 
have to listen to a voice over .wav file each time we come back to this 
card. In each open card I check the pBeenVisited and if we have not 
been here then I play the .wav voiceover but if we have been here then 
I don't play the .wav voiceover.

Seems pretty straight forward. PROBLEM:  I have a "Reset Voiceovers" 
menu item in case we do want to hear the voiceovers again. Well the 
script works and sets pBeenVisited to false so we can hear them again 
except for the card we are on. It changes this property for every other 
card but the one we are on when we select the menu item. (it is like a 
beenvisited is being sent to the card as soon as I tell it to not be 
beenvisited)

Does a menu or menu item act like an open card or close card???? That 
is the only thing I can think of.

---- in the menu
-snip-
  case "Reset Voiceovers"
     dobeenvisited
     break
end switch
-snip-

----- in the main stack
on dobeenvisited
   put the short name of this stack into lmystackname
   if lmystackname is "UnityCD" then
     repeat with c = 1 to the number of cards in stack "UnityCD"
       set the pBeenVisited of card c of stack "UnityCD" to False
     end repeat
   end if
end dobeenvisited

-- in the close card of each card
on closeCard
   play stop
   set the pBeenVisited of me to true -- been there
end closeCard

-- in the open card of each card with voiceovers
On openCard
   global gmySound
    put "media/03 Track 03.wav" into lmyPath
   if not the pBeenVisited of me then -- false not visited
     if gmySound then -- sound is true
       play audioClip lmyPath
     end if
   end if
   pass openCard
end openCard


Please, any help at this time is greatly appreciated.

Thank you

Tom

Macintosh PowerBook G-4 OSX 10.3.1, OS 9.2.2, 1.25 GHz, 512MB RAM, Rev 
2.1.2


Advanced Media Group
Thomas J McGrath III	• 2003 •	3mcgrath at adelphia.net
220 Drake Road, Bethel Park, PA 15102




More information about the use-livecode mailing list