3 same buttons & 3 different frames, but each frame must have it's own actionscript?

Here is my issue. I have 3 frames and 3 buttons. Each button takes you to their respected frame. However, I noticed that I cannot have 1 key frame of actionsript read the same on those 3 frames. Why? because if I jump from frame 1 to frame 2 or 3, then I cannot jump back. Instead, each frame has to have it's own actionscript. The only thing that would change is the method name. I find it tedious. Is that how  it is? This almost felt seem like it would be less tedious but even for 3 frames, I have to change each method name as I build more frames to navigate to. Check my example below:
Old Actionscript (1 keyframe for 3 frames did not work to jump back any frame)
frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
function handlerFrame1(event:MouseEvent):void {
gotoAndStop("frame1");
function handlerFrame2(event:MouseEvent):void {
gotoAndStop("frame2");
function handlerFrame3(event:MouseEvent):void {
gotoAndStop("frame3");
New Actionscript (3 keyframes and this works):
Frame 1
frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame1);
frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame2);
frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame3);
function handlerFrame1(event:MouseEvent):void {
gotoAndStop("frame1");
function handlerFrame2(event:MouseEvent):void {
gotoAndStop("frame2");
function handlerFrame3(event:MouseEvent):void {
gotoAndStop("frame3");
Frame 2
frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame4);
frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame5);
frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame6);
function handlerFrame4(event:MouseEvent):void {
gotoAndStop("frame1");
function handlerFrame5(event:MouseEvent):void {
gotoAndStop("frame2");
function handlerFrame6(event:MouseEvent):void {
gotoAndStop("frame3");
Frame 3
frame1_btn.addEventListener(MouseEvent.CLICK, handlerFrame7);
frame2_btn.addEventListener(MouseEvent.CLICK, handlerFrame8);
frame3_btn.addEventListener(MouseEvent.CLICK, handlerFrame9);
function handlerFrame7(event:MouseEvent):void {
gotoAndStop("frame1");
function handlerFrame8(event:MouseEvent):void {
gotoAndStop("frame2");
function handlerFrame9(event:MouseEvent):void {
gotoAndStop("frame3");

You should not need to have code in all three frames.  The first bit of code you show should suffice under normal circumstances.  If you have the code on a layer that has only one keyframe and the buttons on a layer that only has one keyframe, then the buttons will remain working.  It is only when you create new instances (keyframes) of the buttons that you need to assign new event listeners for them, but even then the same event handler functions can be shared for all of them as long as that actions layer extends the length needed for all the buttons.

Similar Messages

  • IPad 1 Safari crashes frequently. I went to many Apple stores in different countries and each Apple staff member had their own different opinions with no help. I had upgraded my iOS to 5.1.1 and the Safari crashing started about one year

    IPad 1 Safari crashes frequently. I went to many Apple stores in different countries and each Apple staff member had their own different opinions with no help. I had upgraded my iOS to 5.1.1 and the Safari crashing started about one year after the upgrade and some Apple staff blame this- but this started one year later after the iOS upgrade. Recently at the Apple Store in Vancouver an Apple staff reset my computer (erased everything and sent to iCloud to reset the iPad) and I hoped this would fix the problem. IPad Safari still crashes. Short of booking an appointment for taking it for repair to Apple technicians which will cost me money can anyone help me to fix this Safari crashing.

    Hi,
    You might have a 3rd party plugin that isn't compatible with Safari 4.0.4. Go here for help...
    Safari add-ons can cause performance issues or other situations
    If you are using a USB hub, try disconnecting and restarting with just your keyboard and mouse connected.
    From the Safari Menu Bar, click Safari / Empty Cache. When you are done with that...
    from the Safari Menu Bar, click Safari / Reset Safari. Select the top 5 buttons and click Reset.
    Mac OS: Web Browser Quits Unexpectedly or Stops Responding
    Also, you could download and install the 10.5.8 combo update (PowerPC) available here.
    http://support.apple.com/downloads/MacOS_X_10_5_8_ComboUpdate
    It contains fixes that might help. Then repair disk permissions.
    Quit any open applications/programs. Launch Disk Utility. (Applications/Utilities) Select MacintoshHD in the panel on the left, select the FirstAid tab. Click: Repair Disk Permissions. When it's finished from the Menu Bar, Quit Disk Utility and restart your Mac. If you see a long list of "messages" in the permissions window, it's ok. That can be ignored. As long as you see, "Permissions Repair Complete" when it's finished... you're done. Quit Disk Utility and restart your Mac.
    Carolyn

  • Prior to upgrading to 9.5, I used to be able to open several different PDF's in one Adobe Reader.  Each document would have it's own tab across the toolbar.  Now I don't have that open.  Instead, I have multiple Adobe Readers open at the bottom of my scre

    Prior to upgrading to 9.5, I used to be able to open several different PDF's in one Adobe Reader.  Each document would have it's own tab across the toolbar.  Now I don't have that open.  Instead, I have multiple Adobe Readers open at the bottom of my screen.  Any suggestions on how to change that?  Thanks!

    Not possible with the actual versions of Adobe Reader.

  • Creating new buttons on different frame labels

    can someone tell me if im doing something wrong or assigning
    the as to the wrong frame?
    first off i have all my buttons on frame 2. im creating a
    real estate site and i have to have a couple links like HOME ABOUT
    BUYING SELLING CONTACT, the thing though is that in the BUYING and
    SELLING frames i want to add more sections and links but only on
    these 2 other parts of my site. when i code it and add new buttons
    to these sections though my movie plays over and over and over non
    stop. heres my coding...
    FRAME 1 preloader
    Frame 2 has a frame label of home and all the buttons on a
    diff layer, and AS3 on a different layer
    Frame 3 has a frame label for about section
    Frame 4 is my contact for example
    so if i create a new button in the about frame label and just
    add the code to the working as3 code on frame 2 my movie just plays
    over and over and over again, and all i want it do do is act like
    the other buttons and go to a different frame label down in the
    time line. the only way i get it to work is if i have ALL my
    buttons on frame 2.
    frame 1
    my preloader
    frame2
    home_btn.addEventListener(MouseEvent.CLICK, onHome)
    function onHome(event.MouseEvent):void
    gotoAndStop("home");
    about_btn.addEventListener(MouseEvent.CLICK, onAbout)
    function onAbout(event.MouseEvent):void
    gotoAndStop("about");
    etc....
    etc...
    i enter my btn code just like this and the buttons on frame 2
    work but any new buttons i try and creat and put into different
    frames othere then frame label "home" aka frame 2 wont work

    correct.
    there are lots of ways around it. but they all require the
    object to exist when the code executes.
    with as3 it's particularly easy to create objects, code for
    them and then add them to the display list later when
    needed.

  • Is it OK to have two SBS Servers with same name, on different subnets but connected over a VPN?

    Hi Everyone,
                       I'm just about to connect up two SBS 2011 Servers with the same server name but on different subnets & domains over a VPN.
    So for example both servers will have the name Server01, one would have an ip address of 192.168.85.5, the other 192.168.86.5, they both then would be connected over a VPN.
    Can anyone foresee any issues with this configuration, like DNS & DHCP requests, adding new machines to the domain, mapping drives etc.
    Many thanks,
    Nick

    Hi Larry & Strike First,
                      Thank you for your responses. I understand that this is an unusual situation. Basically I've recently taken over the IT support for this client. The client has just had a new phone system installed
    & are asking if they can speak to each office internally, which can easily be done once I setup the VPN.
    However I noticed whilst looking at this further that the Server names are the same, hence my question?
    Am I right in saying that providing the workstations  have a trust relationship with their own domain controllers through their individual domains on separate subnets, that hopefully there shouldn't be any DNS issues between the two domains and Servers?
    I could build a new VM if you feel it would be better practice to do so?
    Many thanks for your assistance,
    Nick

  • Same button on single frame to display/hide movie clip?

    Hi, can a button on a single frame be coded to both display a movie clip on its first click and, after a second click, hide the movie clip?  Thanks

    Yes, assuming you make the movieclip invisible to start with, in the event handler function just use...
    mc_name.visible = !mc_name.visible;

  • How do I put multiples of the same button in different places on my tool bar?

    I'd like there to a new tab button to left of the address bar and to have the option of also clicking to right of my tabs as well. Like the old version. The customize toolbar option only allows me to use one button of each kind, and I'd like to have multiples for this and perhaps other uses.

    Sounds that you have selected the Firefox application for a file type that it doesn't support.
    See:
    * https://support.mozilla.com/kb/Firefox+keeps+opening+many+tabs+or+windows

  • Others query the absence of the refresh button and that people have suggested dragging the stop, etc button from the right, but I don't have this button nor does it come up when I search under Views/ Toolsbars/Customise. How do I get a refresh button ?

    Can't add much to the question

    Firefox 4 later use a combined Stop/Reload/Go button that is positioned at the right end of the location bar.<br />
    During the page load process it shows as a Stop button and after the loading has finished the button is changed to a Reload button.<br />
    If you type in the location bar then that button becomes a Go button.<br />
    Middle-click the Reload button to duplicate the current tab to a new tab.
    To move the Stop and Reload buttons to their position to the left of the location bar you can use these steps:
    * Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"
    * Drag the Reload and Stop buttons to their previous position to the left of the location bar.
    * Set the order to "Reload - Stop" to get a combined "Reload/Stop" button.
    * Set the order to "Stop - Reload" or separate them otherwise to get two distinct buttons.

  • Inbox account is used by the other endpoint. Each endpoint must have different Inbox account

    I am trying to setup an email account for the successful and failed job recipients and I get the above error.
    Can anyone explain why ?
    Aditya

    Here you go ...
    I have left the invoke blank as I picked a random process.
    An FYI ... there is one email endpoint already configured which works fine when I change the email account, etc. I have also attached the screen shot of it.
    Aditya

  • Share M4P music on same computer with different windows Sessions

    According to the guidelines provided on this site, I already shared my music folder to enable different users on my single computer to access shared music files.
    I kept different libraries to provide each user a different library to keep perosnal playlists, ratings and so on.
    m4p shared files can be read by each user by clicking on the file in windows folder so I understand protection is shared on the same computer.
    But there is no way to add a shared m4p file (itune protected)to the libraries !!
    I used the "add file" or "add folder" function... only mp3, mpg, appear in the library, but no m4p.
    How can a user manage a different library on the same computer and be able to add shared m4p files to each library ?

    Jase, you said "Music sharing works across different user accounts, whether they are on the same computer or different computers", but my son will log into his account where he currently has no music. in the window on the left, we can see the other computers in the house that are on line, but there is no sign of the master account (on that same imac). i assume this is because the master account is not logged in, therefore the secondary accounts can't find the master account's music, nor can I from a remote computer ( my macbook, for example). for instance, right now from my macbook i can see my son's itunes list (on the imac) in my "share window" (even though his list is empty). he can also see my macbooks list in his "share window". he cannot see either my list on that imac, or his sisters list on that same imac. all acounts on the imac have sharing turned on, as well as "look for shared music" turned on.
    i guess the focus is on this: can the master user itunes list be made available to other users on that same computer while they are logged in as other users (and the master account is logged off, which it has to be in order for the secondary accounts to be logged in, right?) I can't think of any other way to ask this, so i hope that clarified what we have tried and what we are asking for.

  • HT201302 Hi Please can you tell me how I sync my photos from my photo library to my pc?  I hve managed to sync those from different albums but the ones on my photo library are not copying over.

    Hi
    Please can you tell me how I sync my photos from my photo library to my Pc?  I have managed with all other photos but the ones on this album don't seem to be syncing?
    Please help!
    Thanks,
    Jane

    First check to be sure your comuter is 'Authorized'.
    Plug in your device and select it from the 'Devices' list in iTunes.
    You can manually manage the content from the Summary tab OR sync the tunes and other media from the other tabs (music, apps, photo's etc).
    You can sync different content to different Devices from the same iTunes library. I have 2 iPhones, multiple iPods, multile iPads etc all on the same library with different content on each device.
    MJ

  • Share music on same mac with different user accounts

    I'll try to make this clear, i have an imac with a large itunes collection. my two kids have accounts on that same mac, and want to be able to listen to what i have in my itunes. i can't see putting three copies of the same music on the same computer. is there a way to let them play what i have in my itunes account while they are logged in to their own account on the same computer?
    imac (5 years old)   Mac OS X (10.4.6)   macbook, G4 I book, I book, Imac
    macbook w/ superdrive, G4 with combo drive, I-book w/o cd burner   Mac OS X (10.4.6)   macbook, G4 I book, I book, Imac

    Jase, you said "Music sharing works across different user accounts, whether they are on the same computer or different computers", but my son will log into his account where he currently has no music. in the window on the left, we can see the other computers in the house that are on line, but there is no sign of the master account (on that same imac). i assume this is because the master account is not logged in, therefore the secondary accounts can't find the master account's music, nor can I from a remote computer ( my macbook, for example). for instance, right now from my macbook i can see my son's itunes list (on the imac) in my "share window" (even though his list is empty). he can also see my macbooks list in his "share window". he cannot see either my list on that imac, or his sisters list on that same imac. all acounts on the imac have sharing turned on, as well as "look for shared music" turned on.
    i guess the focus is on this: can the master user itunes list be made available to other users on that same computer while they are logged in as other users (and the master account is logged off, which it has to be in order for the secondary accounts to be logged in, right?) I can't think of any other way to ask this, so i hope that clarified what we have tried and what we are asking for.

  • Bug: showing data in tables with same name, 2 different databases

    Hi,
    two connections, to databases "a" & "b". Both logged into the same schema, "s".
    If you select table "t" in db "a" and then select the same table in db "b", the tab is not refreshed - you have to either select a different object first, or explicitly hit refresh.
    regards,
    William

    I can reproduce this consistently on 9.2.0.1.
    You need to have connections to the same schema in two different databases and the schemas must have the same table.
    1 Open connection in schema 1
    2 Select the table in the Tables node
    3 Select the Data tab
    4 Open connection to schema 2
    5 Select the table in the Tables node (without going to any other tabs or objects)
    What should happen is the details of the second table should occupy the main display tab and the data tab should be refreshed to show the data of the new table.
    What actually happens is the main display tab apparently switches to the table in the new connection as shown by the tooltip (table@connection_name), but the data in the data tab stays the same. Refresh doesn't seem to work, only switching to a different object and back again.
    The columns tab does seem to refresh properly.

  • How do i get my itunes to be the same on my laptop, ipod touch and ipad???? ive sync'd them all, but each is still different, please help

    how do i get my itunes to be the same on my laptop, ipod touch and ipad???? ive sync'd them all, but each is still different, please help

    Syning with iTunes is completely separate from iCloud, except that if you have elected to sync calendars and contacts with iCloud you cannot sync them with iTunes.
    What iTunes media are you having problems syncing to your iPhone?

  • Same AS but different public per each country

    Hi,
    I'm wondering if we can use same BGP ASN per each own country, but different public block from there on internet, for example.
    country a --> BGN ASN 100, public ip range 1.1.1.0/24
    country b --> BGP ASN 100, public ip range 1.1.2.0/24
    country c --> BGP ASN 100, public ip range 1.1.3.0/24
    could it be possible? In general, I thought that it needs to use different ASN per each country due to its own public IP space.
    if we can use same ASN, then could it be ok to process routing via BGP?
    Thanks.

    OK, thanks for your clarification. can I put one more question?
    Can we design BGP like below for multi-continents?
    A continent : BGP AS 1 , advertising 10.10.10.0/24 - Main datacenter.
    B continent : BGP AS 1 , advertising 10.10.10.0/23 - Back datacenter.
    So, A,B continent is advertising the routing block like above, in normal situation, the traffic heads to A continent since the routing block is more specific. but, If A continent is having a problem, then, Would it traffic re-route B continent? B continent is not working in normal situation. So, I would like to know if above case is working in case of DR situation.

Maybe you are looking for

  • Deleted iPod Selection--all songs on iPod disappeared--help!

    I had too many songs in my library to fit on my iPod, so my iPod created a selection of songs. Then I added and deleted many songs to the library. However, when I plugged in my iPod so it would be updated from the revised iTunes library, nothing woul

  • Daily Invoice Report

    Hello, We would like to create a report where we can see each invoice generated for a day and the total value of all the invoices for that day. Is there any way to do this with Excel Reporter?  If anyone knows, please describe step-by-step as we are

  • How to compare PL/SQL source in two databases using some smart trick

    Hi, Here is my scenario: We have a very big team (>50) of developers working on PL/SQL. As and when some new enhancements/bug-fixes are are tested successfully, DBA's migrate the new source code from DEV to QA and then to PROD instance. Very often, d

  • ARD Newbie connection problem

    Hi, I persuaded my mum to get an i-mac so that a) her computing experience would be great and b) so that I could help her with any problems. She is on 10.6 and Remote Client 3.4 and I'm on ARD 3.4 and 10.6.7.  I set it up and connected with ARD fine

  • My wordpress site won't load anymore (safari 6 to blame?)

    After upgrading to Mountain Lion, I just tried to do a post on my wordpress site last night. The post showed up on my computer, but didn't show up on anyone else's. Now today, I can't get my wordpress site to load at all on my computer - even with ot