Bring Image to front on mouse over in Flash

Posted on 2006-04-30
Last Modified: 2010-07-27
I am trying to make a profile for myspace with a custom friends list. each persons picture enlarges on mouse over, BUT I can't get arrangement  to be on top on mouse over.

I'm somewhat new to Flash and I have very little experience with action scripting.

The link to the swf file is You'll see what I mean on the friends list, I want each picture to be on top of the others only on mouse over.

Question by:duztin
    LVL 3

    Expert Comment

    if you are using movieclips your can use the swapDepths() function.... e.g.
    chose a high number you know you won't exceed with amount of mc's on the stage. the number refers to the level.

    it doesn't work with buttons, so if your rollover is inside a button, you'll need to place every button into its own movieclip and then add this code to the buttons onRollOver state:

    2 ways of adding rollover functionality of your own to a button:

    butInstanceName.onRollOver = function() {this._parent.swapDepths(3000);}
    apply on (rollOver) {this._parent.swapDepths(3000);} directly to the button instance:

    hope this helps,

    Author Comment

    I can't get your examples to work. they are buttons, I tried putting them into a movieclip. With no luck. Like I said I'm not familiar with action scripting so it's prob something I'm doing wrong. Would it be possible for you to look at the fla file for me?
    LVL 3

    Accepted Solution

    i'm really sorry, but i won't be able to look at your fla until tuesday morning as i am about to leave the office and won't be back until then, so let me quickly try clear some stuff up.

    each button needs to be in its own movieclip.... so, if you have 3 buttons on your stage, right click each one and say "convert to symbol".... you will now have a movieclip on your stage which holds your button. do this for every button individually.... you need as many movieclips on the stage as there were origionally buttons, each holding one of the buttons.

    now, double click each of those movieclips,  and click on the button.
    in the actions panel add this code: (i apologise, in my last post i said to use _parent for this way too, when indeed your shouldn't)

    on (rollOver) {

    make sure to do this for each button and make sure to click first on your button before adding this script to the actions panel.

    i hope this helps you and if you're still suffering with it on tuesday, i'd be happy to look at the fla for you!

    Author Comment

    That was it, Thank you for taking the time to explain it to me, the wording used in flash is greek to me. Works perfectly!!!

    Author Comment

    Here is the finished product. Thanks again =P
    LVL 3

    Expert Comment

    glad i could help :)

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
    Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now