Same function for all mc buttons?

I am putting together a simple flash anim – and pretty much have about 25 buttons that I need to fade in and out on rollover. I seem to remember there is a way to apply the same function to all buttons – as long as the over and out state labels within the mc are the same. Could someone let me know what i should look into in order to accomplish this? Thank you.

dhem – i am getting a
TypeError: Error #1010: A term is undefined and has no properties.
    at tw_flash_jh_fla::MainTimeline/frame1()
when trying to implement that loop code – am i missing something?
That is with the attached code – assumably the error is mine:
stop();
for (var i:int = 1; i < 66; i++){
    this["mc" + i].addEventListener(MouseEvent.MOUSE_OVER, showHighlight, false, 0, true);
    this["mc" + i].addEventListener(MouseEvent.MOUSE_OUT, removeHighlight, false, 0, true);
function showHighlight(e:MouseEvent){
    e.currentTarget.gotoAndPlay("over");
function removeHighlight(e:MouseEvent){
    e.currentTarget.gotoAndPlay("out");

Similar Messages

  • 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.

  • How do I change the icloud account on my iphone? I want to use the same account for all my apple devices (macbook air and imac and iphone). I can't see where I can amend the iphone account because it is in grey?

    I want to use the same account for all my apple devices (macbook air, imac and iphone). I can't see how I can amend the iphone account because it is in grey? I also can't remember the password for this account so i can't even delete it and start again?
    Help!
    Thanks

    Deleting an iCloud account only deletes it from the Device, not from iCloud.  In iOS 8, the name of this setting changed to "Sign Out" as that is a better reflection of what actually happens.  Your iCloud data remains on the server, available to devices still signed into the account, but the device you sign out of the account on is disconnected from the account, and as a result, the iCloud data from that account is removed from the device.  It will redownload to the device should you sign back into the account.
    The only issue you'll run into when you switch between accounts is with my photo stream photos older than 30 days.  When you delete (or sign out of) and account, your photo stream photos are deleted along with the other data from the account in question.  However, unlike other data which remains on the server and can redownload to your device when you sign back in, my photo stream photos only remain in iCloud for 30 days.  When you sign back in, you will only get back my photo stream photos added in the last 30 days (as older photos are no longer in iCloud to redownload).  Like other account data, any my photo stream photos on your other devices signed into the account are unaffected by this.  If you want to keep older my photo stream photos on your device as you change iCloud accounts, save them to your camera roll before deleting (signing out of) the account.

  • I have used the same laptop for all three of my iPhones but awhile back this laptop had a virus so my husband wiped it out and now when I sync my iPhone I no longer get my entire music library ( including purchased songs) on my iPhone. How do I fix this?

    I have always used the same laptop for all of my iPhones but awhile back this laptop had a virus so my husband wiped out the laptop and now when I sync my iPhone I no longer receive my entire music library (including purchased songs) on my iPhone. How do I fix this?

    kimberlyfromtopeka wrote:
    Ok,thanks but, I should be able to something so that I am able to sync the entire library again not just the purchased songs.
    If the non purchased music is not on your computer, how can it Sync to your iPhone...

  • How do I get the volume on my ipod classic to the same level for all songs?  Some are louder than others.

    How do I get the volume on my ipod classic to the same level for all songs?  Some songs are a lot lower than others.

    Coverflow in iTunes is sorted by Album Artist whereas coverflow on the iPod classic is sorted by Artist. Unfortunately, there is no way to set this on your iPod. This is such a fumble on Apple's part that I'm beginning to think they're becoming another Microsloth with buggy firmware and products.

  • How to force SQL*Loader to assign the same SYSDATE for all rows?

    I want to use SQL*Loader to load some rows and a "SYSDATE" generated column, but making sure this date is THE SAME for all rows. I have seen that if I load HUNDREDS of rows there is a little difference between them (in terms of seconds). I guess it is "the moment each row entered the DB", but I need the same value for all rows (preferably, "the moment SQL*Loader was launched"). Is there any way to achieve this?
    Thank you very much.

    Hello user2393320.
    Given some thought, using a date value to identify all records from a single load isn't very wise.
    Are you able to create a procedure on the database that could be executed during SQL*Loader's execution? If so, you could develop the procedure to take in the record number of the row being loaded as an input parameter and output this unique date value for all rows loaded. The procedure would need to store the date value in a table when the first row is being loaded and return the stored date value as its output. This obviously assumes that only one sqlldr session is running at any time.
    I highly recommend using a numeric sequence in the control file instead of a date to identify each file load:
    , file_load_seq SEQUENCE(MAX, 1)
    Another approach would be to load the record number being loaded in addition to the sysdate:
    , record_number RECNUM
    Hope this helps,
    Luke

  • In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    In my family we have 3IPhones 4S, one IPhone5, one IPad3, one IPadMini and two IPad 4. Is it possible to use the same energieadapter for all of those ?

    Yes but the iPhone chargers will struggle to charge the iPads ,they need more power than the iPhone chargers produce and with an iPad will charge VERY slowly
    The iPad chargers whether 10w or 12 will happily charge all your devices and Apple confirms the compatibility on the relevant web page.

  • Can DRIVER itab & RESULTANT  itab  be  same with  FOR ALL  ENTRIES ??

    Hi All,
         Can DRIVER itab & RESULTANT  itab  be  same with  FOR ALL  ENTRIES ??
         Whole idea is  to  update one field  of  ITAB  from another table ....
    Regards
    Jaman
    Edited by: ABAP Techie on Sep 11, 2008 8:25 AM

    I found this in the F1-Help for "FOR ALL ENTRIES":
    >"In Release 6.10 and higher, the same internal table can be specified after FOR ALL ENTRIES and after INTO."
    Check however if you can use a proper JOIN select. This will fill your internal table in one operation and is usually faster than a FOR ALL ENTRIES, contrary to some circulating comments here.
    Thomas

  • My thumbnails have all disappeared.  If I view events there is the same one for all 270 events and if I open an event I have clack thumbnails. I can only see the photo if I open it individually.

    If I view events there is the same thumbnail for all 270 events and if I open an event I have black thumbnails. I can only see the photo if I open it individually.The only way I can then see the thumbnail is by editing each photo. Then to even further complicate matters the last editted phot is replaces as the thumbnail on all events foders!...grrr. This is what I awoke to two mornings ago after inly backing up my machine which I do every night.

    No.  Quitefrankly I didn't know I could even use iPhoto on iPad, I just have the photos app that came on it.  This is on my laptop.  I don't particularly like iPhoto I use it essentially to take photos off my camera and store all the originals.  I use Photoshop. To work on them and store them in Dropbox (don't get me started on iCloud!). As I said this is a problem that seemed to crop up overnight after backing up to my external HD. 

  • Same action for all buttons

    I want to apply the same action to all buttons in a movieclip
    without
    putting AS in every button. I'm thinking that the prototype
    call might have
    some way to do it but I haven't found anything that helps in
    my searches.
    Thanks in advance for help.

    --Put the script on your button
    -- Convert the button to a movieClip
    -- Use instances of that movieClip where you want your
    buttons.
    KB
    "SSSup" <[email protected]> wrote in message
    news:ejt651$8qs$[email protected]..
    >I want to apply the same action to all buttons in a
    movieclip without
    >putting AS in every button. I'm thinking that the
    prototype call might have
    >some way to do it but I haven't found anything that helps
    in my searches.
    >Thanks in advance for help.
    >

  • Random Number being changed to the same number for all rows

    hello all,
    first of all I want to mention that this problem start happening after 2.14 instalation of Power Query.
    I'm creating new column in my query and setting all values to random numbers. The problem is that next step (doesn't matter what it do itself) somehow changes all those random numbers to the same random number for all lines.
    here's code sample:
    InsertedCustom = Table.AddColumn(RemovedColumns3, "Random Number", each Number.Random()),
        InsertedCustom2 = Table.AddColumn(InsertedCustom, "Analyst Full Name", each [Analyst First Name]&" "&[Analyst Last Name]),
    when I'm checking step by step, InsertedCustom  creates new column and all values are being set randomly for all lines BUT when going to the next step (InsertedCustom2) all values in the column "Random Number" are being changed to the
    same number (no matter that InsertedCustom2 itself should not be doing anything to column named "Random Number") . I even tried moving InsertedCustom step to the bottom of my code but it didn't help and still facing this issue.
    p.s. updated my PQ to 2.15 - didn't help

    This is a known issue. Power Query assumes that functions are idempotent (given the same arguments, they produce the same result), which isn't true for Number.Random. Our optimization pipeline is turning Number.Random() into a constant in the scenario you
    encountered, which results in all rows having the same value.
    There's been some discussion of how to fix this, but that won't help you in the near term. Can you describe a bit more about your scenario and what you're trying to accomplish? Perhaps we can help you find a workaround.
    Ehren

  • DCIteratorBinding setting the same value for all the rows.

    Hi all,
    I have table with on of the column as id. I have made the id column as the hyper link , that takes me to the next page. I am trying to pass the id to the next page. I am using the managed bean for the same. The below code is used to create the link on the column. It sets the action to the function in the bean that sets the id as of the current row.
    <tr:column sortProperty="id" sortable="false"
    headerText="#{bindings.notification.hints.id.label}"
    id="c4">
    <tr:commandLink action="choice" text="#{row.bindings.id.inputValue}"
    id="cl1" actionListener="#{IdBean.extractID}">
    </tr:commandLink>
    </tr:column>
    below is the IdBean.extratctID()
    public void extractID(ActionEvent actionEvent){       
    BindingContext bindingContext = BindingContext.getCurrent();
    BindingContainer bindings;
    bindings = bindingContext.getCurrentBindingsEntry();
    DCIteratorBinding iter;
    iter = (DCIteratorBinding) bindings.get("notificationIterator");
    Row rw;
    rw = iter.getCurrentRow();
    String id;
    id = (String) rw.getAttribute("id");
    this.setId2(id);
    I am printing the id value on to the next page. But its just returning the vslue of the id for the first row for all the rows of the table.
    Any inputs as in do i need to refresh the iterator or something like that.
    Reagrds
    Sishant

    Hi,
    Following is the code i have added in my bean
    ValueExpression expression = getFacesContext().getApplication().getExpressionFactory().createValueExpression(getFacesContext().getELContext(), "#{pageFlowScope.emp1}", Object.class);
    Object id = expression.getValue(getFacesContext().getELContext());
    public FacesContext getFacesContext() {
    return FacesContext.getCurrentInstance();
    JSPX Code -
    <af:commandImageLink id="DuncanAngove"
    icon="/john.gif" partialSubmit="true"
    actionListener="#{Tweets.setEmployeeId}">
    <af:setActionListener from="Duncan Angove" to="#{pageFlowScope.emp1}" />
    But i am getting NullPointerException. I have tried it with application and request scope as well.
    javax.servlet.ServletException
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:277)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:414)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:330)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3684)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.lang.NullPointerException
         at org.apache.myfaces.trinidad.component.UIXComponentBase.getValueExpression(UIXComponentBase.java:231)
         at project1.Tweets.setEmployeeId(Tweets.java:40)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(AstValue.java:157)
         at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
         at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1259)
         at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
         at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
         at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         ... 35 more
    Thanks
    Sishant

  • System object with same credentials for all users?

    Hi everyone
    I would like to create a system object in Portal, which can be used by users in a specific group. However, I want all users to use the same credentials for this system. Is this possible?
    I've tried creating systems, but they all seem to require user mapping to work correctly. Is there some way I can create a system object with the credentials as part of the object, and then just assign permissions to it as required?
    Please let me know if this raises any questions.
    Thanks
    Stuart

    i dont think it is possible to create a system object for all the users with same credentials.anyways you are trying to create system object for some users who belong to a particular group.so you need to do only one time user mapping for that group
    go to user administration-search for the group-go to user mapping tab-give username and password..
    reward points if helpful

  • Album artwork on Apple TV is incorrect..always shows the same album for all. How do I change this?

    I have a 2nd Gen Apple TV and stream my music to Apple TV in my home.
    Lately, the artwork for ALL of my music shows the artwork of 1 album cover.
    How can I fix this so each album displays the correct artwork.

    You'll need to restore your phone from the latest backup you made before he synced his phone.
    To check if there is still a backup you can use, do this:
    Open iTunes Preferences:
    Windows: Choose Edit > Preferences.
    Mac: Choose iTunes > Preferences.
    Click Devices (the iOS device doesn't need to be connected).
    iTunes will show the phone number, IMEI, and serial number of the backed up iPhone when you position your mouse pointer over a backup (iTunes shows only the serial number for iPad and iPod touch). You can use this to find the backup you want to use.
    Then restore from that backup by following this article:
    iOS: Back up and restore your iOS device with iCloud or iTunes
    Do the same with his device after that, using his old backup.
    If you can't find one, set it up as new device without using any backup.

  • Iphoto showing the same picture for all my uploaded pictures after update, how do I get my old ones back so I can upload them to websites?

    After updating the new iPhoto software in the middle of December, I haven't been able to view all of my pictures that had been on my computer prior to the new software update, It shows the same photo for every single picture, how do I convert it back or reboot it?
    THANKS!!

    make a temporary backup of the library and launch iPhoto with the Command+Option keys depressed to rebuild the library. Select the options for rebuilding the thumbnails .
    OT

Maybe you are looking for

  • Print crystal report in A5 paper tray

    Dear Experts, I am using VB.NET We have different printers like "Lexmark Optra T612_DB", "HP Universal Printing PCL 5 (v4.7)", etc., in the network, there will be 2 or more trays for each printer. One of the tray has A5 paper in it. While printing Cr

  • My Mac Pro 2.8 crashed and will not reboot in Safe Mode - HELP!

    Hello I have a Mac Pro 2.8 and it froze up on me; I held in the power button to shut it down. Upon restart, all I get is a flashing foldoer file icon with a question mark. What gives? It will not start in Safe Mode, via the Shift button OR DOS comman

  • LWAP not getting the IP

    Hi, I am trying to setup basic wireless network with 5508 controller and 3502 APs. I have wired things as per attached diagram. The issue is AP doesn't seem to get the IP address from DHCP. My questions are. 1. Do I have to set the AP switch port to

  • Firefox 3.6.5, running Windows 7, always gets stuck at the 80% when trying to install initially.

    I've been a long time user of Mozilla Firefox, and have recently upgraded computers, which gave me Windows 7 Home Premium. For the past couple of days I have been trying to install Firefox 3.6.5 but it always gets stuck when its 80% done. Is there so

  • HT204053 changing your apple id in icloud

    I changed my apple id and now I can't change my iCloud id, and can't access iCloud because my apple id is changed.  How do I chang my id in iCloud?