I have been working on my senior project that involves the creation of a CDF with multiple Manipulateexpressions. I need to protect my code so I have been trying to create/encode a package that will run the program. I have gotten the program to work flawlessly as a notebook in MMA, but as a CDF I get shadowing errors. I have 54 functions in the code and many of my functions use the same variables which are changed by the user input. I have tried to put all of the code in a single package then set the initialization of each Manipulate to the same package, but I get errors. It seems like I need to have a package for each Manipulate, then have a function at the beginning of the program to call each package. I am not sure. Here is a scaled-down version.

SuccessfulShotsFor has been giving me a ton of trouble. Once in a package, the value (which gets changed by the user input on the second Manipulate) takes on a different name which does not get passed on to the third Manipulate, which displays the images for the user to copy.

I am running these CDFs in Mathematica. I read about the $ContextPath, and I think that is the where the problem lies, but I am not experienced enough to implement the fix.

Thank you for the links, but I am using a package so that I can protect my code. I do not want anyone to be able to mess with the 20 pages or so of code I have. In addition, I cannot use one Manipulate, because I have nearly 30 different manipulate objects with different functions. Any ideas?
–
user8736Jul 30 '13 at 20:54

1

Have you tried the TrackedSymbols option in Manipulate? This specifies which variables will initiate changes in the Manipulate. Depending on how you have coded things, you may be able to specify only those that are needed within the given manipulate.
–
bill sJul 31 '13 at 0:25

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.