Forum Discussion
Loading an image at run time in Storyline
Hi Math - just read your code in more detail. Absolutely. I use a similar approach to load the card images into an array cards[ ] and I then read their descriptions into a second array descriptions [].
I do most of the hard work in the html page of the web object putting the JavaScript code there. I set up an event listener in the code to wait for the card to be clicked This triggers a routine that selects a random number (between 1 and the length of the card array) - I extract the card image and its description by 'splicing' each array to remove the card and description in question. I also add the selected card and description to two discard arrays so I can reset the original arrays when the deck runs out.
I have an event listener in the Storyline code and the web object sends the details of the selected card to Storyline each time a card is clicked. This is assigned to a variable which triggers the display on the screen.
I know you do a lot of fairly advanced games so this is probably not new to you - but the ability to send information from the web object to Storyline was a revelation for me!
I'm really looking forward to using this in many future advanced interactions.
All the best, John
Glad it helped a bit. I wished Storyline format would be a bit opener.
Kind regards,
Math