im trying to create a slot machine, im now in the stage were i want to try and put random icons on sliders on a push of the button, when i got that down i can get on to the other stuff in want to put in it. Problem is it doesn't do anything.
Quote
var muntje
var button
//functions
//Initialize
function Initialize(){
tellTarget ("/left_slide") {
gotoAndStop(1);
}
tellTarget ("/middle_slide") {
gotoAndStop(2);
}
tellTarget ("/right_slide") {
gotoAndStop(3);
}
}
//randomize
function Randomize(){
LeftChip = random(3);
tellTarget ("_root.left_slide") {
gotoAndStop(Number(LeftChip)+1);
}
CenterChip = random(3);
tellTarget ("_root.middle_slide") {
gotoAndStop(Number(CenterChip)+1);
}
RightChip = random(3);
tellTarget ("_root.right_slide") {
gotoAndStop(Number(RightChip)+1);
}
}
//calling functions
// Initialize
onEnterFrame(_root.Initialize());
Under a button i have put the script:
Quote
call("Randomize()");
}
it doesn't do anything however. It does initializes the sliders, they are put on frame 1 2 and 3 of their wanted fruits. I have used part of the code from another slot machine macromedia made, but they used frames to get to random fruits. I want to do it with function.
