Kai.S
Dabei seit: 20.12.2005
Ort: München
Alter: 41
Geschlecht:
|
Verfasst Fr 30.06.2006 11:30
Titel
|
|
|
Also mit dem Code bekomme ich eine ziemlich gleichmäßige Verteilung auf die 3 Cases:
http://home.arcor.de/zoom0815/random/test.html
Ihr auch? Liegt das an der Flashplayerversion evtl. ???
Code: | stop();
var var1 = 0;
var var2 = 0;
var var3 = 0;
var countto3 = 0;
var countto2 = 0;
_root.onEnterFrame = function () {
getRandom();
}
function getRandom()
{
_root.button_mc.onPress = function() {
delete _root.onEnterFrame;
_root.button_mc.onPress = function() {
_root.onEnterFrame = function () {
getRandom();
}
};
};
rand = Math.ceil(Math.random() * 3);
switch (rand)
{
case 1:
{
//trace("1");
var1++;
}
case 2:
{
//trace("2");
countto2++;
if (countto2 == 2){
var2++;
countto2 = 0;
}
}
case 3:
{
//trace("3");
countto3++;
if (countto3 == 3){
var3++;
countto3 = 0;
}
}
} // End of switch
} // End of the function
//_root.var1_text.txt = var1;
//_root.var2_text.txt = var2;
//_root.var3_text.txt = var3;
_root.button_mc.onPress = function() {
delete _root.onEnterFrame;
_root.button_mc.onPress = function() {
_root.onEnterFrame = function () {
getRandom();
}
};
}; |
versuchs doch mal damit ... aber erklären kann ichs mir immernoch nicht
Zuletzt bearbeitet von Kai.S am Fr 30.06.2006 11:32, insgesamt 1-mal bearbeitet
|
|