Solved

get the x posion of a panel inside a HDividedBox

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using SQL to Generate XML from Large Dataset 80k+ rows 7 50
What is the normal amount of queries 5 84
Problem to echo 6 115
Grunt script for Build Process 1 64
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 …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

733 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