I am working on my first CBT and am having to create some (in my mind)
complicated code. I have developed a solution that kinda, sorta works but am
hoping that some of you can suggest a more elegant and easier way to do
this. Please bear with me as this is hard to explain:

The CBT has many Chapter units which I am breaking up into a variety of
director movies (they eventually will become shockwave movies and played on
the web.) As part of the study guide, the client wants to have vocabulary
that is hyperlinked from text in each chapter movie to a  director movie
that contains the definitions (alphabetized of course) for the entire unit.

Each director movie contains 3 to four subchapters using markers to identify
them. The user clicks on a button to go to each topic in the chapter. To
save memory, I have set up the chapters to contain blank sprites that act as
portals for each topic. Each topic contains 3-4 buttons that illustrate the
points being discussed. When the user clicks on a button to see examples,
two sprite channels on the stage are replaced to show the appropriate
picture and text.

The text in each example is hyperlinked to the appropriate marker in the
vocabulary movie. The problem: The client wants the user to return to
exactly the same place in the CBT where they clicked on the hyperlinked
text. Since I am using blank sprites in the channels where the picture and
the text popup, I am unable to just return the the marker in the chapter
movie. I have to have the appropriate picture and text appear on the stage
as if the user never left it.

Well, I got this  to  work but, the scripting is awkward, inelegant and will
be very timeconsuming to execute as I have eight units made up of 10 to 20
subtopics per unit. One more thing, this CBT has to work as a conventional
CDRom as well as a Shockwave version, so I'm aware that some of the
scripting will need to change for the Shockwave verion.

Here's what I've done:
My first time using lists and basically I am building a list for every
single example contained in a segment.

I developed a Movie Script to initialize lists:

global gMarkerList, gMovieList, gtextList, gPictList, gPlist2, gTlist2,
gPlist3, gTlist3

on startMovie me
  gMarkerList = []---indentifies the marker
  gMovieList = []---identifies the movie

--the following is for marker 1 it only has one example with hyperlinked
text
  gtextList = []---this is for the first marker segment for example 1 text
  gPictList = []---this is for the first marker segment  Example 1 picture

--the following is for marker two where there are two examples with
hyperlinked text:
  gPlist2 = []--this is for the second marker segment for Example 1 picture
  gTlist2 = []--this is for the second marker segment for Example 1 text

  gPlist3 = []--this is for the second marker segment for Example 2 picture
  gTlist3 = []--this is for the second marker segment for Example 2 text
end

This is part of the hyperlinkScript on the sprite that contains the
hyperlinked text:

global gPlist2, gTlist2, gPlist3, gTlist3

on hyperLinkclicked me, data
  if sprite(the clickOn).memberNum = 127 then
    add gTlist2, (127)
  else if sprite (the clickOn).memberNum = 129 then
    add gTlist3, (129)
  end if
  if sprite(32).memberNum = 47 then
    add gPlist2, (47)
  else if sprite(32).memberNum = 48 then
    add gPlist3, (48)
  end if
  add gMarkerList, marker (0)
  add gMovieList, the  movie
  go to (data) of movie "BDvocab"---vocabulary movie
end 


This is the script on the back button from BDvocab (vocabulary movie):

global gMarkerList, gMovieList
on mouseUp me
  cursor 0
  set x = count (gMarkerList)
  if x = 0 then
    nothing
  else 
    set whichMarker = getAt (gMarkerList, x)
    deleteAt (gMarkerList, x)
    set whichMovie = getAt (gMovieList, x)
    deleteAt (gMovielist, x)
   
  end if
  
  go to frame whichMarker of movie whichMovie
end

This is the FRAMESCRIPT at the appropriate marker in the chapter movie:

global gPlist2, gTlist2, gPlist3, gTlist3

on prepareFrame me
  set x = count (gTlist2)
  set y = count (gPlist2)
  set w = count (gTlist3)
  set z = count (gPlist3)
  
  if x = 0 then
    nothing
  else
    
    set whichText = getAt(gTlist2, x)
    deleteAt (gTlist2, x)
  end if
  if y = 0 then
    nothing
  else
    
    set whichPict = getAt (gPlist2, y)
    deleteAt (gPlist2, y)
    sprite(2).memberNum = whichText
    sprite(32).memberNum = whichPict
  end if
  if w = 0 then
    nothing
  else
    set whichText = getAt(gTlist3, w)
    deleteAt (gTlist3, w)
  end if
  if z = 0 then
    nothing
  else
    set whichPict = getAt (gPlist3, z)
    deleteAt (gPlist3, z)
    sprite(2).memberNum = whichText
    sprite(32).memberNum = whichPict
  end if
  
  updateStage
end

I'm pleased to say it works, but as you can see its very lengthy and I know
there must be better ways to do this. Any suggestions would be greatly
appreciated!
Chris





[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email [EMAIL 
PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for learning and helping 
with programming Lingo.  Thanks!]

Reply via email to