Solved

get the x posion of a panel inside a HDividedBox

Posted on 2011-02-25
4
486 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
Comment Utility
Kindly share the mxml file structure.

Warm Regards
Deepanjan Das
0
 

Author Comment

by:cghrmauritius
Comment Utility
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
Comment Utility
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
Comment Utility
ok thanks suffering  tiredness from working round the clock, thanks
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now