Solved

get the x posion of a panel inside a HDividedBox

Posted on 2011-02-25
4
490 Views
Last Modified: 2012-05-11
Hi i have a HDividedBox containing two panels

panel1 | panel2

what i need to do is find out the x position of panel2 within the panel2 code

i thought this would be as easy as using the this.x but alas this returns as 0

Please HElp very urgent
0
Comment
Question by:cghrmauritius
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 17

Expert Comment

by:deepanjandas
ID: 34985360
Kindly share the mxml file structure.

Warm Regards
Deepanjan Das
0
 

Author Comment

by:cghrmauritius
ID: 34985810
Simplified mxml file structure

note that Panel2 is actually a custom component and its withing the panel2 which i am trying to find its x position within its parent DividedBox

thanks in advance
<mx:HDividedBox width="100%" height="100%">
<mx:Panel width="300" height="100%" id="panel1"/>
<mx:Panel width="100%" height="100%" id="panel2"/>
</mx:HDividedBox>

Open in new window

0
 
LVL 17

Accepted Solution

by:
deepanjandas earned 500 total points
ID: 34986004
Try This:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" 
				backgroundColor="gray" height="100%" 
				verticalScrollPolicy="auto" horizontalScrollPolicy="auto"
				
				>

    <mx:Script>
        <![CDATA[
            private function onClick( event:MouseEvent ):void
			{
				var o:* = (event.currentTarget);
				trace( o.parent.x );
			}
              
        ]]>
   </mx:Script>        
	<mx:HDividedBox width="100%" height="100%">
		<mx:Panel width="300" height="100%" id="panel1"/>
		<mx:Panel width="100%" height="100%" id="panel2">
			<mx:Button click="onClick(event)" label="click" />
		</mx:Panel>
			
	</mx:HDividedBox>   
</mx:Application>

Open in new window


Warm Regards
Deepanjan Das
0
 

Author Closing Comment

by:cghrmauritius
ID: 34986147
ok thanks suffering  tiredness from working round the clock, thanks
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

696 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