[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y ] [Search | Home]
4Archive logo
Macromedia 8
If images are not shown try to refresh the page. If you like this website, please disable any AdBlock software!

You are currently reading a thread in /wsr/ - Worksafe Requests

Thread replies: 2
Thread images: 1
File: random.gif (178 KB, 878x279) Image search: [iqdb] [SauceNao] [Google]
random.gif
178 KB, 878x279
So, I recently aquired Macromedia Flash 8, and I've wanted to create a random text box, that would display one of several text dialogs at random.

However, I haven't been able to figure out a way to do so, and after searching for a solution online, the closest thing I've found to this is a number generator, which doesn't work quite the same way.

I should also note that I'm more-or-less oblivious to script code, but if you have any, I'll try my best to understand. Thanks in advance. :)
>>
>>31973
The code to select a word from a list of words at random would be something like this (this is javascript not actual actionscript, it is similar though, you'll have to check if actionscript has Math.random):


words = ["a word", "another word", "etc"];
max = words.length;
min = 0;
rand_index = Math.floor(Math.random() * (max - min)) + min;
selected_word = words[rand_index];

Then find a way to put the string selected_word into your text.
Thread replies: 2
Thread images: 1
Thread DB ID: 407802



[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vip /vp / vr / w / wg / wsg / wsr / x / y] [Search | Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the shown content originated from that site. This means that 4Archive shows their content, archived. If you need information for a Poster - contact them.
If a post contains personal/copyrighted/illegal content, then use the post's [Report] link! If a post is not removed within 24h contact me at [email protected] with the post's information.