Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Bring button to top on mouse over

Posted on 2006-06-05
4
Medium Priority
?
228 Views
Last Modified: 2008-02-26
I have a gallery style page of small thumbnail image buttons. When the user rolls over each button it needs to enlarge to twice the size and display over the thumbnail images allside of it. Whe the user rolls of the button it needs to return to the original size. I am currently enlarging the buttons on roll over by setting the size on the button over state (frame 2 and 3) of the button library file but cannot get the button to appear on top when the user rolls the mouse over.

I have tried this but I get an error
on (rollOver) {

      //Bring to Front Behavior
      mx.behaviors.DepthControl.bringToFront(this);
      //End Behavior

}

Thanks in advance
0
Comment
Question by:surfjoe
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Ramy_atef
ID: 16831899
actually you better use movie clips not buttons

and the easy code will be

on (rollOver) {

     myMC.swapDepths(1000)

}

Regards,
Ramy
0
 

Author Comment

by:surfjoe
ID: 16832002
If I add the code on the actions layer with an instance of myMC on the stage I get and error but if I add

on (rollOver) {

    swapDepths(1000);

}

to the movie clip it works.

Have do I reset the size when the mouse rolls out back to original size?

Thanks
0
 
LVL 7

Accepted Solution

by:
Ramy_atef earned 2000 total points
ID: 16832048
Excuse me .. do you mean (how do you reset the depth when the mouse rolls out ??)

if so ,

on (rollOver) {
      myDepth = getDepth();
      swapDepths(1000);
}
on (rollOut) {
      swapDepths(myDepth);
}

if that is not what you wanted , please give me more details

Regards,
Ramy
0
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 16832431
Hi surfjoe,

just for your knowledge,
you code is not functional because..."mx.behaviors.DepthControl.bringToFront" does not work with Buttons,

it only support MovieClip...
if you use MovieClip instead of Button, you original code will work fine.

Rgds
Aneesh
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
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 how to load their YouTube profile onto Flash Media Live Encoder.
Suggested Courses

864 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