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

HELP ME PLEASE

New Here ,
Jun 08, 2020 Jun 08, 2020

Copy link to clipboard

Copied

Hello everyone, I wanted to ask the whole community about a question I have, I am programming an educational game in as3 is about paths, the problem I have is that I put some lines as symbols that simulate "walls", something like a game of maze that when it hits the wall it goes to another frame to tell it to try again, and the problem is that when I rollover I move my mouse over these "walls" it goes to the other frame and I would like to know if there is some function that only when the click is pressed and dragging the mouse has the function of colliding and going to the other frame, that is to say that when the click is not pressed and passes over the "wall" it does not go to the other frame but if when pressed, will there be any function for that in As3? i need it for school is urgent please thanks. (I don't speak english sorry for the english traductor)

 

This is my code:

import flash.events.MouseEvent;

a1.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

function onMouseOver(e:MouseEvent):void {
mouseEnabled = true;
buttonMode = true;
gotoAndStop(103);
}


a3.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a4.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a6.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a7.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);


a9.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a10.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

 

a12.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a13.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a15.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a16.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a18.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a19.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

a21.addEventListener(MouseEvent.ROLL_OVER, onMouseOver);

Views

152

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
Community Expert ,
Jun 08, 2020 Jun 08, 2020

Copy link to clipboard

Copied

LATEST

Try this.

 

/* Click to Go to Frame and Stop
Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
Can be used on the main timeline or on movie clip timelines.

Instructions:
1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
*/

movieClip_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);

function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
{
gotoAndStop(5);
}

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