Event and obj type in one eventlistener function for all buttons

Hi i have something like this
button1.addEventListener(MouseEvent.ROLL_OVER, manageMouseOver, false, 0, true);
button1.addEventListener(MouseEvent.ROLL_OUT, manageMouseOut, false, 0, true);
function manageMouseOver(event:MouseEvent):void{
  TweenLite.to(button1, 1, {x:100, rotationX:360, ease:Back.easeOut});
function manageMouseOut(event:MouseEvent):void{
  TweenLite.to(button1, 1, {x:14, rotationX:-360, ease:Back.easeOut});
and i would like to get one sentence for all button. I would like to create reference obj to use that function for all of my 7 buttons.
button1.addEventListener(MouseEvent.ROLL_OVER, manageMouseOver(button1), false, 0, true);
button1.addEventListener(MouseEvent.ROLL_OUT, manageMouseOut(button1), false, 0, true);
function manageMouseOver(event:MouseEvent, obj:Object):void{
  TweenLite.to(obj, 1, {x:100, rotationX:360, ease:Back.easeOut});
function manageMouseOut(event:MouseEvent, obj:Object):void{
  TweenLite.to(obj, 1, {x:14, rotationX:-360, ease:Back.easeOut});
but this is not working. I know that is wrong but what i should do to do this right?

in the listener function, use the event's currentTarget property to determine which object dispatched the event.

Similar Messages

  • One RollOver function for all buttons?

    Is there a way to streamline AS3 code so that all buttons are controlled by one rollover function? The code below isn't working for me.
    function rollOverbtn(e:MouseEvent):void{
    e.target.gotoAndStop(2);
    trace("button HIT");
    function rollOffbtn(e:MouseEvent):void{
    e.target.gotoAndStop(1);
    btn1.addEventListener(MouseEvent.MOUSE_OVER, rollOverbtn);
    btn1.addEventListener(MouseEvent.MOUSE_OVER, rollOffbtn);
    The trace works which shows me that the function IS properly firing, but the rollOver effect is not hitting. I'm sure I'm doing this wrong as I am brand spaking new to AS3.

    You're welcome.  When you use MOUSE_etc events, and "target", the target can end up being a child within the object that has the event listener assigned.  currentTarget always points to the object with the listener assigned to it.

  • Event and Process Types - Urgent

    Hi All,
    I am little confused between Events and Process Types in a PC. How an event can be used in a PC ?
    I know that SM62- To create event, SM64 – Execute Event. But how its used in PC.
    Thanks in adv for your reply.

    Events can be used to start the process chain based on the event raise. In order to use the events
    1. Create an event using SM62
    2. Go to your process chain start variant and select the start type as After event and give the event name which you created and then activate and schedule the process chain
    3.Now go back to sm64 and trigger the event that should actually start the Process chain. This can be monitored using the Process chain log.
    Regards,
    Jagadeesh.

  • One function for multiple buttons?

    I have a county map on my timeline with a list of each county as buttons ( there is 88 counties). I want to highlight the county on the map when I click the county's name from a list.
    when I test this out, only the last one gets highlighted. I know I am missing something really simple. it does work if I write code for each button but I can't to seem to get it to work with only writing the function once for all buttons
    var countyHigh:MovieClip = adamsHighlight;
    var countyCheck:MovieClip = kickout.adamsCM;
    kickout.adamsCheck_btn.addEventListener(MouseEvent.CLICK, highlightCounty);
    kickout.allenCheck_btn.addEventListener(MouseEvent.CLICK, highlightCounty);
      countyHigh = allenHighlight;
      countyCheck = kickout.allenCM;
    kickout.ashlandCheck_btn.addEventListener(MouseEvent.CLICK, highlightCounty);
      countyHigh = ashlandHighlight;
      countyCheck = kickout.ashlandCM;
    function highlightCounty(event:Event):void{
      if   (countyHigh.alpha == 0)
           countyHigh.alpha = .5;
      else  countyHigh.alpha = 0;
       if(countyCheck.alpha == 0)
       countyCheck.alpha = .5;
      else
      countyCheck.alpha = 0;
    when I click all there buttons, the all highlight ashland county instead of their own county. I am using Flash Professional CS5 and only been playing with Flash for about a year.

    var previouslyHighlightedCounty:Movieclip;
    function highlightCounty(e:MouseEvent):void{
    if(previouslyHighlightedCounty){
    //reset previouslyHighlightedCounty. ie, un-highlight
    // highlight e.currentTarget
    e.currentTarget=previouslyHighlightedCounty

  • HT204053 Our family uses one Apple ID for all of our iPhones.  We installed the update and now we are all getting each others photos and texts.  How do we stop this?

    Our family uses one Apple ID for all of our iPhone 5's.  We installed the update and now we are all receiving each other's pictures and texts.  How do we stop this? 

    Have a look here...
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l

  • I have 3 apple devices and I use the same apple ID for all 3.  I would like to create a new I'd for one of my devices, but do not want to loose the apps on that device.  Anyone know how I can do this?

    I have 3 apple devices and I use the same apple ID for all 3.  I would like to create a new I'd for one of my devices, but do not want to loose the apps on that device.  Anyone know how I can do this?

    Create a new ID:
    On the iPod go to
    - Settings>Messages>Send and receive and sign out your ID and sign into the other one. Make sure that only her ID email address is listed.
    - Settings>FaceTime sign out of your ID and sign into the other one. Make sure that under You can be reached at only the newID email address is listed
    - Settings>iCloud and sign out and sign in with the new one
    - Settings>iTunes and App Store and sign out your ID and sign in with the new one.
    - Apps are locked to the account that purchased them.
    - To update apps you have to sign into the account that purchased the apps. If you have apps that need updating purchased from more than one account you have to update them one at a time until the remaining apps were purchased from one account.

  • My wife and I have shared one iTunes account for 6  years.  We want to create our own Apple IDs, so when we sync to our new iMac we won't see each others contacts, photos, calendar, music, etc.  Is there a way to move music/apps from one ID to a new ID?

    My wife and I have shared one iTunes account for 6  years.  We want to create our own Apple IDs, so when we sync to our new iMac we won't see each others contacts, photos, calendar, music, etc.  Is there a way to move music/apps from one ID to a new ID?

    JoeyV325 wrote:
    Is there a way to move music/apps from one ID to a new ID?
    No.
    One of you create a new AppleID and one use the existing AppleID.
    But you can still use the items in each iTunes library.
    Create separate computer logins for each of you.
    This will give you each your own data. Contacts, calendars, photos, etc. (and your own iTunes library).

  • HT201251 I want to use 30  ipads to run kiosk software in my restaurant. Can I use one Apple ID (and one credit card) for all devices

    I want to use 30  ipads to run kiosk software in my restaurant. Can I use one Apple ID (and one credit card) for all devices?

    Alternatively you can always manage your iPads (does not matter how many) with a single apple id and all reporting to your account under "find my device" service. Keeping an eye on all your units. Additionally as you mentioned these are for your Restaurant you may find the solutions offered by this company who creates apps and hardware for this purpose: http://www.spartakioskpro.com
    Additionally if you expand beyond those 30 iPads to say 300 you will want to enable or plan on MDM as your best option to automate every ipad to use the same profile and app and ios configuration while also keeping a close eye on all of them via online MDM services like: https://meraki.cisco.com/products/systems-manager
    Here is a pic

  • I downloaded mountain lion on my laptop.  Do I need to do the same on my Desktop and iPad or is the one download good for all 3, and how do I do that if it is?

    I downloaded mountain lion on my laptop.  Do I need to do the same on my Desktop and iPad or is the one download good for all 3, and how do I do that if it is?

    If your desktop computer is one that supports Mountain Lion, you can either download it there or make a bootable jump drive with the installer on it -- assuming you haven't yet used the installer you downloaded to your laptop.
    As for the iPad, it doesn't use the same OS as the Macs do; it uses iOS versions, so Mountain Lion won't work there.

  • HT4436 My family has multiple iPhones.  Can we use one Apple ID for all of our phones?

    My family has multiple iPhones.  Can we use one Apple ID for all of our phones?

    If you use the same AppleID for iMessage and iCloud though, you will all be sharing the same message account and iCloud email account.  You can use a common AppleID for purchased content, but each create your own unique AppleID for iMessage and iCloud so you each have your own private accounts for those services.

  • HT1660 how can I use one single library for all users on the same laptop?

    how can I use one single library for all users on the same laptop?

    You are most of the way there. Each user having access to hard drive is the key. If users are limited in file privileges this is harder.
    Any files you add to your library and any files she adds to her library are available to the other. Just not automatically. Each user must add the files to their own library using the add file or add folder option from menu bar.
    What I have done is set library location to a location outside of My Documents\My Music. On my network storage I have a folder names s:\itunes. Both accounts iTunes are set to use this location for the library.

  • Can I use the Time Capsule strictly for system backup and continue to use my Airport Extreme for all my wireless needs

    I want to use the Apple Time Capsule as an external drive and continue to use my Airport Extreme for all my wireless needs. Can I do that? The reason I ask is that my Time Machine utility cannot find the TIme Capsule - it only shows me the Airport Extreme, even when I "Rescan". SO I am unable to use the Time Capsule.

    You will need to connect an Ethernet cable from one of the LAN <-> ports on the AirPort Extreme to the WAN "O" port on the Time Capsule.
    Perform a "hard reset" on the Time Capsule by holding in the reset button for 9-10 seconds, then give it another minute to restart to a slow, blinking amber light.
    Open AirPort Utility, select the Time Capsule, and click Manual Setup
    Click the Time Capsule tab located below the row of icons to assign a name to the Time Capsule, a device password, and adjust Time Zone settings.
    Next, click the Wireless tab located to the right of the Time Capsule tab
    Change the setting for Wireless Mode to Off
    Click the Internet icon, then click the Internet Connection tab
    Connect Using = Ethernet
    Connection Sharing = Off (Bridge Mode)
    Click Update at the lower right to save the settings and allow 30 seconds for the Time Capsule to restart to a green light.
    You are all set

  • How to force RH9 to use only one master stylesheet for all Word imports?

    I have set a stylesheet (css) as the default for my RH9 WebHelp project in project settings. When I import Word documents into the project, the edit import setting dialog does not show this stylesheet in the list of available stylesheets for the import.
    What is happening instead is a proliferation of unwanted stylesheets derived from all the imported documents. I then have to manually re-set all the new topics to the master stylesheet.
    How can I stop this, and force RH9 to use only the one master stylesheet for all imports?

    cid:[email protected]
    Hi Peter,
    That’s what I thought I was doing in the Project Settings>Import tab>CSS for Style Mapping selection. Maybe that isn’t what it’s meant to do. It’s just getting annoying having all these unneeded files popping up in the project manager so that I have trouble distinguishing the “real” topics from the extra stuff.
    Michael West | Business Improvement | Aurecon
    Ph: +61 3 8683 1996 | Fax: +61 3 8683 1444 | Mob: 0407 485 228
    Email: [email protected]
    PO Box 321, South Melbourne | VIC 3205 | Australia
    http://www.aurecongroup.com
    http://www.aurecongroup.com/apac/groupentity/

  • HT1879 how to buy multiple songs for one person & pay for all at once

    i want to purchase a bunch of singles for one person, & pay for all at once. is that possible?

    Basis can do a export and import transport, still if don't have connection between boxes.
    or
    check this
    http://www.sap-basis-abap.com/abap/copy-program-variants-from-one-to-another.htm

  • Publication using "one database fetch for all recepients" is a failure

    Hi,
    I have created a Publication in *CMC* with Crystal Reports as Source Document. When I schedule it with option " One database fetch per recipient" it is a Success. But while using the option "One database fetch for all recipients" it is a Failure.
    I tried this with Personalization value Parameter as well as Filter. But both combinations throw an error message when used with Reporting Bursting Method "One database fetch for all recipients".
    Anybody who has worked with Publication please let me know in which scenario one can use the Advanced setting:
    Report Bursting Method
    "one database fetch for all recepients"
    Regards,
    Amogh.

    Howard,
    The method I use is to put the connection script in a file outside the web root. Although the file has the same name on both the local and remote servers, the details are specific to that particular connection. Then each page in the website has the following PHP script.
    require_once '../outside_folder/.db.php';
    This method is also more secure than including the connection details inside the web root. Also note that the file name begins with a period and ends with the php extension, both for added security.

Maybe you are looking for