Message Boards Message Boards

0
|
10189 Views
|
3 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Code in nb does not work in cdf preview

The following code (attach) works in nb, but doent work in the cdf preview. Why? Is it the MessageDialog?

Attachments:
POSTED BY: Ernesto Espinosa
3 Replies

Your original example depends on a user evaluating the code in the notebook, which they cannot do in CDF Player. So to remove this requirement, you would need/want to use DynamicModule. And note the use of SaveDefinitions in the attached.

http://reference.wolfram.com/language/ref/DynamicModule.html

Ian

Attachments:
POSTED BY: Ian Hojnicki

Yes, I believe it is the MessageDialog. Here's a version that should work, provided you have the latest version of CDF player:

Manipulate[
 Column[{Labeled[
    NumberLinePlot[{n}, PlotRange -> {{-6, 6}, {-1, 1}}, 
     Ticks -> {{0}}], "x", Right], 
   Style[If[c, "Correcto", "Incorrecto", ""], "Subtitle"]}], {{n, -4, 
   ""}, {-4, 3, 0, -2, 5}, Slider}, {{c, Null, ""}, 
  Row[{Button["Positivo", c = Positive[n]], 
     Button["Negativo", c = Negative[n]], 
     Button["cero", c = n == 0]}] &}]
POSTED BY: Jesse Friedman

Thank You. I think the second parameter of the instruction

Dynamic [p1 (p1 = #; MiFp [#]) &]

is not working in CDF. It's a shame, because it provides a good window for better programming. For my purposes Manipulate seems limited.

I'll wait to see if this alleged error is corrected in the future. If so is the case.

I attach a new version without MessageDialog. Which of course does not work in CDF.

Best regards

Attachments:
POSTED BY: Ernesto Espinosa
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract