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

Action script 3 - help!

Guest
Jun 26, 2015 Jun 26, 2015

Copy link to clipboard

Copied

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

Views

242

Translate

Translate

Report

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

Copy link to clipboard

Copied

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);

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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 ?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

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