Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
0

Show value then game wheel stops.

Explorer ,
Jan 26, 2016 Jan 26, 2016

Good day for everyone;)

I have game wheel and I want that flash shows number in dynamic text field  then the vheel stops.

This is my wheel script for rotation:

var speed: Number = 0;

var minSpeed: Number = 0;

var maxSpeed: Number = 4;

var increaseNum: Number = 0.03;

var decreaseNum: Number = 0.01;

var clicked: Boolean = false;

var myMusic: Sound = new tiktak();

var Channel: SoundChannel;

var clickarea: Sprite = new Sprite();

clickarea.graphics.beginFill(0x000000, 0);

clickarea.graphics.drawRect(-500, 0, stage.stageWidth, stage.stageHeight);

clickarea.graphics.endFill();

clickarea.buttonMode = true;

clickarea.addEventListener(MouseEvent.MOUSE_DOWN, downHandler);

clickarea.addEventListener(MouseEvent.MOUSE_UP, upHandler);

addChild(clickarea);

function downHandler(e: MouseEvent): void {

  clicked = true;

    stage.addEventListener(Event.ENTER_FRAME, enterHandler);

   playSound();

}

function upHandler(e: MouseEvent): void {

  clicked = false;

}

function enterHandler(e: Event): void {

  ratas.rotation += speed;

  if (clicked) {

  increaseSpeed();

  } else {

  decreaseSpeed();

  }

}

function increaseSpeed(): void {

  speed = speed + increaseNum;

  if (speed > maxSpeed) speed = maxSpeed;

}

function decreaseSpeed(): void {

  speed = speed - decreaseNum;

  if (speed < minSpeed) speed = minSpeed;

  if (Channel && speed == minSpeed) {

  Channel.stop();

  

stage.removeEventListener(Event.ENTER_FRAME, enterHandler);

    var myMusicC: Sound = new taskai();

    SoundMixer.stopAll();

 

  myMusicC.play(0, 1);

    }

}

function playSound(): void {

  Channel = myMusic.play();

}

This is my wheel:

pastedImage_2.png

TOPICS
ActionScript
399
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2016 Jan 26, 2016

you need something (like an associative array) that relates ratas.rotation to the number on ratas.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2016 Jan 26, 2016

I have no idea how to do that

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2016 Jan 26, 2016

rotate ratas in the ide and note the number to be displayed

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 26, 2016 Jan 26, 2016

Oh ok. Sorry for my questions. I dont understand how to do it. It will be fine as it is. Thanks

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 26, 2016 Jan 26, 2016
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines