Message Boards Message Boards


Code in nb does not work in cdf preview

Posted 6 years ago
3 Replies
3 Total Likes

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

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.



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

    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]}] &}]

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

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract