Advertisement

05.01.2008 at 01:22PM PDT, ID: 23369930
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.6

How to prevent Panel's MouseOver and MouseOut event when buttons are present

Asked by stockblocks in Adobe Flex

Tags: , , ,

The attached code will explain my problem.

I have a Flex 2.01 application with a panel that holds buttons.  The panel begins in a collapsed state (i.e., I've set the Panel height to 35 pixels to show only the upper caption).  I have another state that puts the Panel's height at 100%. When the mouse is placed in it's bounds, I trigger the currentState to that other state, the effect being that the panel expands to show the buttons.  When the mouse leaves the panel, the panel collapses back to it's original state.

My problem is when the mouse is moved over the buttons, or over the region that shows the panel caption.  It triggers the Panel's MouseOver and MouseOut event.  I can understand why, but don't know how to resolve this undesirable side-effect.

I'm currently experimenting with a function that analyzes the mouse's X:Y location and avoid setting the currentState if the X:Y mouse location appears to be within the Panel's boundaries.  But I'm doubtful this is the most efficient way.

I'm surprised no one has responded to this post, as I presume there is a fairly easy solution from a seasoned Flex coder!

SBStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
<?xml version="1.0" encoding="utf-8"?>	
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
	       layout="vertical" pageTitle="Have a Nice Day!" 
	       themeColor="haloSilver"
	       currentState = "collapsed">
	       
	<mx:transitions>
      <mx:Transition id="heightChange" fromState="*" toState="*">
        <mx:Parallel id="t1" targets="{[testPanel]}">
          <mx:Resize duration="600" />
        </mx:Parallel>      
      </mx:Transition>
	</mx:transitions>
 
	<mx:states>
		<mx:State name="collapsed">
			<mx:SetProperty target="{testPanel}" name="height" value="35"/>
		</mx:State>
	</mx:states>
 
	<mx:Panel id="testPanel"
              borderThicknessLeft="2"
              borderThicknessRight="2"
              borderThicknessTop="2"
              borderThicknessBottom="2"
              title="Transition test"
              width="186" height="189"
              layout="absolute" 
              mouseOver="currentState=''"
              mouseOut="currentState='collapsed'"
              >
		<mx:Button x="19" y="24" label="Huey" width="144"/>
		<mx:Button x="19" y="64" label="Dewey" width="144"/>
		<mx:Button x="19" y="108" label="Louie" width="144"/>
	</mx:Panel>
	       
</mx:Application>
[+][-]05.04.2008 at 11:47PM PDT, ID: 21498449

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Adobe Flex
Tags: Adobe, Flex, 2.01, Panel transition with buttons
Sign Up Now!
Solution Provided By: hobbit72
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628