MsPepperMintUSA
Programmer
The background:
Trying to modify an application that utilizes the
Accessibility Xtra.
There are 3 different cast members with
just text that generate the list of pdfs.
Each word or group of words is a frame that references a criterion number.
I'll refer to the cast members Catergory 1, Category 2, and Category 3.
The exisiting code allows a user to select different words or groups of words. It's works great. Upon selecting the word or group of words, the displayed list of related PDFs will decrease or increase accordingly. The search can be refined by moving forward into the search (i.e. from Category 1 to Category 2 to Category 3).
I'm trying to capture the items from Category 1 and Category 2 so when my user clicks on my "back" button, it will know which words should be selected and which pdfs should be displayed.
I know I need to modify the following code by using the values from the property list, but have not identified how to save the values from the property list within the existing code. The code is called at the beginning of the frames for Category 1, Category 2 and Category 3
Any suggestions?
Thanks In Advance!
MsPepperMint USA
Below is the code:
global selectedCriteriaList, pdfPath, projList, pdfList, speechStatus, accessible, resultsActive, curResultLine
on startMovie
dosRegister("8FG4859-1ABMLJC")
speechStatus = voiceInitialize()
accessible = 0
if dosFindApp("pdf") = "" then
pdfPath = the pathname & "Reader\AcroRd32.exe"
else
pdfPath = dosFindApp("pdf")
end if
the floatPrecision = 1
selectedCriteriaList = []
generateProjectList
generatePDFList
end
on prepareMovie
the alertHook = script "Alert"
end
on readsearchresults
if resultsActive then
totalResultsNum = member("Matching List").line.count
if (the key).charToNum = 30 then
if member("Matching List").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine > 1 then
curResultLine = curResultLine-1
speakLine = "result number" && curResultLine & "." && member("Matching List").line[curResultLine]
voiceSpeak(speakLine)
else
voiceSpeak("You are at the beginning of the list")
end if
else if (the key).charToNum = 31 then
if member("matching list").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine < totalResultsNum then
curResultLine = curResultLine+1
speakLine = "result number" && curResultLine & "." && member("Matching List").line[curResultLine]
voiceSpeak(speakLine)
else
voiceSpeak("There are no more results")
end if
else if (the key).charToNum = 29 then
if member("Matching List").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine > 0 then
projectName = member("Matching List").line[curResultLine]
docPosition = getPos(projList, projectName)
if docPosition = 0 then
exit
end if
document = getAt(pdfList, docPosition)
docPath = "pdfs\" & document
open docPath with pdfPath
speakLine = "opening" && projectName & " P D F."
voiceSpeak(speakLine)
end if
end if
end if
end
on openPDF myPDF
docPath = the moviepath & "pdfs\prevention\" & myPDF
if accessible then
pdfPath = dosFindApp("pdf")
if pdfpath = "" then
voiceSpeak("Adobe Acrobat could not be found. Please visit the Adobe website at and download the Adobe Acrobat Reader to access this file.")
exit
end if
end if
open docPath with pdfPath
end
on generateProjectList
projList = []
repeat with lineNum = 1 to member("tier3").line.count
contents = member("tier3").line[lineNum]
-- parse project from data
dataOffset = offset("(",contents)
projectName = contents.char[1..dataOffset-2]
projList.append(projectName)
end repeat
end
on generatePDFList
pdfList = []
repeat with lineNum = 1 to member("PDFs").line.count
pdfName = member("PDFs").line[lineNum]
pdfList.append(pdfName)
end repeat
end
on checkCriterion clickCriterion
listPosition = getPos(selectedCriteriaList, clickCriterion)
if listPosition = 0 then
sprite(the clickon).blend = 70
append selectedCriteriaList, clickCriterion
else
sprite(the clickon).blend = 0
deleteAt(selectedCriteriaList, listPosition)
end if
changeCriteriaList
end
on checkCriterion508 clickCriterion, mySprite
listPosition = getPos(selectedCriteriaList, clickCriterion)
if listPosition = 0 then
sprite(mySprite).blend = 70
append selectedCriteriaList, clickCriterion
if accessible then
speakStatus = "Selected."
end if
else
sprite(mySprite).blend = 0
deleteAt(selectedCriteriaList, listPosition)
if accessible then
speakStatus = "D Selected."
end if
end if
curResultLine = 0
changeCriteriaList
totalResultsNum = member("Matching List").line.count - 1
if member("Matching List").line[1] = "" then totalResultsNum = 0
speakLine = speakStatus && "There are" && totalResultsNum && "results"
if accessible then
voiceSpeak(speakLine)
end if
end
on changeCriteriaList
matchingList = ""
clickedCriterion = float(clickedCriterion)
repeat with lineNum = 1 to member("tier3").line.count
contents = member("tier3").line[lineNum]
-- parse project from data
dataOffset = offset("(",contents)
projectName = contents.char[1..dataOffset-2]
dataset = contents.char[(dataOffset+1)..(contents.char.count-1)]
match = 1
-- match criteria against dataset
repeat with criterion = 1 to selectedCriteriaList.count
if dataset contains (getAt(selectedCriteriaList, criterion)) then
nothing
else
match = 0
exit repeat
end if
end repeat
if match = 1 then
matchingList = matchingList & projectName & Return
end if
end repeat
if selectedCriteriaList = [] then
sprite(4).member = "No Search"
member("Matching List").text = ""
member("Matching List").boxType = #fixed
else
sprite(4).member = "Search Results"
if matchingList = "" then
member("Matching List").text = "Your search has returned no results. Please remove some catagories to broaden the search."
member("Matching List").boxType = #fixed
else
member("Matching List").text = matchingList
if member("Matching List").text.line.count > 24 then
member("Matching List").boxType = #scroll
else
member("Matching List").boxType = #fixed
end if
end if
end if
Trying to modify an application that utilizes the
Accessibility Xtra.
There are 3 different cast members with
just text that generate the list of pdfs.
Each word or group of words is a frame that references a criterion number.
I'll refer to the cast members Catergory 1, Category 2, and Category 3.
The exisiting code allows a user to select different words or groups of words. It's works great. Upon selecting the word or group of words, the displayed list of related PDFs will decrease or increase accordingly. The search can be refined by moving forward into the search (i.e. from Category 1 to Category 2 to Category 3).
I'm trying to capture the items from Category 1 and Category 2 so when my user clicks on my "back" button, it will know which words should be selected and which pdfs should be displayed.
I know I need to modify the following code by using the values from the property list, but have not identified how to save the values from the property list within the existing code. The code is called at the beginning of the frames for Category 1, Category 2 and Category 3
Any suggestions?
Thanks In Advance!
MsPepperMint USA
Below is the code:
global selectedCriteriaList, pdfPath, projList, pdfList, speechStatus, accessible, resultsActive, curResultLine
on startMovie
dosRegister("8FG4859-1ABMLJC")
speechStatus = voiceInitialize()
accessible = 0
if dosFindApp("pdf") = "" then
pdfPath = the pathname & "Reader\AcroRd32.exe"
else
pdfPath = dosFindApp("pdf")
end if
the floatPrecision = 1
selectedCriteriaList = []
generateProjectList
generatePDFList
end
on prepareMovie
the alertHook = script "Alert"
end
on readsearchresults
if resultsActive then
totalResultsNum = member("Matching List").line.count
if (the key).charToNum = 30 then
if member("Matching List").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine > 1 then
curResultLine = curResultLine-1
speakLine = "result number" && curResultLine & "." && member("Matching List").line[curResultLine]
voiceSpeak(speakLine)
else
voiceSpeak("You are at the beginning of the list")
end if
else if (the key).charToNum = 31 then
if member("matching list").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine < totalResultsNum then
curResultLine = curResultLine+1
speakLine = "result number" && curResultLine & "." && member("Matching List").line[curResultLine]
voiceSpeak(speakLine)
else
voiceSpeak("There are no more results")
end if
else if (the key).charToNum = 29 then
if member("Matching List").line[1] = "" then
voiceSpeak("There are no results.")
else if curResultLine > 0 then
projectName = member("Matching List").line[curResultLine]
docPosition = getPos(projList, projectName)
if docPosition = 0 then
exit
end if
document = getAt(pdfList, docPosition)
docPath = "pdfs\" & document
open docPath with pdfPath
speakLine = "opening" && projectName & " P D F."
voiceSpeak(speakLine)
end if
end if
end if
end
on openPDF myPDF
docPath = the moviepath & "pdfs\prevention\" & myPDF
if accessible then
pdfPath = dosFindApp("pdf")
if pdfpath = "" then
voiceSpeak("Adobe Acrobat could not be found. Please visit the Adobe website at and download the Adobe Acrobat Reader to access this file.")
exit
end if
end if
open docPath with pdfPath
end
on generateProjectList
projList = []
repeat with lineNum = 1 to member("tier3").line.count
contents = member("tier3").line[lineNum]
-- parse project from data
dataOffset = offset("(",contents)
projectName = contents.char[1..dataOffset-2]
projList.append(projectName)
end repeat
end
on generatePDFList
pdfList = []
repeat with lineNum = 1 to member("PDFs").line.count
pdfName = member("PDFs").line[lineNum]
pdfList.append(pdfName)
end repeat
end
on checkCriterion clickCriterion
listPosition = getPos(selectedCriteriaList, clickCriterion)
if listPosition = 0 then
sprite(the clickon).blend = 70
append selectedCriteriaList, clickCriterion
else
sprite(the clickon).blend = 0
deleteAt(selectedCriteriaList, listPosition)
end if
changeCriteriaList
end
on checkCriterion508 clickCriterion, mySprite
listPosition = getPos(selectedCriteriaList, clickCriterion)
if listPosition = 0 then
sprite(mySprite).blend = 70
append selectedCriteriaList, clickCriterion
if accessible then
speakStatus = "Selected."
end if
else
sprite(mySprite).blend = 0
deleteAt(selectedCriteriaList, listPosition)
if accessible then
speakStatus = "D Selected."
end if
end if
curResultLine = 0
changeCriteriaList
totalResultsNum = member("Matching List").line.count - 1
if member("Matching List").line[1] = "" then totalResultsNum = 0
speakLine = speakStatus && "There are" && totalResultsNum && "results"
if accessible then
voiceSpeak(speakLine)
end if
end
on changeCriteriaList
matchingList = ""
clickedCriterion = float(clickedCriterion)
repeat with lineNum = 1 to member("tier3").line.count
contents = member("tier3").line[lineNum]
-- parse project from data
dataOffset = offset("(",contents)
projectName = contents.char[1..dataOffset-2]
dataset = contents.char[(dataOffset+1)..(contents.char.count-1)]
match = 1
-- match criteria against dataset
repeat with criterion = 1 to selectedCriteriaList.count
if dataset contains (getAt(selectedCriteriaList, criterion)) then
nothing
else
match = 0
exit repeat
end if
end repeat
if match = 1 then
matchingList = matchingList & projectName & Return
end if
end repeat
if selectedCriteriaList = [] then
sprite(4).member = "No Search"
member("Matching List").text = ""
member("Matching List").boxType = #fixed
else
sprite(4).member = "Search Results"
if matchingList = "" then
member("Matching List").text = "Your search has returned no results. Please remove some catagories to broaden the search."
member("Matching List").boxType = #fixed
else
member("Matching List").text = matchingList
if member("Matching List").text.line.count > 24 then
member("Matching List").boxType = #scroll
else
member("Matching List").boxType = #fixed
end if
end if
end if