Solved

get the x posion of a panel inside a HDividedBox

Posted on 2011-02-25
4
488 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
  • 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to translate path in URL with PHP? 11 47
Magento Indexing 1 98
Swiper slider stops between pages 11 50
Windows Tool to Build Android and iOS App 3 82
It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to count occurrences of each item in an array.

825 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