Comments (4)
This definitely helps.
Thank you so much for that clarity. Cheers!
from theaterjs.
You could create the whole scenario once by adding each offers in a random order, something like:
// offers = list of strings
// random = function that returns a random int between min and max
while (offers.length) {
var randomIndex = random(0, offers.length);
var randomOffer = offers.splice(randomIndex, 1);
theater.addScene('jjbot:' + randomOffer);
}
// Add a replay scene to loop over the scenario
// when all ofers have been written
theater.addScene(theater.replay);
And then, you could stop the scenario after each scene and wait for the user to click the element to play the next scene.
Let me know if that works for you.
from theaterjs.
@zhouzi thanks for your help on this!
I'm stuck on the while
loop part. Is there any way to break out of the loop? The page just loads indefinitely for me.
from theaterjs.
I made a jsfiddle with comments: jsfiddle.net/2bu4h9v5. It should clear things up 👍
from theaterjs.
Related Issues (20)
- Callback that listen for scenes events should be able to delay execution of next scene HOT 1
- Disabling the erase option should still clear display value when relevant HOT 1
- Adding a 'showcase' to the readme HOT 3
- Are you using TheaterJS? HOT 3
- [bug]theater.replay not working anymore as of 2.2.0 HOT 5
- theater.previous()/.next() to instantly play the previous/next scene HOT 3
- What js files need to be imported? HOT 2
- theater.restart() to instantly replay the scenario from scratch HOT 3
- JS in demo not hosted over HTTPS HOT 1
- add "main" to package.json HOT 1
- Differentiation between erase and type speeds HOT 2
- Typing gets stuck / pauses on Chrome iOS HOT 5
- It would be stopped when the scene was more then 2 lines in safari , while take a long time ,all the scene will be appear HOT 3
- Unable to use theater js in Angular 2+ HOT 2
- Custom speed/accuracy function for a scene HOT 1
- Print scene by line HOT 3
- Initial value HOT 5
- A tool that mimicks system tools automatically ? HOT 5
- obj.onValuesChange not triggered if running project from core.getProject() HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from theaterjs.