[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
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

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

banner
banner
[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.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.