Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Action script 3 - help!

Guest
Jun 26, 2015 Jun 26, 2015

What should I add to the " pkta1122 " to click on the button " guzik2 " did not cause
function " pkt1123 " ???
If I click on the " guzik2 " is a scene jumps into my 196 and I want to go to 271 .


[URL=http://www.iv.pl/][/URL]


Please help!


THX!

TOPICS
ActionScript
296
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
Guest
Jun 26, 2015 Jun 26, 2015

This is my code:

stop();

guzik2.addEventListener(MouseEvent.CLICK, pkta1122);

function pkta1122(mojezdarzenie:MouseEvent): void {

  gotoAndPlay(271);

}

function pkta1123(mojezdarzenie:MouseEvent): void {

  gotoAndStop(196);

}

guzik2.addEventListener(MouseEvent.MOUSE_OUT, pkta1123);

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
Enthusiast ,
Jun 26, 2015 Jun 26, 2015

You have two listeners on the same button. If you click on the button and don't move the mouse off the button, then you will go to 271. But as soon as you move off, you will cause the MOUSE_OUT to happen and go to 196.  If you only want to go to 271 then remove the second listener.

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
Guest
Jun 26, 2015 Jun 26, 2015

My intention was that there were 2 operations to a single button.

Clicking and not moving function also immediately proceeds to the scene 191 .


Maybe there is another solution to assign two functions to a single button ?

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
Enthusiast ,
Jun 26, 2015 Jun 26, 2015
LATEST

You are doing something else wrong then. The pkta1123 function will not be executed until the mouse is moved off the button.

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