[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 / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Macromedia 8

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

Thread replies: 2
Thread images: 1
File: random.gif (178 KB, 878x279) Image search: [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

[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 / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK