I try to make an application for some sort of divination cards. There are 330 possible cards to draw. The user draws a card (moves with mouse from a picture representing the full stack), the card turns and randomly shows one of the 330 possible card texts.
In addition: each card has a short and a long explanation. When the user has drawn a card he can click/tap somewhere on the card and the short or long explanation pops up - depending where the user clicked.
During a session a maximum of 20 cards are drawn.
[number of card, text of card, short explanation of card, long explanation of card]]
The simplest way to program this, would be to have an object or symbol “Card” and create instances for each drawn card on the fly. As far as I understand, that is not possible in Hype 3 (right?).
My next idea was, to prepare 20 cards C1 … C20 (in Hype 3 these are text fields with some design, so it looks better). At the beginning of a session they are all hidden. When a user draws a card from the stack for the i-th time, (1) randomly a card number of one of the 330 cards is computed, then (2) the text of the next prepared card Ci is replaced by the text of the selected card number, then (3) Ci is made visible and the user sees what card he has drawn.
Then I discovered, that the function hypeDocument.setElementProperty does not allow to change the text of an element (that would be innerHTML). Only the position and size related properties can be changed.
Now I am stuck. Does that mean, I have to prepare a textfield for each single possible text of the 330 cards?
And if I cannot change the text of the card, then I also cannot change the text of a field for the short (or long) explanation. So do I have to put all these texts in advance in separate text fields? That would make a total of 990 textfields, the content of which I have to copy by hand into fields in Hype 3.
In addition: the system comes in (at least) 3 languages - now we have 2970 text fields… ?
I hope I have not seen the right thing - or Hype 3 might not be the right tool for this kind of application
Thanks for all hints.