Message Boards Message Boards

3 Replies
3 Total Likes
View groups...
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?

POSTED BY: Ernesto Espinosa
3 Replies

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

POSTED BY: Ernesto Espinosa

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.


POSTED BY: Ian Hojnicki
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract