How to make the buttons doesn't work in every scene?

Hello

I created four separate buttons (actionscript3) and I coded each button so when one is active, it climbs to a different scene. The four buttons are present on all the stages (I copy - paste all the buttons of the original scene at each additional stage) so I was hoping that, whatever the stage, the user can click on each button to operate. Each button works on the first click (the first stage), but the question is when that one is turned on and the buttons, it climbs to a new scene is no longer are clickable (roll over the State remains functional, but none of them work to be clickable to access another scene). I copy / paste my code used below, I hope this question makes sense, I want to just that my buttons to work independently of the scene. Thank you!

Here are the codes that I used, I placed it on the first frame of the first scene:

tulip_btn.addEventListener (MouseEvent.CLICK, onClick);

function onClick(e:MouseEvent) {}

gotoAndPlay (1, "scene 2");

}

rose_btn.addEventListener (MouseEvent.CLICK, onCami);

function onCami(e:MouseEvent) {}

gotoAndPlay (1, "scene 4");

}

lily_btn.addEventListener (MouseEvent.Click, onLily);

function onLily(e:MouseEvent) {}

gotoAndPlay (1, "scene 5");

}

poppy_btn.addEventListener (MouseEvent.CLICK, onPoppy);

function onPoppy(e:MouseEvent) {}

gotoAndPlay (1, "scene 6");

}

When you go to another scene, it's as if it's a new button, which does not have the mouse listener. If you were using a movieclip instead of a button, you can place the script inside the movieclip. It would be wise add the listener when the movieclip is added to the scene and remove the listener when it is removed.

There is a different way, you may work well. You can name your buttons and the same scenes. Then, in the intro scene, you could have a script like this:

import flash.events.MouseEvent;

Stop();

stage.addEventListener (MouseEvent.CLICK, clicked);

function clicked (e:MouseEvent) {}

gotoAndPlay(1,e.target.name);

}

Now you can copy the four buttons, which might be called rose, Lily, Tulip, poppy, and clicking on any one of them would you bring to the scene with the same name.

Tags: Adobe Animate

