Should be simple but need help!

Hi there,
I'm new to AS3, and I'm trying to make a navigation menu. When you roll the mouse over a section, the colour changes to red. I've got this working for the first word, however there are more that need to be added. I have other menu items that I was the exact same thing to happen to, those being tracks_bg, drivers_bg etc. Here's my code that works fine:
import fl.transitions.Tween;
import fl.transitions.easing.*;
about_bg.addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
about_bg.addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
function manageMouseOver(event:MouseEvent):void{
  //your over code here
    var color_transform:ColorTransform=about_bg.transform.colorTransform;
color_transform.color=0xbf3a3a;
about_bg.transform.colorTransform=color_transform;
    var fadeIn:Tween = new Tween(about_bg, "alpha", Strong.easeOut,0,1,1,true);
function manageMouseOut(event:MouseEvent):void{
  //your out code here
    var color_transform:ColorTransform=about_bg.transform.colorTransform;
color_transform.color=0xffffff;
about_bg.transform.colorTransform=color_transform;
    var fadeOut:Tween = new Tween(about_bg, "alpha", Strong.easeOut,1,0,1,true);
I thought it would be okay to add more event listeners below about_bg, then copy the functions the functions and change the about_bg words to tracks_bg etc. This doesn't work
Here is what I was trying to do:
import fl.transitions.Tween;
import fl.transitions.easing.*;
about_bg.addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
about_bg.addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
tracks_bg.addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
tracks_bg.addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
function manageMouseOver(event:MouseEvent):void{
     var color_transform:ColorTransform=about_bg.transform.colorTransform;
color_transform.color=0xbf3a3a;
about_bg.transform.colorTransform=color_transform;
    var fadeIn:Tween = new Tween(about_bg, "alpha", Strong.easeOut,0,1,1,true);
function manageMouseOut(event:MouseEvent):void{
    var color_transform:ColorTransform=about_bg.transform.colorTransform;
color_transform.color=0xffffff;
about_bg.transform.colorTransform=color_transform;
    var fadeOut:Tween = new Tween(about_bg, "alpha", Strong.easeOut,1,0,1,true);
function manageMouseOver(event:MouseEvent):void{
    var color_transform:ColorTransform=tracks_bg.transform.colorTransform;
color_transform.color=0xbf3a3a;
tracks_bg.transform.colorTransform=color_transform;
    var fadeIn:Tween = new Tween(tracks_bg, "alpha", Strong.easeOut,0,1,1,true);
function manageMouseOut(event:MouseEvent):void{
    var color_transform:ColorTransform=tracks_bg.transform.colorTransform;
color_transform.color=0xffffff;
tracks_bg.transform.colorTransform=color_transform;
    var fadeOut:Tween = new Tween(tracks_bg, "alpha", Strong.easeOut,1,0,1,true);
You get the idea. Its long winded and doesn't work anyway. What do I do here? Thanks in advance for any help...

Hey,
Thanks for the answer. I've replaced my code with that and changed it to 'SimpleButton' rather than MovieClip and it works exactly as before. However, I'm still unsure of where to add the buttons. I'm using a master AS layer and not going in them individually.
Here's what I've got now:
import fl.transitions.Tween;
import fl.transitions.easing.*;
about_bg.addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
about_bg.addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
function manageMouseOver(event:MouseEvent):void
     var btn:SimpleButton = event.target as SimpleButton; //just assume that it is a MovieClip, change to whatever it is i.e. Button
     var color_transform:ColorTransform=btn.transform.colorTransform;
     color_transform.color=0xbf3a3a;
     btn.transform.colorTransform=color_transform;
     var fadeIn:Tween = new Tween(btn, "alpha", Strong.easeOut,0,1,1,true);
function manageMouseOut(event:MouseEvent):void
     var btn:SimpleButton = event.target as SimpleButton; //just assume that it is a MovieClip, change to whatever it is i.e. Button
     var color_transform:ColorTransform=btn.transform.colorTransform;
     color_transform.color=0xffffff;
     btn.transform.colorTransform=color_transform;
    var fadeOut:Tween = new Tween(btn, "alpha", Strong.easeOut,1,0,1,true);
I tried adding: tracks_bg.addEventListener(MouseEvent.MOUSE_OVER, manageMouseOver);
                    tracks_bg.addEventListener(MouseEvent.MOUSE_OUT, manageMouseOut);
^ Below the about event listener lines and it says its an undefined property. Sorry, I'm a noob with this

Similar Messages

  • I am un able to send mail as it gets stuck in my outbox. I am sure the solution is simple but need help?

    I am un able to send mail as it gets stuck in my outbox. This is a recent phenomena. I am sure the solution is simple but need help?

    I looked everywhere for a solution - and I finally figured it out! Deleting my accounts didn't work, but here is what worked. This worked when my Gmail accounts were not sending properly. I'm not sure if it works for other e-mail services.
    1. While in Mac Mail, click "Mail" in the top left corner of the screen
    2. Click "Preferences"
    3. Click "Accounts"
    4. Select your account that isn't sending properly
    5. In "Outgoing Mail Server (SMTP)" there will be two options - Gmail & Gmail (offline)
    Make sure that "Gmail" is selected and NOT "Gmail (offline)"
    If you navigate to another section in Preferences, it will ask you to SAVE - make sure you save your changes!
    It worked for me, hope it works for you!

  • Probably simple but need help~

    My macbook wont let me log in. A message appears saying disk space full but i cant log on to delete anything. The spinning circle appears, screen goes white, then tells me to re enter my password. I want in on my computer!

    You need to move or delete some stuff. Boot into single user mode to at least get access.
    http://support.apple.com/kb/ht1492

  • Simple but need help

    hw can i display a page r content in the same page by clicking a href link ???
    Thanks in advance

    You can use RequestDispatcher.Include() method,
    Or you can try with the latest scripting tachnique AJAX for this.
    AJAX has the ability to put/modify contents in parts of the page even with out changing the url(that is in the same page itsely)
    Regards......

  • HT201363 I need to reset a Iphone4 I brought second hand, but the original owner do not know her apple Id or password. What should I do? (need help ASAP)

    I need to reset a Iphone4 I brought second hand, but the original owner do not know her apple Id or password. What should I do? (need help ASAP)

    You need to contact Apple. Click here, phone them, and ask for the Account Security team, or fill out and submit this form.
    (92501)

  • Purchasing MBA but need help on upgrades.

    Hello, I am purchasing an MBA, but need help on upgrades based on the following; I will be attending medical school in the fall, I take a wide range of photos of my family on my iPhone that I play with on certain apps and do store them in the cloud and computer, I have a medium iTunes libaray but will get bigger with the additional apps for school, I am a moderate gamer (I play games online as well as my kids do, but nothing that will take up a ton of space when downloaded like Assassins Creed) and I plan on running MS Office. I've already decided to upgrade to the 8GB but I can't decide if I should upgrade to the 512GB Flash or stay with the 256GB and upgrade from the i5 to i7 or stick with it. I don't plan on buying another until I graduate. I am new to the Mac World outside of the use of my iPhone which convience me to convert from my awful PC. Can you MBA experts relay some advice on a good route. I appreciate it, Thanks

    My rule of thumb is to buy the largest drive storage available. Especially since the Air models can't be upgraded to a larger size in the future. I also like to buy the most amount of RAM offer and as with the storage space on the Air models can't be upgraded once purchased. So Bite the Bullet and spend the money to get both the most RAM and the largest storage offered as neither can be increased later on.  Also I suggest you spend the extra money on the Applecare extended warranty because to fix any Mac once the standard warranty is over is very expensive. You have until the one year standard warranty runs out to buy the Applecare extended warranty.

  • All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so it goes to Default. thanks

    All of my photos are displayed as BW because somehow I've saved a quick develop preset and it saves as BW.  This is for all of my photos.  I can individually undo them but need help in how to get rid of the preset so all photos goes to Default or as shot. thanks

    Go to the develop module and highlight all of the images in the filmstrip at the bottom of the screen. Then activate Auto-sync and click on the Reset button. That should reset all of the images to your camera default settings.

  • I am new to this but need help. Lion and iCloud have never worked on my desk top or MacBook Pro.  Slow or Stop!  Is there any way to fix the problem?

    I am new to this but need help. Lion and iCloud have never worked on my desk top or MacBook Pro.  Slow or Stop!  Is there any way to fix the problem?

    We need more information. I'm not sure what you mean by both Lion and iCloud have never worked.

  • HT201269 I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone I purchased 2 weeks ago when my Iphone was stolen. I don't know how to get the money or music on new phone?

    Need help with Itunes transferrs and can I use my Edge phone as a router?

    I'm not a tech person, but need help with my Itunes account in transferring money and downloads onto new phone
    Is this an iPhone?
    Set it up using the AppleID you used on the previous iPhone.

  • Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help.

    Ok so I have a free standing iSight Cam, is it possible to use it with my white MacBook ? and if so how do I go about it ? I've tried researching for updates, drives but need help. Can someone give me some direction ?

    jpatricio787 wrote: ... is it possible to use it with my white MacBook ?...
    OK so yes, but if, and only if:
    (1) your MacBook has a Firewire port (not all do)
        - and -
    (2) your old external iSight camera works (not all do)
        - and -
    (3) your MacBook is working properly.
    If you are not certain whether your MacBook model has Firewire, you can search MacBook Technical Specifications for your model.  Alternatively, check the  User Guide Manual that came with your MacBook for the information you need to be certain.
    If you are not certain that your old external iSight camera works, you can test it using the suggestions in this link.
    jpatricio787 wrote: ... if so how do I go about it ? ...
    Follow the instructions in your iSight User's Guide to connect and turn on the iSight.  Then launch the Apple app you want to use with your iSight.  If you need more information about using an app, search for "camera" (without the quote marks) in the Help menu choice for the app.
    jpatricio787 wrote:... Can someone give me some direction ?
    If you need more direction, post back the specifics of what you still need.  We will offer further direction based on the details of your reply.
    Message was edited by: EZ Jim
    Mac OSX 10.9.3

  • I have no photo edit in iPhoto it should be simple but its just not there can you help

    Hi
    i have no photo edit in iPhoto it should be simple as click and it comes up but it is not there
    hope someone can help
    thanks

    Nope - you actually have to share details as  can not see your computer
    See hints here - Writing an effective Apple Support Communities question - and - Find answers and ask new questions
    LN

  • Really, really easy but need help

    This question is very easy but I just began java and I need help. I need to write a simple program to display an invoice with item name, number, quantity, and price. I am going to use two classes but I can't figure out how to create instances to make the items display. Can anyone help?

    here you go, hope the following code helps
    public class InvoiceTest
         public static void main(String[] args)
              Invoice in = new Invoice("375ml fanta", 1234, 10, 1.5);
              System.out.println(in.toString());
    public class Invoice
         private String itemName;
         private int itemNumber;
         private int quantity;
         private double price;
         private double totalPrice;
         public Invoice(String name, int num, int qua, double price)
              itemName = name;
              itemNumber = num;
              quantity = qua;
              this.price = price;
         public String getItemName()
              return itemName;
         public int getItemNumber()
              return itemNumber;
         public int getQuantity()
              return quantity;
         public double getPrice()
              return price;
         public double getTotalPrice()
              totalPrice = (double)(price * quantity);
              return totalPrice;
         public String toString()
              return "invoice detail: \n"
                     + "item name: " + getItemName() + "\n"
                     + "item number: " + getItemNumber() + "\n"
                     + "quantity: " + getQuantity() + "\n"
                     + "price:" + getPrice() + "\n"
                     + "total price: " + getTotalPrice();
    }

  • This sign appeared in my account: "Your payment method was declined. Update your biiling info'. After adding new information about my others cards I see the same sign. Can't understand what the problem is and what should I do. Need help!!!

    This sign appeared in my account: "Your payment method was declined. Update your biiling info'. After adding new information about my others cards I see the same sign. Can't understand what the problem is and what should I do. Everything used to be good before.
    Do anyone know what I supposed to do in that situation?
    Really need help!
    Thanks in advance.

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Getting a new iMac - overwhelmed w info here but need help

    Hi,
    I'm getting a new iMac next week and need help with Blackberry Bold 9000 issues and syncing with iCal, etc on the machine.  I have been told that I can buy an app for about $30 that will sync the BB with the mac programs but reading here, I am confused - are some of the posts here and the KB notes related to syncing directly with the mac software or are they only for making a separate BB desktop for the mac?
    I have looked at several of the KB notes but I haven't found the answer yet.
    thanks.
    marcelcat
    Bold 9000 owner since Feb 2009

    What’s the difference between:
    8GB 1066MHz DDR3 SDRAM - 4x2GB http://Add $200.00...
    (from 4GB 1066MHz DDR3 SDRAM - 2x2GB)
    and
    8GB 1066MHz DDR3 SDRAM - 2x4GB http://Add $600.00
    4GB DIMMs are at present significantly more expensive than 2GB DIMMs. It's your choice whether to pay the extra money and have empty slots available for additional future memory expansion (without removing any existing memory).
    I presume 2.8GHz Quad-Core Intel i7 is bigger, or more powerful than the 3.33GHz Intel Core 2 Duo of the 21.5” iMac model. Correct?
    Generally yes. You can see benchmarks on places like Barefeats if you want to see comparison numbers.
    it appears the CD/DVD problem thing is not evident in the 27” model as it at least was in the 21.5” model. Right?
    I can't add anything to what I said on the subject previously.
    cracked screens upon opening the box of the new computer, were much more of a problem for the bigger, 27” models that the 21.5” models. Hopefully, Apple has taken care of that by packaging them more carefully.
    I haven't seen a report of any cracked screens in several weeks now. But with the gorillas the shipping companies tend to use, there are no guarantees. I once received a pallet-load of computers that the trucking company had driven a forklift blade through. So you never know how your computer might arrive. The prevalence of problems seems to have been alleviated, though.
    Regards.

  • Unlock iphone - have authorization but need help

    I am trying to unlock my iPhone 5 so that I can pass it on to someone else.
    I have gone ahead and backed up and restored the phone to factory settings just as a housecleaning step to clean out the phone .  After I did that I found out that the phone is going to someone else so I requested unlock authorization from my carrier ATT which I have received.
    Here is where I am confused.  The instructions in the ATT email to unlock the phone states that I should backup and restore the phone again to factory settings.  The problem is when I connect the phone to iTunes on my computer I see different options. The screen is Welcome to Your New Phone and it gives me the option to:
    Set the phone us as new
    Restore from this backup (which shows my latest backup)
    I do not see on this screen the option to backup and I thought I did not want to restore from a backup but needed to select restore iPhone.  So basically it seems like I put the carriage in front of the horse.  Where do I go from here? 

    Okay, thanks.  I selected Set up the phone as new and now see the phone in my Mac iTunes. 
    One more question, do I still need to backup the phone which will require me to set up the actual phone or can I skip that step and just restore phone?

Maybe you are looking for