Similar Questions

  • How to make the button to set the properties of auto-scale one of the Axes on the graphical indicator so I can turn on or off when I press on it. In the Labview web UI designer

    How to make the button to set the properties of auto-scale one of the Axes on the graphical indicator so I can turn on or off when I press on it.

    I need to change the adjustment vaguely Autoscale property for my graphic indicator. Can someone help me please.

    Thank you!

    Hello

    I have confirmed that there is currently no way programmatically enable/disable autoscaling for axes on the LabVIEW graphical indicator generator of the user Web interface. We noted this to possibly be implemented in the future; Sorry for the inconvenience.

  • How to make the button script in Illustrator?

    Dear all,

    Recently, I always use Illustrator 2 free, script text are: "joinTextFrames" & "divideTextFrame".

    but I lost a lot of step to do

    for example, click: 1. Select text-> 2. File-> 3. Script-> 4. Another script-> load a script

    Fastest way-> Ctrl + F12-> load a script

    But now I want to do is the key 2 'joinTextFrames' & 'divideTextFrame '. The same way "mode button" in stock for faster work.

    How to make or solution to make? I really need it for my work.

    Thanks for your help.

    Save your scripts folder in the scripts, like that they'll show in the file-> Scripts Menu. Then, save the two actions to run each script, each gives a shortcut key (i.e. & F3 F2) or run the Mode button if you want to.

    Note that you need to re - register the action every time that you restart illustrator.

  • Re: How to make the Web Cam to work on satellite C660?

    I have a satellite C660 with built-in webcam... How to make this work?
    Nothing on my lap top that looks remotely connected to it. I confess that I'm fairly new to all this, but not daft I.m :)

    Thanks in advance
    Karen

    Hi Karen

    How do you use the webcam?

    With Skype maybe?

  • How to make the button whith a dynamic textfield on the front?

    Hi, can anyone help?

    When I put a dynamic texfield in the face of a button, it blocks the action.

    If I include the textfiel in the button, I have can´t change the text later.

    Thank you!

    disable your button mouseChildren property.

  • does anyone know how to get the webcam doesn't work on a samsung sv510

    I can't find the webcam in the programs. I can't make it work, does anyone know how? Help, please

    Hello, Damienmelarkey,

    -Come on in and START then all PROGRAMS, you should see a built in CyberLink YouCam, click on this program.
    -Follow the instructions to register, it's super quick and easy, all you have to do is to register your name and email address.
    -Follow through with the directions from there and it should be operational.

    Locate the manuals, drivers and support forum Samsung

    http://www.Samsung.com/us/support/

  • Make the button generate code work in a loop

    I am trying to generate instances of a movieclip in my library on the stage and give them all the single variable and instance names in order to control later and perform certain actions based on the name of the clicked button. I can do it with the following code, but I wanted to use a loop instead to be more effective. Can someone help me to make this code work in a loop? Thank you!

    (labor code)

    var image1_mc:testButton;
    var image2_mc:testButton;
    var image3_mc:testButton;
    var image4_mc:testButton;

    image1_mc = new testButton ();
    image1_mc. Name = "image1_mc"; the name of the instance
    image2_mc = new testButton ();
    image2_mc. Name = "image2_mc";
    image3_mc = new testButton ();
    image3_mc. Name = "image3_mc";
    image4_mc = new testButton ();
    image4_mc. Name = "image4_mc";

    addChild (image1_mc);
    addChild (image2_mc);
    addChild (image3_mc);
    addChild (image4_mc);

    image2_mc.x = 50;
    image3_mc.x = 100;
    image4_mc.x = 150;
    image1_mc.y = 500;
    image2_mc.y = 500;
    image3_mc.y = 500;
    image4_mc.y = 500;


    (Here is my attempt of a loop, but it does not of course because I'm not sure that it is even possible to use a variable to name a variable: D)

    for (var i: Number = 0; i < 4; i ++)
    {
    var (' _mc image "+ (i + 1) +" "): testButton = new testButton();
    addChild ("image"+(i+1) +"_mc");
    'image' +(i+1) + "_mc".name = "image" + (i + 1) + "_mc";
    'image' +(i+1) "_mc".x plus i * 75;
    }

    Hey thanks that pointed me in the right direction. I had not yet used the tables. I managed to do the work. It generates now 4 buttons which return unique names when you press. I also added within the table event listeners. Yet more concise! Here's the code: (interesting bands forum [of the] media if you do not attach code: D)

  • How to make the button response loop long wait?

    Hello

    I have a while loop to perform certain tasks sequence every few minutes and stops before pressing the STOP button.

    In this example, TASK1 and TASK2 will be executed at each 100000ms. But I find that if the user press STOP during the last picture (waiting) it won't answer quick and the termination of the application. Any way to accomplish this judgment and make highest priority? Thank you.


  • HP officejet 6500 has more: press the button doesn't work is not on the right side

    Hi I tried to turn on my printer and it is stuck on maintenance mode and will not work my right from the touch pad is there a replacement for the touchpad or a way around the mainenance mode?

    Hello @jgrier1,

    Welcome to the forums of HP.

    I understand that your printer is stuck on maintenance mode and the touchpad is not responding.

    I would like to help.

    I'm sorry, but the display on the Officejet 6500 has more, is not a replaceable part by the user.

    Try to go through the document next to the touch screen.

    It also can you go beyond the question of maintenance mode.

    The touch screen is unresponsive

  • How to make the color icons to work on the bookmark drop?

    On the last update of Firefox, I can't see the icons in the menu bookmark. I use a Mac OS 10.7.

    See:

  • How to make the top sites page appears when I open a new tab? Why have I not of "buttons" to pin a top site of the page tab?

    When I open a new tab, NO best sites don't show up... shows just a search engine box. I have Firefox 33.0. Why is there no 'pin' button when I opened a new page? How to make the top sites page appears when I open a new tab?

    Here is some additional information on the configuration of the new tab page:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste newtab and make a pause so that the list is filtered

    (3) double-click the preference browser.newtab.url and enter your favorite page:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Press Ctrl + t to open a new tab and check that it worked. Fixed?

    Some traps:

    If Firefox will not let you change this setting: you can have what is called SearchProtect on your system.

    Firefox if allows you to save your changes, but he doesn't know: one of your extensions may be the substitution of her. You can consult, disable and/or remove extensions on the addons page:

    "3-bar" menu button (or tools) > Add-ons > in the left column click on Extensions

    If the modification works during your session, but during the next startup is leads to: you could have a user.js file in your personal settings Firefox (your Firefox profile folder). This article describes how to track down and delete the file: How to fix preferences that will not save.

    A little luck?

  • How to make the plugin that works in the background?

    Hi, I need to make the plugin working in parallel in the background thread. It should start when Photoshop starts and stops when closing Photoshop. I think that the plugin type should I choose is "Automation" but these plugins are executed only when the user calls the plugin in the menu. How to make the plugin that runs when photoshop works without the need to invoke it manually? I don't want this plugin to be visible in any menu. This plugin is designed to work with the extension of the CEP.

    I ended up making invisible CEP extension that performs background tasks in the timer event handler:
    CEP 5 Extension HTML Cookbook for CC 2014 · Adobe-CEP/CEP-resources Wiki · GitHub

  • How to make a button form create a pop up or make the text appear on the screen?

    I need help creating a fake site. Everything I want is when the user clicks on the button submit to a text box below the submit button or a message box pops up saying: "Please fill in all information." or "an email has been sent.

    The email is not real, no e-mail will be sent to the person entering the details.

    If the user does not have all the information, I would like information for stay and the message box, or the text to appear.

    If the user has put all the information, I want the message or text box to appear, but information disappear as the form was reset.

    Someone at - it a solution?

    Someone who knows how to code the buttons to do the other sections of the page appear, or become visible.

    Here is the code for the form... now you need to copy and paste it instead of what you already have, which is configured incorrectly.

    Membership

  • How to make interactive buttons to rollover?

    How to make interactive buttons to rollover?

    Hello

    I think that you are looking to create a button that changes on the mouseover? for this, you can define States of button for each mouse, such as normal action, working capital etc.

    This video explains the steps:

    http://TV.Adobe.com/watch/Muse-feature-tour/Muse-define-object-States/

    Please let me know if I'm missing something.

    Thank you

    Sanjit

  • I have associated my pencil to Apple for the iPad Pro; How to make the Widget of batteries displayed on the notification Center 'today '?

    I have associated my pencil to Apple for the iPad Pro; But how to make the Widget of batteries displayed on the notification Center 'today '?

    See if it works. Scroll to the bottom of the list in the display today. Tap on edit. Press on the + sign next to battery.

Maybe you are looking for

  • Problem of satellite M30 742 Upgrade RAM

    Hi, if I upgrade my satellite to 1 GB of RAM (512 MB, KINGSTON KVR333X64SC25/512, 512 mb PC2700 CL2.5 200 2 slot), when windows xp pro sp2 run, the pc freezes after login and I can just stop with power on button.I test this ram with microsoft memory

  • Yellow exclamation on high-definition Audio on the Satellite A200-175 with XP

    Hello I have a problem with the installation of Windows XP pro on this laptop. I downloaded all the drivers on the site (chose the PSAE6 since the PSAE6E isn't there), but there are now 2 exclamation points in the devicemanager: Audiodevice on bus Hi

  • How to write a single value in an excel spreadsheet

    Hello I use an excel spreadsheet, as if it were an external code module. He does a lot of calculations, all I do is write an individual value, let calculate what it should only then read a return value from this. I already have a structure able to re

  • spell check dosen't work in outlook express, ok in other programs

    Spell checker is available in Word and other programs, but not in outlook express. How can I activate it so it will be available in outlook express?

  • Unique content tag expected?

    Hey everybody, In my - app.xml file Flash Builder tells me "expects a single happy tag" but he can't point to a location. What? Does anyone know what this means? Thank you!