[flexcoders] Re: Clear user text after enter on TextInput (gumbo and/or moxie)

2009-06-15 Thread gwangdesign
 Try...
 
 (event.target as TextInput).text = ;
 
 (event.target as TextInput).setFocus();
 

Steve, Thanks for the lead. Unfortunately, it doesn't work, either for the 
Gumbo or Halo component.

For mx:TextInput:

The text never gets cleared out after user presses the enter key;

For s:TextInput:

The text is cleared out but the caret disappears, while the textinput still 
gets focus. User has to regain focus on the textinput by first clicking 
somewhere else. And this behavior cannot be programmatically emulated:

anotherComp.setFocus();
(event.target as TextInput).text = ; 
(event.target as TextInput).setFocus();  

I am wondering if it's good on the first place to handle this on the enter 
event of a TextInput component.



[flexcoders] Re: Clear user text after enter on TextInput (gumbo and/or moxie)

2009-06-15 Thread gwangdesign
--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 This works for me (I am using Flex 3.3 with Flash Player 9.0.159)
 
 If this is not a player or Gumbo issue, I would look at other things 
 happening after the enter event.
 
 What happens with a small test case?

Steve, Thanks for the lead.

As I found out, it seems to be the issue when I targeting Flash Player 10. The 
code:

myTextInput.text = ;
//myTextInput.setFocus();// no need to call this.

works exactly as I expect (clearing the previous text entry, with TextInput 
remaining in focus) for an mx:TextInput when compile against FP 9.

Once I target FP10, myTextInput.text =  stops working (text not cleared out 
after enter).

Any ideas??




[flexcoders] Re: Clear user text after enter on TextInput (gumbo and/or moxie)

2009-06-15 Thread gwangdesign

 Please feel free to file bugs for either/both issues at 
 http://bugs.adobe.com/flex/.

Hi Peter,

I filed a bug on spark textinput. Someone else has filed one on mx:TextInput 
(https://bugs.adobe.com/jira/browse/SDK-21617) and provided a workaround which 
is similar to the callLater one you suggested:

setTimeout(doClean, 100);
}
private function doClean():void
{
txt.text='';
} 

Thanks.

Geng
 




[flexcoders] Clear user text after enter on TextInput (gumbo and/or moxie)

2009-06-14 Thread gwangdesign
Hello,

I have a TextInput, say, for user to type in to search something. After the 
user presses enter Key, I want the TextInput to clear the user input text while 
still staying in focus, so that the user can continue to type in other words.

I had a hard time to do this for a TextInput (either Gumbo or Flex 3, although 
they seemingly behave differently.)

For mx:TextInput, I am not even able to clear the user input text by handling 
the enter event:

private function mxTI_handleEnter(event:FlexEvent):void
{
trace(mxTI_handleEnter);
mx.controls.TextInput(event.currentTarget).text = ;
}

Doesn't do anything, even though the setter for text value does get called. 
Same thing for mx.controls.TextInput(event.currentTarget).htmlText= ;

For s:TextInput, setting text property to  does clear the user text but I 
lost caret inside the TextField in the TextInput. I have to click the TextInput 
to regain focus in order to enter something.

BTW, I am not sure if this behavior is something expected from user experience 
point of view since I looked at Google, Yahoo! and Bing, all of them did the 
same thing: once you pressed enter, the search textinput lost focus. You would 
have to regain focus for the textinput to do another search.

Sorry for the long text Hope this makes sense. Anyhow, is this something 
doable? Thanks.



[flexcoders] Re: Clear user text after enter on TextInput (gumbo and/or moxie)

2009-06-14 Thread gwangdesign

 BTW, I am not sure if this behavior is something expected from user 
 experience point of view since I looked at Google, Yahoo! and Bing, all of 
 them did the same thing: once you pressed enter, the search textinput lost 
 focus. You would have to regain focus for the textinput to do another search.

I just found out that the RL ToDoList widget at igoogle.com does exactly the 
same thing as I wanted, except that it is AJAX...:)

http://rlwidgets.com/




[flexcoders] best practice to handle overloading in AS3?

2009-05-28 Thread gwangdesign
Hi,

I am trying to overload a method (same name and different signatures)in a 
subclass. In the inherited class, the method looks like this:

  public function set dataProvider(value:Array):void

In my subclass I want the method to look like this:

  public function set dataProviderr(v:Object):void

So that I can handle different types.

I understand AS3 doesn't support overloading. What would be the smart way(s) to 
handle this?

Thanks.

geng 



[flexcoders] Re: best practice to handle overloading in AS3?

2009-05-28 Thread gwangdesign
Hi Pedro,

Thanks for the guide.

What if I don't have any control over my superclass, like if I were importing 
this from a swc library or something? 

For now I kinda give up the idea of overriding and ended up just use a 
slightly different method name (dataProviderr) for my overriden class:

   public function set dataProviderr(v:Object):void

Thanks again!
 
--- In flexcoders@yahoogroups.com, Pedro Sena sena.pe...@... wrote:

 If you want the same method name in a subclass, we are talking about
 override, not overload.
 
 Flex 'deals with overload' making the arguments optionals, example:
 
 public function test(obj:Object = null):void
 
 then you can invoke it using test() or test(object).
 
 Appears that you are trying to override parent's function but changing it
 signature, that is not possible.
 
 If you want to have in the same class, in the same function, receive two
 different parameters, you can:
 
 public function set dataProviderr(v:Object = null, a:Array = null):void
 
 Then you can put the argument that you want, leaving the another one as null
 
 or you can
 
 public function set dataProviderr(v:*):void
 
 This way you can pass anything you like.
 
 Both solutions are ugly, IMHO, but is the way flex works.
 
 HTH,
 
 PS
 
 On Thu, May 28, 2009 at 6:58 PM, gwangdesign gwangdes...@... wrote:
 
 
 
  Hi,
 
  I am trying to overload a method (same name and different signatures)in a
  subclass. In the inherited class, the method looks like this:
 
  public function set dataProvider(value:Array):void
 
  In my subclass I want the method to look like this:
 
  public function set dataProviderr(v:Object):void
 
  So that I can handle different types.
 
  I understand AS3 doesn't support overloading. What would be the smart
  way(s) to handle this?
 
  Thanks.
 
  geng
 
   
 
 
 
 
 -- 
 /**
 * Pedro Sena
 * Systems Architect
 * Sun Certified Java Programmer
 * Sun Certified Web Component Developer
 */





[flexcoders] Re: scrollbar inside 100% sized background image in container?

2009-05-11 Thread gwangdesign
Hi Charles,

Thanks. I finally get it to work. I didn't get it at first since I thought I 
have to use the scrollbars on the outer Canvas, as opposed to the inner Canvas.

Besides this, you will have to set the percentage width and height both to 100% 
for the inner Canvas to get it work right. Just in case someone else is 
interested.

Cheers,

geng 

--- In flexcoders@yahoogroups.com, Charles Parcell pokemonkil...@... wrote:

 This is dumb, I know, but put your Canvas (with the scrollbars) inside
 another Canvas and apply the background to the parent Canvas so that it
 never has to deal with scrollbar scaling. And set the child Canvas
 background to transparent.
 
 Charles P.
 
 
 On Thu, May 7, 2009 at 4:54 PM, gwangdesign gwangdes...@... wrote:
 
 
 
  Hi,
 
  I am trying to get the scrollbar for a container (can be either a Canvas or
  VBox) inside my background image. Basically my Canvas has a background
  image which I set background-size to 100%. Flex scales the background
  image to fit the whole component when there is no scroll bar. But when the
  scroll bar appears, the image shrinks to allow space for the scroll bar.
 
  So say if the Canvas has a width of 200 px, the background image has a
  width of 200 px when there is no scrollbar. If the scrollbar is 16 pixels
  wide, the background image would become 200 - 16 = 184 px, as opposed to
  staying 200px.
 
  I think I can get around this by using nested containers. Just to want to
  make sure that I am not missing anything obvious.
 
  Thanks.
 
   
 





[flexcoders] scrollbar inside 100% sized background image in container?

2009-05-07 Thread gwangdesign
Hi,

I am trying to get the scrollbar for a container (can be either a Canvas or 
VBox) inside my background image. Basically my Canvas has a background image 
which I set background-size to 100%. Flex scales the background image to fit 
the whole component when there is no scroll bar. But when the scroll bar 
appears, the image shrinks to allow space for the scroll bar.

So say if the Canvas has a width of 200 px, the background image has a width of 
200 px when there is no scrollbar. If the scrollbar is 16 pixels wide, the 
background image would become 200 - 16 = 184 px, as opposed to staying 200px.

I think I can get around this by using nested containers. Just to want to make 
sure that I am not missing anything obvious.

Thanks.



[flexcoders] Re: scrollbar inside 100% sized background image in container?

2009-05-07 Thread gwangdesign
BTW, mx:List and subclasses have a different behavior in this regard. The 
scrollbar is always inside the bound of the List based component.


--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 I am trying to get the scrollbar for a container (can be either a Canvas or 
 VBox) inside my background image. Basically my Canvas has a background 
 image which I set background-size to 100%. Flex scales the background image 
 to fit the whole component when there is no scroll bar. But when the scroll 
 bar appears, the image shrinks to allow space for the scroll bar.
 
 So say if the Canvas has a width of 200 px, the background image has a width 
 of 200 px when there is no scrollbar. If the scrollbar is 16 pixels wide, the 
 background image would become 200 - 16 = 184 px, as opposed to staying 200px.
 
 I think I can get around this by using nested containers. Just to want to 
 make sure that I am not missing anything obvious.
 
 Thanks.





[flexcoders] code hinting for FP 10 functions/classes in FB 3?

2009-05-05 Thread gwangdesign
Does Flex Builder 3 hint code for Flash Player 10 (new) classes such as Vector? 
If so (in case), how to get it work?

Thanks.



[flexcoders] Re: code hinting for FP 10 functions/classes in FB 3?

2009-05-05 Thread gwangdesign
Thanks for the lead. I got the new Vector class compiled. I just don't have 
code hint. I have to literally type in functions like Vector.forEach(), etc.. 

I tried it on both SDK3.3.0 and the nightly build of SDK4.


--- In flexcoders@yahoogroups.com, Pedro Sena sena.pe...@... wrote:

 Search for Flex compiler in your project properties.
 
 There you will see that you can change your sdk, but you will need to
 manually download and install it in you machine (not a big problem at all)
 
 HTH
 
 On Tue, May 5, 2009 at 1:12 PM, gwangdesign gwangdes...@... wrote:
 
 
 
  Does Flex Builder 3 hint code for Flash Player 10 (new) classes such as
  Vector? If so (in case), how to get it work?
 
  Thanks.
 
   
 
 
 
 
 -- 
 /**
 * Pedro Sena
 * Systems Architect
 * Sun Certified Java Programmer
 * Sun Certified Web Component Developer
 */





[flexcoders] data effect for list control when item changes

2009-05-01 Thread gwangdesign
Hi,

I am trying to use data effect for a list control, when an item in the 
dataprovider changes (not deleted or added but some properties change). 

I am looking for something like this:

http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/

but for a list control. For example if the text gets longer in a Text control 
which serves as the item renderer, every renderer gets expanded; or if I am 
using an Image control as the item renderer and if one of the image source 
changes to a higher resolution, the whole listTile should play an effect.

In the documentation, it says Data effects make it possible to apply effects 
to the item renderers in List and TileList controls when the data provider for 
the control changes. But the examples only show you how to apply effects when 
items are added/deleted, but not when an item's properties change.

Thanks.





[flexcoders] Re: data effect for list control when item changes

2009-05-01 Thread gwangdesign
After poking into the documentation, I kinda guess replacementItem might be 
what I need. Anyone know of any examples for it?

Thanks.


--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 I am trying to use data effect for a list control, when an item in the 
 dataprovider changes (not deleted or added but some properties change). 
 
 I am looking for something like this:
 
 http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/
 
 but for a list control. For example if the text gets longer in a Text control 
 which serves as the item renderer, every renderer gets expanded; or if I am 
 using an Image control as the item renderer and if one of the image source 
 changes to a higher resolution, the whole listTile should play an effect.
 
 In the documentation, it says Data effects make it possible to apply effects 
 to the item renderers in List and TileList controls when the data provider 
 for the control changes. But the examples only show you how to apply effects 
 when items are added/deleted, but not when an item's properties change.
 
 Thanks.





[flexcoders] Re: relationship of mxml child tags and actionscript

2009-04-17 Thread gwangdesign
Aaron,

Thanks much for the lead. I was digging into the Flex 3 doc pdf and it seems it 
was a little harder to get around;) Maybe just for me...

Have a great weekend!

-geng

--- In flexcoders@yahoogroups.com, Aaron Hardy aaronius...@... wrote:

 Geng,
 
 Use the DefaultProperty metadata tag in your AS class.  Whatever 
 property you specify will be the property to which your MXML children 
 will be set.
 
 Here's a start:
 http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Partsfile=metadata_141_07.html
 
 Aaron
 
 gwangdesign wrote:
 
 
  Hi,
 
  I am still looking for some general documentations about the 
  guidelines as to how to write ActionScript custom components. It's 
  clear that you can expose public properties, styles and event 
  listeners of your custom components as MXML properties.
 
  But what are the general rules if I want to allow my client developers 
  to define a property in my custom component using a MXML child tag (as 
  opposed to a property)?
 
  Like this:
 
  my:MyComp
  my:myChild color=0xFF width=300
  mx:Label text={data}/
  /my:myChild
  /my:MyComp
 
  Again, I am looking for _general_ guidelines. Thanks much.
 
  -geng
 
 





[flexcoders] relationship of mxml child tags and actionscript

2009-04-15 Thread gwangdesign
Hi,

I am still looking for some general documentations about the guidelines as to 
how to write ActionScript custom components. It's clear that you can expose 
public properties, styles and event listeners of your custom components as MXML 
properties.

But what are the general rules if I want to allow my client developers to 
define a property in my custom component using a MXML child tag (as opposed to 
a property)?

Like this:

my:MyComp
   my:myChild color=0xFF width=300
  mx:Label text={data}/
   /my:myChild
/my:MyComp

Again, I am looking for _general_ guidelines. Thanks much.

-geng



[flexcoders] white box under backgroundImage for List component?

2009-04-13 Thread gwangdesign
Hi,

I am having a problem with using CSS to assign backgroundImage for my 
component which subclasses List. The problem is on the very bottom of the 
component there is always a solid while rectangle that I cannot get rid of. 
I'vetried the same CSS for a Box component and there is no such a while box on 
the background.

The background image is a png file with alpha channel and rounded corner.

Here is the style and the link:
http://maohao.com/blogs/wordpress/ListBackgroundImage/bin-release/TestComp.html
(right click to view the source. thanks!)

.box
{
background-image: Embed(source=assets/contactbkg.png,
scaleGridTop=10, scaleGridBottom=101,
scaleGridLeft=11, scaleGridRight=154);
background-size: 100%;
font-family: arialEmbedded;
drop-shadow-enabled: false;
color: #FF;
padding-left: 0;
padding-top: 0;
padding-right: 0;
padding-bottom: 0;
}



[flexcoders] Re: white box under backgroundImage for List component?

2009-04-13 Thread gwangdesign
Hi Tim,

Oops! My bad. I forgot to trim the transparent space off the background image 
in the bin-debug folder...

Thanks much for the hint.

No everything works fine.

Back to cave...

--- In flexcoders@yahoogroups.com, Tim Hoff timh...@... wrote:

 
 Hi,
 
 A couple of things that you need to do to make this happen.  First,
 remove as much of the padding, in the image png file, that you can. 
 Otherwise, the list items will be positioned outside of the background
 image.  Second, you can fool flex by adding these two lines to your css:
 
 background-color: #00;
 border-style: none;
 
 -TH
 
 --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@
 wrote:
 
  Hi,
 
  I am having a problem with using CSS to assign backgroundImage for
 my component which subclasses List. The problem is on the very bottom of
 the component there is always a solid while rectangle that I cannot get
 rid of. I'vetried the same CSS for a Box component and there is no such
 a while box on the background.
 
  The background image is a png file with alpha channel and rounded
 corner.
 
  Here is the style and the link:
 
 http://maohao.com/blogs/wordpress/ListBackgroundImage/bin-release/TestCo\
 mp.html
  (right click to view the source. thanks!)
 
  .box
  {
  background-image: Embed(source=assets/contactbkg.png,
  scaleGridTop=10, scaleGridBottom=101,
  scaleGridLeft=11, scaleGridRight=154);
  background-size: 100%;
  font-family: arialEmbedded;
  drop-shadow-enabled: false;
  color: #FF;
  padding-left: 0;
  padding-top: 0;
  padding-right: 0;
  padding-bottom: 0;
  }
 





[flexcoders] Re: white box under backgroundImage for List component?

2009-04-13 Thread gwangdesign
I figured it out, sort of.

Setting backgroundcolor to null gets rid of the white box underneath.

backgroundColor: null;

But now the new problem is that each the rollover/selected row
has a bar that stretches beyond the boundary of the background image (bigger 
than for the rows on the top/bottom and wider for the rows in between.)

Thanks.

I guess I can fix it by making the 

--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 I am having a problem with using CSS to assign backgroundImage for my 
 component which subclasses List. The problem is on the very bottom of the 
 component there is always a solid while rectangle that I cannot get rid of. 
 I'vetried the same CSS for a Box component and there is no such a while box 
 on the background.
 
 The background image is a png file with alpha channel and rounded corner.
 
 Here is the style and the link:
 http://maohao.com/blogs/wordpress/ListBackgroundImage/bin-release/TestComp.html
 (right click to view the source. thanks!)
 
 .box
   {
   background-image: Embed(source=assets/contactbkg.png,
   scaleGridTop=10, scaleGridBottom=101,
 scaleGridLeft=11, scaleGridRight=154);
   background-size: 100%;
   font-family: arialEmbedded;
   drop-shadow-enabled: false;
   color: #FF;
   padding-left: 0;
   padding-top: 0;
   padding-right: 0;
   padding-bottom: 0;
   }





[flexcoders] Re: override commitSelectedIndex for ViewStack component

2009-04-08 Thread gwangdesign
Tracy, Thanks much for the info. I did check out some of tink's effects 
components (including some of those Papervision3D ones). All of which seem to 
be custom effects, as opposed to subclass of a container component.

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 There is a component that does this quite well.  It is by tink, called the
 PairedStackEffect, check it out first.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of gwangdesign
 Sent: Tuesday, April 07, 2009 7:37 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] override commitSelectedIndex for ViewStack component
 
  
 
 
 
 
 
 
 Hi,
 
 I am sure this has been discussed somewhere by someone before. So excuse me
 if this is an old topic. But what I want is when the selectedIndex changes
 in a ViewStack component, instead of the default behavior of waiting until
 the current selected child completes its hideEffect to start the showEffect
 of the new selected child, I would like to play both effects concurrently
 (as a compound parallel effect).
 
 So I guess what I need to do is to override the commitSelectedIndex method
 in ViewStack for my subclass. But by looking at the code, I am convinced
 it's a little bit over my head at least for now. So I'd love some lead (the
 more detailed the better;)) as to how I should override the method. Sample
 code is much appreciated. 
 
 Thanks a lot.
 
 -geng





[flexcoders] override commitSelectedIndex for ViewStack component

2009-04-07 Thread gwangdesign
Hi,

I am sure this has been discussed somewhere by someone before. So excuse me if 
this is an old topic. But what I want is when the selectedIndex changes in a 
ViewStack component, instead of the default behavior of waiting until the 
current selected child completes its hideEffect to start the showEffect of the 
new selected child, I would like to play both effects concurrently (as a 
compound parallel effect).

So I guess what I need to do is to override the commitSelectedIndex method in 
ViewStack for my subclass. But by looking at the code, I am convinced it's a 
little bit over my head at least for now. So I'd love some lead (the more 
detailed the better;)) as to how I should override the method. Sample code is 
much appreciated. 

Thanks a lot.

-geng



[flexcoders] node depth in xml/xmllist?

2009-04-02 Thread gwangdesign
Hi,

Could anyone tell me how I can get the depth of a node in an xml/xmlList? Say 
if the node has 0 parent node (root), it's at depth of 0; if it has 1 direct 
parent node which is the direct child of root, it's at the depth of 2, etc.

Thanks.

-geng



[flexcoders] VSlider direction?

2009-03-30 Thread gwangdesign
I am trying to make a VSlider but in a reversed direction than the default 
one, i.e., making it up side down, i.e., with the maximum value on the bottom 
and the minimum value on the top.

What would be the easiest/fastest way?

One of the innovative ways (but unsuccessful) I tried was setting the maximum 
value to the minimum property and the minimum value to the maximum property.

Thanks.



[flexcoders] Re: [101] measured width vs. explicit width vs. width

2009-03-26 Thread gwangdesign
Thanks Gordon for the clarification. Authority's guide is always appreciated!

--- In flexcoders@yahoogroups.com, Gordon Smith gosm...@... wrote:

 Yes, this is close.
 
 The measure() method typically sets the measuredWidth and measuredHeight 
 based on how much room a component needs to display its information. For 
 example, a Button computes its measured size to be just large enough to 
 display its label String. An HBox computes its measured size to be just large 
 enough to display all of its children. Etc.
 
 In addition to the measuredWidth and the explicitWidth, there is also a 
 percentWidth. These are conceptually the three inputs that determine the 
 actual width as the output of the layout process. The actual width is not 
 known until the component has undergone a LayoutManager pass.
 
 For historical reasons related to ease-of-use consideration, the width 
 property does double duty. As a setter, it sets the explicitWidth. As a 
 getter, it returns the actual width.
 
 Gordon Smith
 Adobe Flex SDK Team
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of gwangdesign
 Sent: Wednesday, March 25, 2009 8:44 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] [101] measured width vs. explicit width vs. width
 
 
 Hi,
 
 This is a really basic question about UIComponent. My understanding is that:
 
 1. measuredWidth is the default or suggested or appropriate width that a 
 (subclassing) UIComponent asks for itself;
 
 2. explicit width is the value you set explicitly to the width property 
 of the component;
 
 3. width is the real or final width as the component gets drawn to the 
 screen *after* the displaylist gets updated. This value is either the 
 explicit width as the developer sets it, or something that the container 
 (parent) components finally determine based on the measuredWidth the 
 component asked for and other factors such as the real estate available for 
 it.
 
 Is this something close to the truth/rules?
 
 Please advice and/or correct. Thanks.





[flexcoders] [101] measured width vs. explicit width vs. width

2009-03-25 Thread gwangdesign
Hi,

This is a really basic question about UIComponent. My understanding is that:

1. measuredWidth is the default or suggested or appropriate width that a 
(subclassing) UIComponent asks for itself;

2. explicit width is the value you set explicitly to the width property of 
the component;

3. width is the real or final width as the component gets drawn to the screen 
*after* the displaylist gets updated. This value is either the explicit width 
as the developer sets it, or something that the container (parent) components 
finally determine based on the measuredWidth the component asked for and 
other factors such as the real estate available for it.

Is this something close to the truth/rules?

Please advice and/or correct. Thanks. 



[flexcoders] mx_internal BoxLayout?

2009-03-21 Thread gwangdesign
Hi,

I am subclassing UIComponent to do something very similar to a VBox. The 
difference is that when a child is selected, all the children are then moved so 
that the selected one is centered vertically on the VBox.

I thought this was easy. But my code never works except for when the 
selectedIndex is zero (when the top most child is selected). If I try to 
change selectedIndex after my component is created, the layout never updates. 
If I try to set the selectedIndex in its MXML tag, it behaves different when 
I run it than when I run it in debug mode and step into my layout code...

I look at the mx.containers.VBox and notice it actually uses a utility class 
called BoxLayout which uses mx_internal namespace.

My code is very simple, in my updateDisplayList, I do:

(pseudo code)

find the selected child,
   it's vertical position (compared to the parent) is 0;
do this for each child above the selected child
{
   its y position is the y position of the child that is right below it minus 
this child height;
}
do this for each child below the selected child
{
   its y position is the y position of the child that is right above it plus 
this child height;
}

I use Container.getExplicitOrMeasuredHeight() to get the actual height.

Right now, I am trying to use the mx_internal BoxLayout and see if it works.

Thanks.



[flexcoders] Re: changes on item renderers on a List

2009-03-15 Thread gwangdesign
Hi Alex, 

Thanks much for the lead.

What do you mean virtualization? Are you referring to recycling of the 
renderers?

The fancy stuff I am working on are supposed to be dealing with large amount 
of data while still showing more detailed view of some portions where the user 
is interested...

Another problem I am struggling with is whether to have my component determine 
the states of the item renderers. For example, how do you choreograph the 
transitions of all the item renderers involved (like shrinking the items that 
just lost focus and then expanding the item that just get focus)? It seems it 
should be the job of my component; but when an item renderer expands, it may 
mean to display more detailed information by switching to another state, which 
looks like it may be better handled by its own.

geng

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 If you're doing some fancy stuff and don't need virtualization you can just 
 use a VBox.  You could probably fake a single selection model with states 
 pretty easily.
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of gwangdesign
 Sent: Saturday, March 14, 2009 10:41 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: changes on item renderers on a List
 
 
 Hi Tracy,
 
 Thanks for the heads-up. I was aware that list based components recycle their 
 item renderers. For example, when you scroll the list, it could break the 
 component if there are some renderers that were already in the expanded 
 states;)
 
 I went ahead and did these in my component which subclasses List.
 
 (Dictating states of listItemRenderers in the List subcomponent)
 http://maohao.com/blogs/wordpress/TestSimpleZoomableList/bin-release/TestSimpleZoomableList.html
 
 (Letting the individual item renderers to decide which state they want to go)
 http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.html
 
 After all the struggle, I found out there are really _a lot_ going on under 
 the hood on a List/ListBase component (this includes buffering spare list 
 item renderers, managing scrolling, clipping, etc.) When I have some time, I 
 may just extend UIComponent, or hunt for some other components that are more 
 tolerant of transitions...:)
 
 Thanks and have a nice weekend.
 
 -geng
 
 --- In flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com, 
 Tracy Spratt tspratt@ wrote:
 
  I think I would approach this by having an isExpanded property on the
  dataProvider items, and toggle that property using logic in a change
  handler. The renderer would use that property to set its visual state.
 
 
 
  There won't be any clear relationship between selectedItems and the visual
  renderers.
 
 
 
  Tracy Spratt,
 
  Lariat Services, development services available
 
  _
 
  From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com 
  [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On
  Behalf Of gwangdesign
  Sent: Friday, March 13, 2009 6:05 PM
  To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com
  Subject: [flexcoders] changes on item renderers on a List
 
 
 
  Hi,
 
  I am re-sending this question since this seemingly simple question has been
  taking me a bit much longer than I expected;)
 
  I have a whole bunch of item renderers inside a List (or it lays out and
  scrolls the renderers the way a List does). Here is what I am trying to do:
  I'd like to expand/shrink these item renderers based on whether they are
  newly selected or de-selected. My approach right now is extending List
  class. I listen to ListEvent.CHANGE event and invalidate my component as it
  occurs. I then try to figure out which renderer has been
  selected/deselected... and I can't.
 
  Basically my component is interested in the following actions:
  1. When allowMultipleSelection is true, user selects an item that hasn't
  been selected yet;
  2. When allowMultipleSelection is true, user selects an already selected
  item;
  3. When allowMultipleSelection is false, user selects a new item;
  4. When allowMultipleSelection is false, user selects an already selected
  item;
 
  I poke into the code of mx.controls.ListBase and List and the code is a bit
  over my head right now;)
 
  Any ideas? pseudo code is welcome!
 
  Thanks and have a great weekend!
 
  -geng
 





[flexcoders] Re: changes on item renderers on a List

2009-03-14 Thread gwangdesign
Hi Tracy,

Thanks for the heads-up. I was aware that list based components recycle their 
item renderers. For example, when you scroll the list, it could break the 
component if there are some renderers that were already in the expanded states;)

I went ahead and did these in my component which subclasses List. 

(Dictating states of listItemRenderers in the List subcomponent)
http://maohao.com/blogs/wordpress/TestSimpleZoomableList/bin-release/TestSimpleZoomableList.html

(Letting the individual item renderers to decide which state they want to go)
http://weblogs.macromedia.com/pent/archives/2006/04/a_list_itemrend.html

After all the struggle, I found out there are really _a lot_ going on under the 
hood on a List/ListBase component (this includes buffering spare list item 
renderers, managing scrolling, clipping, etc.) When I have some time, I may 
just extend UIComponent, or hunt for some other components that are more 
tolerant of transitions...:)

Thanks and have a nice weekend.

-geng

--- In flexcoders@yahoogroups.com, Tracy Spratt tspr...@... wrote:

 I think I would approach this by having an isExpanded property on the
 dataProvider items, and toggle that property using logic in a change
 handler.  The renderer would use that property to set its visual state.
 
  
 
 There won't be any clear relationship between selectedItems and the visual
 renderers.
 
  
 
 Tracy Spratt,
 
 Lariat Services, development services available
 
   _  
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
 Behalf Of gwangdesign
 Sent: Friday, March 13, 2009 6:05 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] changes on item renderers on a List
 
  
 
 Hi,
 
 I am re-sending this question since this seemingly simple question has been
 taking me a bit much longer than I expected;)
 
 I have a whole bunch of item renderers inside a List (or it lays out and
 scrolls the renderers the way a List does). Here is what I am trying to do:
 I'd like to expand/shrink these item renderers based on whether they are
 newly selected or de-selected. My approach right now is extending List
 class. I listen to ListEvent.CHANGE event and invalidate my component as it
 occurs. I then try to figure out which renderer has been
 selected/deselected... and I can't.
 
 Basically my component is interested in the following actions:
 1. When allowMultipleSelection is true, user selects an item that hasn't
 been selected yet;
 2. When allowMultipleSelection is true, user selects an already selected
 item;
 3. When allowMultipleSelection is false, user selects a new item;
 4. When allowMultipleSelection is false, user selects an already selected
 item;
 
 I poke into the code of mx.controls.ListBase and List and the code is a bit
 over my head right now;)
 
 Any ideas? pseudo code is welcome!
 
 Thanks and have a great weekend!
 
 -geng





[flexcoders] previously selected indices in List?

2009-03-13 Thread gwangdesign
Hi,

This might be a simple one but I am having a hard time figuring it out: How do 
I get the previous selectedIndices when a ListEvent.CHANGE event occurs on a 
List control, within the Flex component framework?

Basically I'd like to change all the selected item renderers states on a List 
control and I'd like to wrap this functionality into a subclass of List. 

If I am not subclass List or ListBase, everything seems straightforward. But if 
I extend List class, how do I capture this changes?

private function listChangeHandler(event:ListEvent):void
{
_bSelectedIndicesChanged = true;
invalidateProperties();
//this gets exectuted before commitProperties.
_prevSelectedIndices = selectedIndices.concat();
}

By the time commitProperties() gets called, _prevSelectedIndices = 
selectedIndices.concat(); has already been executed.

What am I missing here? Are there any easy way to either get previously 
selected index or previously selected indices on a List component?

Thanks.



[flexcoders] changes on item renderers on a List

2009-03-13 Thread gwangdesign
Hi,

I am re-sending this question since this seemingly simple question has been 
taking me a bit much longer than I expected;)

I have a whole bunch of item renderers inside a List (or it lays out and 
scrolls the renderers the way a List does). Here is what I am trying to do: I'd 
like to expand/shrink these item renderers based on whether they are newly 
selected or de-selected. My approach right now is extending List class. I 
listen to ListEvent.CHANGE event and invalidate my component as it occurs. I 
then try to figure out which renderer has been selected/deselected... and I 
can't.

Basically my component is interested in the following actions:
1. When allowMultipleSelection is true, user selects an item that hasn't been 
selected yet;
2. When allowMultipleSelection is true, user selects an already selected item;
3. When allowMultipleSelection is false, user selects a new item;
4. When allowMultipleSelection is false, user selects an already selected 
item;

I poke into the code of mx.controls.ListBase and List and the code is a bit 
over my head right now;)

Any ideas? pseudo code is welcome!

Thanks and have a great weekend!

-geng





[flexcoders] Re: changes on item renderers on a List

2009-03-13 Thread gwangdesign
I guess what I am trying to figure out is how to get the de-selected item or 
de-selected index in a List? I know there are public members 
selectedIndex/selectedItem...



[flexcoders] Re: truncateToFit or multiline title in TitleWindow

2009-03-11 Thread gwangdesign
Thanks for the advice, Alex.


--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Nope.  You'll have to subclass and decide when to call truncateToFit on 
 titleTextField.
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of gwangdesign
 Sent: Saturday, March 07, 2009 9:52 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] truncateToFit or multiline title in TitleWindow
 
 
 Hi,
 
 I know this may not as easy as it sounds but does Flex provide 
 out-of-the-shelf solutions for me to truncate the text in the title bar of 
 my TitleWindow component?
 
 By out-of-the-shelf I mean things like setting properties, CSS, etc, 
 without writing my own custom component?
 
 Thanks.





[flexcoders] truncateToFit or multiline title in TitleWindow

2009-03-07 Thread gwangdesign
Hi,

I know this may not as easy as it sounds but does Flex provide 
out-of-the-shelf solutions for me to truncate the text in the title bar of my 
TitleWindow component?

By out-of-the-shelf I mean things like setting properties, CSS, etc, without 
writing my own custom component?

Thanks.



[flexcoders] [slightly OT] RSS pull?

2009-03-06 Thread gwangdesign
Excuse me in advance since it may be OT.

I am putting together a small RSS reader using Flex. I'd like my application to 
look like automatically updating if there is any new post coming in for the 
RSS feed that the user is currently viewing, etc..

What I can think of on the top of my head is using HTTPService in my Flex piece 
to constantly pull the RSS feed and check against the lastBuildDate value to 
decide if the data have changed. 

I wonder if there are any open-source (or free, which means the same to me 
anyhows;)) server side solutions that can push the data? Or is there any 
smarter way of doing this purely on the client side? Thanks and have a great 
Friday!



[flexcoders] Re: Binding property of object in dataProvider

2009-03-02 Thread gwangdesign
Hi Garth,

Thanks very much for the lead. I am currently following the
anonymous object advice but would like to investigate more
ObjectProxy approach later once I have more time.

Just another quick question. It seems both approaches entail
serializing objects in Flash Player at client side. Which one would be
better performance wise if I will be dealing with a large collection
of data (say 600-1000 per page)?

Best regards,

geng

--- In flexcoders@yahoogroups.com, Garth Somerville therealga...@...
wrote:

 If the point of your question is that you are starting with
anonymous objects, then wrapping each item with a mx.utils.ObjectProxy
will do what you want by making each property of the proxied object
bindable.
 
 The other alternative is not to use an anonymous object, but to
create a concrete class for the tasks:
 
 class Task {
   [Bindable]  public var label:String;
 }
 
 Ultimately this way is better for several reasons. (Note that as
shown the mxml compiler will have to rewrite the class to implement
IEventDispatcher)





[flexcoders] Binding property of object in dataProvider

2009-03-01 Thread gwangdesign
I am trying to bind a property (label) in my data object so that the
changes on it can be propagated to all the views (The controls may
want to edit this property). Currently I am wrapping them as plain
objects in ArrayCollection and I got the following warning:

warning: unable to bind to property 'label' on class 'Object' (class
is not an IEventDispatcher)

Does the compiler suggest making the Object a subclass of
IEventDispatcher? How do I do it if so?

My code is as below. Thanks!

mx:ArrayCollection id=taskList
mx:Object label=Word/
mx:Object label=Media Player/
mx:Object label=Contacts/
mx:Object label=Apache Server/
mx:Object label=Dictionary/
mx:Object label=iTunes/
mx:Object label=Solitaire/
mx:Object label=Minesweeper/
mx:Object label=Safari/
mx:Object label=RSS Reader/
/mx:ArrayCollection
mx:VBox
mx:Repeater id=myRP dataProvider={taskList} 
recycleChildren=true
mx:Button horizontalCenter=0
label={String(myRP.currentItem.label)}
click=button_ClickHandler(event);/
/mx:Repeater
/mx:VBox 



[flexcoders] access current item in outer document/ getRepeaterItem not working

2009-03-01 Thread gwangdesign
Hi,

Basically I am feeding dataProvider for 2 set of controls: one is on
my main app and one is the item renderers of a TileList, both of which
are Buttons. I am assigning the same function at main app to handle
their click event. The event handler assigned to the controls in the
main app works fine but not for those in the item renderers. I get
null object at runtime on
Button(event.currentTarget).getRepeaterItem(). Below is the code:

!--code in main Script tag--
public function button_ClickHandler(event:MouseEvent):void
{
//get the current item. This works for controls 
that are directly
instantiated in main application. But not for nested itemRenderers.
See mxml below.
var item:Object = 
Button(event.currentTarget).getRepeaterItem();
var index:int = taskList.getItemIndex(item);
if(index != -1)
{
taskList.removeItemAt(index);
taskList.addItemAt(item, 0);
}
}

mx:ArrayCollection id=taskList
mx:Object label=Word/
mx:Object label=Media Player/
mx:Object label=Contacts/
mx:Object label=Apache Server/
mx:Object label=Dictionary/
mx:Object label=iTunes/
mx:Object label=Solitaire/
mx:Object label=Minesweeper/
mx:Object label=Safari/
mx:Object label=RSS Reader/
/mx:ArrayCollection

!--code for item renderers--
mx:TileList dataProvider={taskList}
mx:itemRenderer
mx:Component
mx:Button styleName=myButtonStyle
click=parentDocument.button_ClickHandler(event);/
/mx:Component
 /mx:itemRenderer
/mx:TileList

I tried to trace and it seems the Buttons inside itemRenderer can
access the dataProvider in the outer document. But getCurrentItem()
breaks. So how do I get the current item from the currentTarget?



[flexcoders] Re: access current item in outer document/ getRepeaterItem not working

2009-03-01 Thread gwangdesign
I got around it by using the data property of itemrenderer, instead of
getCurrentItem()...


--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 Basically I am feeding dataProvider for 2 set of controls: one is on
 my main app and one is the item renderers of a TileList, both of which
 are Buttons. I am assigning the same function at main app to handle
 their click event. The event handler assigned to the controls in the
 main app works fine but not for those in the item renderers. I get
 null object at runtime on
 Button(event.currentTarget).getRepeaterItem(). Below is the code:
 
 !--code in main Script tag--
 public function button_ClickHandler(event:MouseEvent):void
   {
   //get the current item. This works for controls 
 that are directly
 instantiated in main application. But not for nested itemRenderers.
 See mxml below.
   var item:Object = 
 Button(event.currentTarget).getRepeaterItem();
   var index:int = taskList.getItemIndex(item);
   if(index != -1)
   {
   taskList.removeItemAt(index);
   taskList.addItemAt(item, 0);
   }
   }
 
 mx:ArrayCollection id=taskList
   mx:Object label=Word/
   mx:Object label=Media Player/
   mx:Object label=Contacts/
   mx:Object label=Apache Server/
   mx:Object label=Dictionary/
   mx:Object label=iTunes/
   mx:Object label=Solitaire/
   mx:Object label=Minesweeper/
   mx:Object label=Safari/
   mx:Object label=RSS Reader/
   /mx:ArrayCollection
 
 !--code for item renderers--
 mx:TileList dataProvider={taskList}
 mx:itemRenderer
   mx:Component
   mx:Button styleName=myButtonStyle
 click=parentDocument.button_ClickHandler(event);/
   /mx:Component
/mx:itemRenderer
   /mx:TileList
 
 I tried to trace and it seems the Buttons inside itemRenderer can
 access the dataProvider in the outer document. But getCurrentItem()
 breaks. So how do I get the current item from the currentTarget?





[flexcoders] Re: default skin in flex 3 component

2009-02-17 Thread gwangdesign
Thank Stephen.

--- In flexcoders@yahoogroups.com, Stephen Gilson smgil...@... wrote:

 The doc on skinning is located here:
http://livedocs.adobe.com/flex/3/html/skinning_1.html
 
 Was that helpful?
 
 Stephen
 
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com]
On Behalf Of gwangdesign
 Sent: Tuesday, February 17, 2009 12:36 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] default skin in flex 3 component
 
 
 Hi,
 
 I am trying to define the default skin (which is ProgrammaticSkin for
 now) for my custom UIComponent. I would like to provide my own
 programmaticSkin (hm.controls.myUICompClasses.BackdropSkin) as
 default; and I am doing it in my UIComponent's style metadata, like so:
 
 [Style(name=backdropSkin,
 type=hm.controls.myUICompClasses.BackdropSkin, inherit=yes)]
 ...
 protected var _backdrop:Class;
 ...
 
 Is this the right way? What type should my _backdrop be? Or do I need
 to provide a CSS anyhow? Or classConstruc()???
 
 When I try to get the style using:
 
 var backdropSkin:Class = getStyle(backdropSkin);
 
 I get type of Object instead of Class.
 
 I appreciate any lead while still poking around the flex
 documentation/sdk code! Sorry everything looks a bit blurred right
 now8) Good night!





[flexcoders] default skin in flex 3 component

2009-02-16 Thread gwangdesign
Hi,

I am trying to define the default skin (which is ProgrammaticSkin for
now) for my custom UIComponent. I would like to provide my own
programmaticSkin (hm.controls.myUICompClasses.BackdropSkin) as
default; and I am doing it in my UIComponent's style metadata, like so:

[Style(name=backdropSkin,
type=hm.controls.myUICompClasses.BackdropSkin, inherit=yes)]
...
protected var _backdrop:Class;
...


Is this the right way? What type should my _backdrop be? Or do I need
to provide a CSS anyhow? Or classConstruc()???

When I try to get the style using:

var backdropSkin:Class = getStyle(backdropSkin);

I get type of Object instead of Class.

I appreciate any lead while still poking around the flex
documentation/sdk code! Sorry everything looks a bit blurred right
now8) Good night!



[flexcoders] Re: default skin in flex 3 component

2009-02-16 Thread gwangdesign
I am looking at mx.controls.Button now. I guess I am confusing skin
name, skin class and skin as a DisplayObject;)

Hopefully I will figure it out tomorrow morning! Thanks.

--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 I am trying to define the default skin (which is ProgrammaticSkin for
 now) for my custom UIComponent. I would like to provide my own
 programmaticSkin (hm.controls.myUICompClasses.BackdropSkin) as
 default; and I am doing it in my UIComponent's style metadata, like so:
 
 [Style(name=backdropSkin,
 type=hm.controls.myUICompClasses.BackdropSkin, inherit=yes)]
 ...
 protected var _backdrop:Class;
 ...
 
 
 Is this the right way? What type should my _backdrop be? Or do I need
 to provide a CSS anyhow? Or classConstruc()???
 
 When I try to get the style using:
 
 var backdropSkin:Class = getStyle(backdropSkin);
 
 I get type of Object instead of Class.
 
 I appreciate any lead while still poking around the flex
 documentation/sdk code! Sorry everything looks a bit blurred right
 now8) Good night!





[flexcoders] Setting perspectiveProjection disable children interactivity

2008-12-29 Thread gwangdesign
Hi,

This is a Flex project (3.2) complied to target FP10, which utilizes
the 3D API. Inside a Canvas object, I add whole bunch of Buttons which
are laid out in a 3D carousel fashion. The problem is once I set the
projectionCenter property of the Canvas, all the Button instances
inside the Canvas stop taking any mouse interaction (including hover
highlight, tooltips, click events, etc.), while everything else seems
to be working fine.

Is this the expected behavior or a bug?

Here is the code:
//carouselContainer is the Canvas instance
var pp:PerspectiveProjection = new PerspectiveProjection();
pp.projectionCenter = new Point(x, y);
carouselContainer.transform.perspectiveProjection = pp;
//end of code.

Thanks.



[flexcoders] Re: Setting perspectiveProjection disable children interactivity

2008-12-29 Thread gwangdesign
Just a follow-up from myself;)

I am not able to re-compile my existing code using Gumbo sdk since all
the code that tries to get/set UIComponent.transform seems to be
broken on re-compile.

For example:

I got:
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
for v3 = items[id].transform.matrix3D.decompose();

In Halo (sdk 3.2), as long as you set UIComponent.z or
UIComponent.rotationX/rotationY, you will get the Transform object
without any problem.
 
--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Hi,
 
 This is a Flex project (3.2) complied to target FP10, which utilizes
 the 3D API. Inside a Canvas object, I add whole bunch of Buttons which
 are laid out in a 3D carousel fashion. The problem is once I set the
 projectionCenter property of the Canvas, all the Button instances
 inside the Canvas stop taking any mouse interaction (including hover
 highlight, tooltips, click events, etc.), while everything else seems
 to be working fine.
 
 Is this the expected behavior or a bug?
 
 Here is the code:
 //carouselContainer is the Canvas instance
 var pp:PerspectiveProjection = new PerspectiveProjection();
 pp.projectionCenter = new Point(x, y);
 carouselContainer.transform.perspectiveProjection = pp;
 //end of code.
 
 Thanks.





[flexcoders] Re: Setting perspectiveProjection disable children interactivity

2008-12-29 Thread gwangdesign
Okay. So, okay. Here I am again. I just got a stripped down version of
my code working on Gumbo but not sdk 3.2. In the following code, the
Button instance maintains its interactivity (hover, tooltip, gets
click event). If the same code gets complied to sdk 3.2, the Button
looses hover/tooltip and doesn't take the click event) 

?xml version=1.0 encoding=utf-8?
Application xmlns=http://ns.adobe.com/mxml/2009; layout=absolute
width=800 height=600 creationComplete=initApp();
Script
![CDATA[
import mx.controls.Button;
import flash.geom.PerspectiveProjection;

private function initApp():void
{
var btn:Button = new Button();
btn.label = hello world;
btn.toolTip = This is the secret ninja!;
btn.addEventListener(MouseEvent.CLICK,
function(event:MouseEvent):void{trace(Button(event.currentTarget).label+
is clicked!);}); 
homeBx.addChild(btn);
setPPCenter(0, 0);
}
private function setPPCenter(x:Number, y:Number):void
{
var pp:PerspectiveProjection = new 
PerspectiveProjection();
pp.projectionCenter = new Point(x, y);
homeBx.transform.perspectiveProjection = pp;
}
]]
/Script

Canvas id=homeBx x=400 y=300 z=0 clipContent=false/

/Application
 
--- In flexcoders@yahoogroups.com, gwangdesign gwangdes...@... wrote:

 Just a follow-up from myself;)
 
 I am not able to re-compile my existing code using Gumbo sdk since all
 the code that tries to get/set UIComponent.transform seems to be
 broken on re-compile.
 
 For example:
 
 I got:
 TypeError: Error #1009: Cannot access a property or method of a null
 object reference.
 for v3 = items[id].transform.matrix3D.decompose();
 
 In Halo (sdk 3.2), as long as you set UIComponent.z or
 UIComponent.rotationX/rotationY, you will get the Transform object
 without any problem.
  
 --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ wrote:
 
  Hi,
  
  This is a Flex project (3.2) complied to target FP10, which utilizes
  the 3D API. Inside a Canvas object, I add whole bunch of Buttons which
  are laid out in a 3D carousel fashion. The problem is once I set the
  projectionCenter property of the Canvas, all the Button instances
  inside the Canvas stop taking any mouse interaction (including hover
  highlight, tooltips, click events, etc.), while everything else seems
  to be working fine.
  
  Is this the expected behavior or a bug?
  
  Here is the code:
  //carouselContainer is the Canvas instance
  var pp:PerspectiveProjection = new PerspectiveProjection();
  pp.projectionCenter = new Point(x, y);
  carouselContainer.transform.perspectiveProjection = pp;
  //end of code.
  
  Thanks.
 





[flexcoders] OT? NEwbie question for AIR: javascript in HTMLLoader

2008-12-19 Thread gwangdesign
Hi,

Excuse me in advance if there is a better place for this post.
Couldn't find a group for AIR questions.

So can you script for a window that is using HTML/HTMLLoader control
that loads the HTML content? Like is there a way to detect mouse hover
a hyperlink that's being rendered inside the HTMLLoader object (which
is common for us JavaScript-ers: a hre=javascrpt:.../ but maybe
it's too much to ask for AIR or I am missing something fundamental here;).

I am looking into the AIR docs (specifically HTMLLoader, HTMLHost, AIR
sandbox bridge) but if anyone could lead me on this basic question (or
where I can find docs/forums/articles, etc. that would be greatly
appreciated!

Thanks!



[flexcoders] Flash Player inside AIR player

2008-12-18 Thread gwangdesign
I am going through my hello world?! project on Adobe AIR. I am using
the HTML component to load some sites into it which works pretty well
for most sites. I notice one thing though is that I don't seem to see
Flash Player on the pages where there should be one, such as
nytimes.com and youtube.com.

I am using FB 3 (sdk 3.1), compiling to AIR 1.1 on Windows (That's
what it says in the descriptor file). I notice though that I have
Adobe AIR 1.5 installed.

Any lead? Thanks.



[flexcoders] Re: Flash Player inside AIR player

2008-12-18 Thread gwangdesign
Fotis,

Thanks for the info. Yes I guess HTML control is designed to run
HTML+JavaScript(subset?). Seems most of the embedded
objects(Quicktime, Flash, not to mention Silverlight) are not rendered.



--- In flexcoders@yahoogroups.com, Fotis Chatzinikos
fotis.chatzini...@... wrote:

 Probably because the container is already a flash app?
 
 As i understand it the html component in air is not a complete browser
 replacement its there (using a nice html engine) to help with normal
html
 content not full pluggin / flash functionality...
 
 On Fri, Dec 19, 2008 at 12:43 AM, gwangdesign gwangdes...@... wrote:
 
I am going through my hello world?! project on Adobe AIR. I am
using
  the HTML component to load some sites into it which works pretty well
  for most sites. I notice one thing though is that I don't seem to see
  Flash Player on the pages where there should be one, such as
  nytimes.com and youtube.com.
 
  I am using FB 3 (sdk 3.1), compiling to AIR 1.1 on Windows (That's
  what it says in the descriptor file). I notice though that I have
  Adobe AIR 1.5 installed.
 
  Any lead? Thanks.
 
   
 
 
 
 
 -- 
 Fotis Chatzinikos, Ph.D.
 Founder,
 Phinnovation
 fotis.chatzini...@...,





[flexcoders] Re: z property in mx.core.UIComponent

2008-10-20 Thread gwangdesign
It's even better now. You can check out them here:

http://livedocs.adobe.com/flex/gumbo/langref/flash/display/DisplayObject.html#propertySummary

It's odd that transformX/Y/Z are not showing up although they *are*
members of UIComponent in gumbo...

Anyone from Adobe?




--- In flexcoders@yahoogroups.com, fotis.chatzinikos
[EMAIL PROTECTED] wrote:

 Not sure, but did you try to put two objects (ie buttons) in an semi-
 overlapping area and change their z to see if they switch between
 them? in 2d systems z (z-order) is the 'hight' of the object on the 2d
 screen...ie which object hides what...
 
 Check and let us know ;-)
 --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ wrote:
 
  I was trying to set z property for a Button and expected to see it
  either get bigger or smaller. But despite my expectation, nothing
  seemed to happen (nor did the compiler complain)...
  
  So is this 3D thing only working with rotationX/Y/Z for UIComponent as
  someone mentioned a while ago?
  
  I was using gumbo sdk and targeting fp10. Thanks.
 





[flexcoders] Re: z property in mx.core.UIComponent

2008-10-20 Thread gwangdesign
Hi fotis,

You can see what z mean very clearly in the docs example (look for
property z)in which two ellipses are moving on screen because of
their z properties changing.

best,

geng

--- In flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] wrote:

 It's even better now. You can check out them here:
 

http://livedocs.adobe.com/flex/gumbo/langref/flash/display/DisplayObject.html#propertySummary
 
 It's odd that transformX/Y/Z are not showing up although they *are*
 members of UIComponent in gumbo...
 
 Anyone from Adobe?
 
 
 
 
 --- In flexcoders@yahoogroups.com, fotis.chatzinikos
 fotis.chatzinikos@ wrote:
 
  Not sure, but did you try to put two objects (ie buttons) in an semi-
  overlapping area and change their z to see if they switch between
  them? in 2d systems z (z-order) is the 'hight' of the object on the 2d
  screen...ie which object hides what...
  
  Check and let us know ;-)
  --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ wrote:
  
   I was trying to set z property for a Button and expected to see it
   either get bigger or smaller. But despite my expectation, nothing
   seemed to happen (nor did the compiler complain)...
   
   So is this 3D thing only working with rotationX/Y/Z for
UIComponent as
   someone mentioned a while ago?
   
   I was using gumbo sdk and targeting fp10. Thanks.
  
 





[flexcoders] Re: z property in mx.core.UIComponent

2008-10-20 Thread gwangdesign
Hi fotis,

In the docs example for property z two ellipses are moving on screen
because of their z properties changing.

best,

geng
--- In flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] wrote:

 It's even better now. You can check out them here:
 

http://livedocs.adobe.com/flex/gumbo/langref/flash/display/DisplayObject.html#propertySummary
 
 It's odd that transformX/Y/Z are not showing up although they *are*
 members of UIComponent in gumbo...
 
 Anyone from Adobe?
 
 
 
 
 --- In flexcoders@yahoogroups.com, fotis.chatzinikos
 fotis.chatzinikos@ wrote:
 
  Not sure, but did you try to put two objects (ie buttons) in an semi-
  overlapping area and change their z to see if they switch between
  them? in 2d systems z (z-order) is the 'hight' of the object on the 2d
  screen...ie which object hides what...
  
  Check and let us know ;-)
  --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ wrote:
  
   I was trying to set z property for a Button and expected to see it
   either get bigger or smaller. But despite my expectation, nothing
   seemed to happen (nor did the compiler complain)...
   
   So is this 3D thing only working with rotationX/Y/Z for
UIComponent as
   someone mentioned a while ago?
   
   I was using gumbo sdk and targeting fp10. Thanks.
  
 





[flexcoders] z property in mx.core.UIComponent

2008-10-19 Thread gwangdesign
I was trying to set z property for a Button and expected to see it
either get bigger or smaller. But despite my expectation, nothing
seemed to happen (nor did the compiler complain)...

So is this 3D thing only working with rotationX/Y/Z for UIComponent as
someone mentioned a while ago?

I was using gumbo sdk and targeting fp10. Thanks.



[flexcoders] Re: z property in mx.core.UIComponent

2008-10-19 Thread gwangdesign
I think I found the answer myself:) Here:

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/DisplayObject.html

--- In flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] wrote:

 I was trying to set z property for a Button and expected to see it
 either get bigger or smaller. But despite my expectation, nothing
 seemed to happen (nor did the compiler complain)...
 
 So is this 3D thing only working with rotationX/Y/Z for UIComponent as
 someone mentioned a while ago?
 
 I was using gumbo sdk and targeting fp10. Thanks.





[flexcoders] Re: Will Papervision 3D be available for use in Flex Builder 3 ???

2008-10-18 Thread gwangdesign
So now I see that mx.core.UIComponent has a property z and I am
curious if this is something that relates to 3D. I was trying to set
this z for the same Button in Flex but it doesn't make any difference
at FP 10.

Also anyone can give and hints as to how to use z (if possible) in
effect (I was trying out FxAnimate3D...)


--- In flexcoders@yahoogroups.com, Jason [EMAIL PROTECTED] wrote:

 Paul Andrews paul@ wrote:
  Well, I wonder how Flash player 10 is going to figure in this. Nice 
 demos in the preview. 
 
 Not in any way as far as I know. Flash player 10 will support 
 displayObject.rotationX,displayObject.rotationY, 
 displayObject.rotationZ
 
 But those are the only sort of real 3D in the Flash player 10 
 announced at Max in Chicago. So you're really only rotating an object 
 on a plane in 3D space, but nothing else. (bummer)   
 
 Or are you referring to something else?
 
 Jason Merrill





[flexcoders] component resize on registration point revisit?

2008-10-14 Thread gwangdesign
I did this little exercise to shrink a UIComponent from center. The
component is scaled down when a button is clicked and scaled back to
its original size when the mouse is released. It seems working fine
except that the component shifts a little bit to top-left with each click.

I cannot figure out which part goes wrong, but my guess in shrinkBack?

Here is the swf and the source code:

http://maohao.com/blogs/wordpress/TestSomething/bin-release/TestResize.html

Sorry about the cross/duplicate post in advance. I can't remember if I
post this or not... 

Have a good one.



[flexcoders] Re: component resize on registration point revisit?

2008-10-14 Thread gwangdesign
gotcha! thx!

--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

   IEEE floats aren't very nice.
 I second that!
 
 They make you become creative... add scale and rotation together,
the IEEE
 floats start to float away.
 
 Mike
 
 On Tue, Oct 14, 2008 at 6:50 PM, Josh McDonald [EMAIL PROTECTED] wrote:
 
Without looking at your code, it's probably just a rounding
error, IEEE
  floats aren't very nice. I'd keep the original top/left value put
aside for
  when you return it to full size.
 
  -Josh
 
  On Wed, Oct 15, 2008 at 8:46 AM, gwangdesign [EMAIL PROTECTED]wrote:
 
  I did this little exercise to shrink a UIComponent from center. The
  component is scaled down when a button is clicked and scaled back to
  its original size when the mouse is released. It seems working fine
  except that the component shifts a little bit to top-left with
each click.
 
  I cannot figure out which part goes wrong, but my guess in
shrinkBack?
 
  Here is the swf and the source code:
 
 
 
http://maohao.com/blogs/wordpress/TestSomething/bin-release/TestResize.html
 
  Sorry about the cross/duplicate post in advance. I can't remember
if I
  post this or not...
 
  Have a good one.
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
  Links
 
 
 
 
 
 
  --
  Therefore, send not to know For whom the bell tolls. It tolls for
thee.
 
  Like the cut of my jib? Check out my Flex blog!
 
  :: Josh 'G-Funk' McDonald
  :: 0437 221 380 :: [EMAIL PROTECTED]
  :: http://flex.joshmcdonald.info/
 
   
 
 
 
 
 -- 
 Teoti Graphix, LLC
 http://www.teotigraphix.com
 
 Teoti Graphix Blog
 http://www.blog.teotigraphix.com
 
 You can find more by solving the problem then by 'asking the question'.





[flexcoders] Re: Ely's Flexbook

2008-10-06 Thread gwangdesign
Mr. Ely's code was based on FB2... I guess he has been super busy!

I really want to get a book from him when I saw the subject of your
post! Something like Custom Component in Flex Builder 4.

 
 From: Uday M. Shankar [EMAIL PROTECTED]
 Sent: Monday, October 06, 2008 6:02 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Ely's Flexbook 
 
 I am trying to use Ely's FlexBook component in one of my projects.
 
 But, I keep running into a problem which I am not able to fix.
 
 Let me explain...
 
 I can replicate this issue in the boundaries example @
 http://demo.quietlyscheming.com/book/boundaries.html.
 
 Follow these steps in the boundaries example.
 
 1. Check the Add Covers checkbox on the left side.
 
 2. Then, click on Add Page button to add a page to the book. Now PAGE A
 
 is added to the book. (as inner front cover)
 
 3. Now, try to close the book by click-dragging the back cover.
 
 At this point, the book will throw the following error -
 
 ArgumentError: Error #2025: The supplied DisplayObject must be a child
 
 of the caller.
 
  at flash.display::DisplayObjectContainer/removeChild()
 
  at
 

mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$remove\
 
 Child()
 
  at mx.core::UIComponent/removeChild()
 
  at qs.controls.bookClasses::BookPageImpl/set rightRenderer()
 
  at qs.controls.bookClasses::BookPageImpl/clearContent()
 
  at qs.controls::Book/commitProperties()
 
  at mx.core::UIComponent/validateProperties()
 
  at mx.managers::LayoutManager/validateProperties()
 
  at mx.managers::LayoutManager/doPhasedInstantiation()
 
  at Function/http://adobe.com/AS3/2006/builtin::apply()
 
 
 
 Can anybody help me with this?
 
 am stuck in my project because am not able to fix this.





[flexcoders] Re: Complete event error for Image control within Repeater

2008-10-03 Thread gwangdesign
Hi guys,

Thanks for the replies.

The code below actually works. In my AS version, I did import all the
classes including mx.events.FlexEvent, etc.

For events, I use complete on Image as opposed to other events is
that I am interested in when the SWFLoader (parent class of Image)
completes loading the content, not when the Image component is
instantiated by it's Repeater wrapper (in which case you would listen
to repeaterEnd which is fired BEFORE any events from the Images get
fired).

I guess my problem would be to find a right place in the component
life-cycle to register the complete event, but I am not coding a
custom component just MXML...

 
--- In flexcoders@yahoogroups.com, Amy [EMAIL PROTECTED] wrote:

 --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ 
 wrote:
 
  I am loading 50-ish something images using an Image control wrapped 
 in
  a repeater wrapped in a VBox component. I want to do some stuff 
 once I
  know the full dimensions of the VBox, which is when all the images
  have been loaded.
  
  Here is the code snippet:
  
  mx:VBox id=imgBx
  mx:Repeater id=rp dataProvider={dp}
  mx:Image id=img width=120 height=80
  source={dp_arr[rp.currentIndex]} complete=onImgComplete
 (event);/
  /mx:Repeater
  /mx:VBox
  
  /**AS3*/
  private function onImgComplete(event:Event):void
  {
  if(imgCounterimgTotal-1)
  {
  imgCounter++;
  }else
  {
  configure();
  }
  }
  
  Everything seems work fine at this point. The problem comes when I 
 try
  to immigrate the onImgComplete() from inline MXML into ActionScript,
  basically as an event handler for this component like so:
  
  creationComplete=img.addEventListener(Event.COMPLETE, 
 onImgComplete);
  
  I got the following error:
  TypeError: Error #1006: addEventListener is not a function.
 
 You might need to add curly brackets around it to get it to evaluate 
 as AS.  You might also want to look at the events associated with the 
 Repeater control, since they are probably more appropriate.





[flexcoders] Re: Complete event error for Image control within Repeater

2008-10-03 Thread gwangdesign
I figured it out. It has to do with how Repeater initializes it's
inner components. I guess Flex doesn't know the actual type of the
innercomponent until repeatEnd gets fired.

Please see the code below. Here init() is the callback for my
component's creationComplete event:

private function init():void
{
rp.addEventListener(FlexEvent.REPEAT_END,
function(event:FlexEvent):void
{
img.addEventListener(Event.COMPLETE, onImgComplete);
});
}

This way no complaint from compiler.

--- In flexcoders@yahoogroups.com, gwangdesign [EMAIL PROTECTED] wrote:

 Hi guys,
 
 Thanks for the replies.
 
 The code below actually works. In my AS version, I did import all the
 classes including mx.events.FlexEvent, etc.
 
 For events, I use complete on Image as opposed to other events is
 that I am interested in when the SWFLoader (parent class of Image)
 completes loading the content, not when the Image component is
 instantiated by it's Repeater wrapper (in which case you would listen
 to repeaterEnd which is fired BEFORE any events from the Images get
 fired).
 
 I guess my problem would be to find a right place in the component
 life-cycle to register the complete event, but I am not coding a
 custom component just MXML...
 
  
 --- In flexcoders@yahoogroups.com, Amy amyblankenship@ wrote:
 
  --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@ 
  wrote:
  
   I am loading 50-ish something images using an Image control wrapped 
  in
   a repeater wrapped in a VBox component. I want to do some stuff 
  once I
   know the full dimensions of the VBox, which is when all the images
   have been loaded.
   
   Here is the code snippet:
   
   mx:VBox id=imgBx
   mx:Repeater id=rp dataProvider={dp}
   mx:Image id=img width=120 height=80
   source={dp_arr[rp.currentIndex]} complete=onImgComplete
  (event);/
   /mx:Repeater
   /mx:VBox
   
   /**AS3*/
   private function onImgComplete(event:Event):void
   {
   if(imgCounterimgTotal-1)
   {
   imgCounter++;
   }else
   {
 configure();
   }
   }
   
   Everything seems work fine at this point. The problem comes when I 
  try
   to immigrate the onImgComplete() from inline MXML into ActionScript,
   basically as an event handler for this component like so:
   
   creationComplete=img.addEventListener(Event.COMPLETE, 
  onImgComplete);
   
   I got the following error:
   TypeError: Error #1006: addEventListener is not a function.
  
  You might need to add curly brackets around it to get it to evaluate 
  as AS.  You might also want to look at the events associated with the 
  Repeater control, since they are probably more appropriate.
 





[flexcoders] Complete event error for Image control within Repeater

2008-10-02 Thread gwangdesign
I am loading 50-ish something images using an Image control wrapped in
a repeater wrapped in a VBox component. I want to do some stuff once I
know the full dimensions of the VBox, which is when all the images
have been loaded.

Here is the code snippet:

mx:VBox id=imgBx
mx:Repeater id=rp dataProvider={dp}
mx:Image id=img width=120 height=80
source={dp_arr[rp.currentIndex]} complete=onImgComplete(event);/
/mx:Repeater
/mx:VBox

/**AS3*/
private function onImgComplete(event:Event):void
{
if(imgCounterimgTotal-1)
{
imgCounter++;
}else
{
configure();
}
}

Everything seems work fine at this point. The problem comes when I try
to immigrate the onImgComplete() from inline MXML into ActionScript,
basically as an event handler for this component like so:

creationComplete=img.addEventListener(Event.COMPLETE, onImgComplete);

I got the following error:
TypeError: Error #1006: addEventListener is not a function.

Any lead? Thanks.




[flexcoders] Re: Programming 101: event target

2008-09-26 Thread gwangdesign
Hi Matt and all,

Thanks for the clarification. I know you guys are busy;)

The DOM thing, target and currentTarget make sense. If a button or
its parent container registers interest in a mouse click event, either
the button or its container becomes currentTarget while the button
is the target at bubbling propagation.

In Flex/Flash, things like SystemManager (which is instantiated by
Application and which inherits from flash.display.MovieClip) can also
register its interest in any UIComponent(not stylized skins that are
drawn by the drawing API), which as Matt says will broadcast the
event(i.e., call the event handlers). In this case, currentTarget is
the systemManager and target can be the visual stuff or the loader
of the visual content under the stage who is the source of the event.

Geng
--- In flexcoders@yahoogroups.com, Matt Chotin [EMAIL PROTECTED] wrote:

 For one thing, target comes a little bit from the W3C DOM event
model. It was standard naming for that I believe.
 
 Target represents the object on which can be thought of as having
originally broadcast the event.  Whomever mentioned the UI part of it
is right on.  When you think of the MouseEvent CLICK, the target is
the actual display object that was clicked on.  CurrentTarget is
useful when you're dealing with event propagation, it reflects the
object that is currently broadcasting the event.  For example, if a
button was clicked on but that button lives within a container, the
container may dispatch the CLICK event via bubbling.  Basically
indicating that something within it was clicked. In that case,
currentTarget is the container, target is the original button that was
clicked.
 
 I agree source might be a better name, but I think the UI aspect of
it kind of held.
 
 Matt
 
 
 On 9/24/08 3:04 PM, gwangdesign [EMAIL PROTECTED] wrote:
 
 
 
 
 I just read the documentation for Flex, The Event Flow:
 
 Flash Player or AIR dispatches event objects whenever an event
 occurs. If the event target is not on the display list, Flash Player
 or AIR dispatches the event object directly to the event target. For
 example, Flash Player dispatches the progress event object directly to
 a URLStream object. If the event target is on the display list,
 however, Flash Player dispatches the event object into the display
 list, and the event object travels through the display list to the
 event target.
 

http://livedocs.adobe.com/flex/3/html/help.html?content=16_Event_handling_4.html
 
 It looks to me like, in the case in which they mention above, Flash
 Player or AIR becomes the source who dispatches the event object
 and the event target is actually the one that listens to the event.
 Does this target term then sound something that makes more sense to
 lower level programming (such as Flash Player engineers?)? From an API
 user's point of view, an event source is only source anyways...
 
 Thanks.
 
 --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , Samuel Colak sam.colak@ wrote:
 
  Umm
 
  You have currentTarget and target - most of the time, these return
  very different
  values depending on what happened ...
 
  On Sep 24, 2008, at 11:14 PM, Chuck Preston Jr. wrote:
 
   For the same reason tree structures are upside down, with their
   roots at the top. ActionScript
   is from the Bizzaro world.
  
   --- In flexcoders@yahoogroups.com
mailto:flexcoders%40yahoogroups.com , gwangdesign gwangdesign@
   wrote:
   
Hi,
   
I am just wondering why, in ActionScript, the subject of an
event is
called a target? Is it kind of counter intuitive? In Java, it is
called source, which sounds much more understandable to me.
   
Thanks.
   
  
  
  
 





[flexcoders] Re: Retry: Question for Doug McCune on Drag-drop component?

2008-09-24 Thread gwangdesign
Hi Josh,

I am curious of your experience when you messed with drag and drop.
Have you ever thought about the DragManager in Flex? What would be the
reason of not using it in the scenario of something like BumpTop
(physics drag without drop target)?

Thanks!



--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 Doug, you're a store (and distribution point) of much useful Flex
kung-fu :)
 
 I didn't think of doing that last time I was messing with
drag-n-drop, but
 it's a great idea.
 
 On Wed, Sep 24, 2008 at 6:02 AM, Doug McCune [EMAIL PROTECTED] wrote:
 
  For basic dragging stuff, here's typically what I do. Have a mouse
  down listener on whatever component you want to drag. On mouse down
  you keep track of the coordinates where the user pressed. Then you add
  a mouse move listener to the system manager. Also add a mouse up
  listener to system manager. Then when the user moves the mouse (which
  you catch with the system manager listener), perform the calculation
  of how far from the original mouse down position the mouse is and move
  the component to the right place. Then when you catch the mouse up
  event (again, from system manager), you remove the mouse move listener
  and you're done.
 
  See the code in the Panel class in the Flex framework for an example
  of this type of dragging. The big thing to know is that you want to
  use mouse move and mouse up events from the system manager, not from
  the component itself. If you use the component itself you'll end up
  losing the mouse movement if the user drags quickly off the component,
  or you might get stuck in endless dragging if the mouse is released
  while not over the component.
 
  You should also probably have a listener for when the mouse leaves the
  stage and stop dragging at that point too, since not doing that can
  make the drag operation continue after the release the mouse (if they
  move the mouse off your app and the release).
 
  Doug
 
  On Tue, Sep 23, 2008 at 12:30 PM, gwangdesign [EMAIL PROTECTED]
  wrote:
   Sorry if this question should be better showing up at the
   flexcomponent group. I didn't have any luck there so far;)
  
   Suppose I am motivated enough to roll up my sleeves to do something
   like what McCune is doing here at tileUI.com:
  
   http://www.youtube.com/watch?v=T0N7tgF7OOM
  
   Just for the drag part to get started, am I better off implementing
   the darg-drop framework that Flex provide or should I start from the
   more basic mouseUp/mouseDown?
  
   I guess this question is for every Flex guru besides Doug;) I
   appreciate it.
  
  
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
  Links
 
 
 
 
 
 
 -- 
 Therefore, send not to know For whom the bell tolls. It tolls for
thee.
 
 http://flex.joshmcdonald.info/
 
 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]





[flexcoders] Re: Retry: Question for Doug McCune on Drag-drop component?

2008-09-24 Thread gwangdesign
Mike, Thanks a lot for the lead. I guess I would rather trust you than
myself;)

--- In flexcoders@yahoogroups.com, Michael Schmalle
[EMAIL PROTECTED] wrote:

 Hi,
 The reason it simple, with 3 event handlers you can control
everything about
 your custom dragging and/or dropping you need.
 
 The drag manager has flaws, trust me I made a docking component and
almost
 ditched the manager but I had to use it since I didn't have the time to
 rewrite it.
 
 Think of it as capturing each user gesture individually, you cannot
do this
 with the DragManager.
 
 Mike
 
 On Wed, Sep 24, 2008 at 11:49 AM, gwangdesign [EMAIL PROTECTED] wrote:
 
Hi Josh,
 
  I am curious of your experience when you messed with drag and drop.
  Have you ever thought about the DragManager in Flex? What would be the
  reason of not using it in the scenario of something like BumpTop
  (physics drag without drop target)?
 
  Thanks!
 
 
  --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com,
Josh
  McDonald dznuts@ wrote:
  
   Doug, you're a store (and distribution point) of much useful Flex
  kung-fu :)
  
   I didn't think of doing that last time I was messing with
  drag-n-drop, but
   it's a great idea.
  
   On Wed, Sep 24, 2008 at 6:02 AM, Doug McCune doug@ wrote:
  
For basic dragging stuff, here's typically what I do. Have a mouse
down listener on whatever component you want to drag. On mouse
down
you keep track of the coordinates where the user pressed. Then
you add
a mouse move listener to the system manager. Also add a mouse up
listener to system manager. Then when the user moves the mouse
(which
you catch with the system manager listener), perform the
calculation
of how far from the original mouse down position the mouse is
and move
the component to the right place. Then when you catch the mouse up
event (again, from system manager), you remove the mouse move
listener
and you're done.
   
See the code in the Panel class in the Flex framework for an
example
of this type of dragging. The big thing to know is that you
want to
use mouse move and mouse up events from the system manager,
not from
the component itself. If you use the component itself you'll
end up
losing the mouse movement if the user drags quickly off the
component,
or you might get stuck in endless dragging if the mouse is
released
while not over the component.
   
You should also probably have a listener for when the mouse
leaves the
stage and stop dragging at that point too, since not doing
that can
make the drag operation continue after the release the mouse
(if they
move the mouse off your app and the release).
   
Doug
   
On Tue, Sep 23, 2008 at 12:30 PM, gwangdesign gwangdesign@
wrote:
 Sorry if this question should be better showing up at the
 flexcomponent group. I didn't have any luck there so far;)

 Suppose I am motivated enough to roll up my sleeves to do
something
 like what McCune is doing here at tileUI.com:

 http://www.youtube.com/watch?v=T0N7tgF7OOM

 Just for the drag part to get started, am I better off
implementing
 the darg-drop framework that Flex provide or should I start
from the
 more basic mouseUp/mouseDown?

 I guess this question is for every Flex guru besides Doug;) I
 appreciate it.


   

   
--
Flexcoders Mailing List
FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
   
 
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
Groups
Links
   
   
   
   
  
  
   --
   Therefore, send not to know For whom the bell tolls. It tolls for
  thee.
  
   http://flex.joshmcdonald.info/
  
   :: Josh 'G-Funk' McDonald
   :: 0437 221 380 :: josh@
  
 
   
 
 
 
 
 -- 
 Teoti Graphix, LLC
 http://www.teotigraphix.com
 
 Teoti Graphix Blog
 http://www.blog.teotigraphix.com
 
 You can find more by solving the problem then by 'asking the question'.





[flexcoders] Programming 101: event target

2008-09-24 Thread gwangdesign
Hi,

I am just wondering why, in ActionScript, the subject of an event is
called a target? Is it kind of counter intuitive? In Java, it is
called source, which sounds much more understandable to me.

Thanks.



[flexcoders] Re: Programming 101: event target

2008-09-24 Thread gwangdesign
I just read the documentation for Flex, The Event Flow:

Flash Player or AIR dispatches event objects whenever an event
occurs. If the event target is not on the display list, Flash Player
or AIR dispatches the event object directly to the event target. For
example, Flash Player dispatches the progress event object directly to
a URLStream object. If the event target is on the display list,
however, Flash Player dispatches the event object into the display
list, and the event object travels through the display list to the
event target.

http://livedocs.adobe.com/flex/3/html/help.html?content=16_Event_handling_4.html

It looks to me like, in the case in which they mention above, Flash
Player or AIR becomes the source who dispatches the event object
and the event target is actually the one that listens to the event.
Does this target term then sound something that makes more sense to
lower level programming (such as Flash Player engineers?)? From an API
user's point of view, an event source is only source anyways...

Thanks.

--- In flexcoders@yahoogroups.com, Samuel Colak [EMAIL PROTECTED] wrote:

 Umm
 
 You have currentTarget and target - most of the time, these return  
 very different
 values depending on what happened ...
 
 On Sep 24, 2008, at 11:14 PM, Chuck Preston Jr. wrote:
 
  For the same reason tree structures are upside down, with their  
  roots at the top. ActionScript
  is from the Bizzaro world.
 
  --- In flexcoders@yahoogroups.com, gwangdesign gwangdesign@  
  wrote:
  
   Hi,
  
   I am just wondering why, in ActionScript, the subject of an event is
   called a target? Is it kind of counter intuitive? In Java, it is
   called source, which sounds much more understandable to me.
  
   Thanks.
  
 
 
 





[flexcoders] Retry: Question for Doug McCune on Drag-drop component?

2008-09-23 Thread gwangdesign
Sorry if this question should be better showing up at the
flexcomponent group. I didn't have any luck there so far;)

Suppose I am motivated enough to roll up my sleeves to do something
like what McCune is doing here at tileUI.com:

http://www.youtube.com/watch?v=T0N7tgF7OOM

Just for the drag part to get started, am I better off implementing
the darg-drop framework that Flex provide or should I start from the
more basic mouseUp/mouseDown?

I guess this question is for every Flex guru besides Doug;) I
appreciate it.



[flexcoders] Retry: Question for Doug McCune on Drag-drop component?

2008-09-23 Thread gwangdesign
Sorry if this question should be better showing up at the
flexcomponent group. I didn't have any luck there so far;)

Suppose I am motivated enough to roll up my sleeves to do something
like what McCune is doing here at tileUI.com:

http://www.youtube.com/watch?v=T0N7tgF7OOM

Just for the drag part to get started, am I better off implementing
the darg-drop framework that Flex provide or should I start from the
more basic mouseUp/mouseDown?

I guess this question is for every Flex guru besides Doug;) I
appreciate it.



[flexcoders] Re: Retry: Question for Doug McCune on Drag-drop component?

2008-09-23 Thread gwangdesign
Thanks much Doug!

--- In flexcoders@yahoogroups.com, Doug McCune [EMAIL PROTECTED] wrote:

 For basic dragging stuff, here's typically what I do. Have a mouse
 down listener on whatever component you want to drag. On mouse down
 you keep track of the coordinates where the user pressed. Then you add
 a mouse move listener to the system manager. Also add a mouse up
 listener to system manager. Then when the user moves the mouse (which
 you catch with the system manager listener), perform the calculation
 of how far from the original mouse down position the mouse is and move
 the component to the right place. Then when you catch the mouse up
 event (again, from system manager), you remove the mouse move listener
 and you're done.
 
 See the code in the Panel class in the Flex framework for an example
 of this type of dragging. The big thing to know is that you want to
 use mouse move and mouse up events from the system manager, not from
 the component itself. If you use the component itself you'll end up
 losing the mouse movement if the user drags quickly off the component,
 or you might get stuck in endless dragging if the mouse is released
 while not over the component.
 
 You should also probably have a listener for when the mouse leaves the
 stage and stop dragging at that point too, since not doing that can
 make the drag operation continue after the release the mouse (if they
 move the mouse off your app and the release).
 
 Doug
 
 On Tue, Sep 23, 2008 at 12:30 PM, gwangdesign [EMAIL PROTECTED] wrote:
  Sorry if this question should be better showing up at the
  flexcomponent group. I didn't have any luck there so far;)
 
  Suppose I am motivated enough to roll up my sleeves to do something
  like what McCune is doing here at tileUI.com:
 
  http://www.youtube.com/watch?v=T0N7tgF7OOM
 
  Just for the drag part to get started, am I better off implementing
  the darg-drop framework that Flex provide or should I start from the
  more basic mouseUp/mouseDown?
 
  I guess this question is for every Flex guru besides Doug;) I
  appreciate it.
 
 





[flexcoders] Re: e4x not working due to namespace

2008-09-15 Thread gwangdesign
Josh, I think get it. Thanks.

--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] 
wrote:

 Would you expect it to work if they changed the names of their 
nodes? The
 namespace is just part of the name, it's simply a shortcut so you 
can use
 less characters in your XML file but keep the names distinct. You 
wouldn't
 build this:
 
 animals
   cat/
   cat/
 /animals
 
 var cats : XMLList = rootNode..cat;
 
 and expect to get something in the cats variable if the cat 
nodes were
 renamed to dog nodes would you?
 
 -Josh
 
 On Mon, Sep 15, 2008 at 10:02 AM, gwangdesign [EMAIL PROTECTED] 
wrote:
 
  Hi Josh,
 
  Thanks for the lead. I'm new to this but by looking at the Flex
  documentation it seems that you would need to hardcode the uri 
into
  QName/namespace? What I mean is that I am trying to get the 
default
  namespace at runtime so that ideally my code would still run in 
the
  case YouTube changed their namespaces;) But unfortunately it 
doesn't work:
 
  var def:Namespace = new Namespace(xml.namespace());
  use namespace def;
 
  ...
 
  Could you give the code about QName? Thanks!
 
 
  --- In flexcoders@yahoogroups.com, Josh McDonald dznuts@ 
wrote:
  
   It should work, but you need to either use a QName (instead of 
a
  String) to
   access nodes. Also, you could probably define an namespace 
like this
  (off
   the top of my head, syntax might be wrong):
  
   private namespace rootNS = http://www.w3.org/2005/Atom;;
  
   using rootNs;
  
   //... Do your e4x stuff here...
  
   I'd say use QNames. I know at first it seems kinda annoying to 
have to
   define a bunch QName constants, but when Youtube decide to 
change their
   namespaces, or the name of a node, or something like that, 
you'll be
  glad
   you did.
  
   -Josh
  
   On Mon, Sep 15, 2008 at 4:50 AM, gwangdesign gwangdesign@ 
wrote:
  
Hi,
   
I am trying to access the YouTube feed. Like this:
   

   
  http://gdata.youtube.com/feeds/api/videos?rq=HurricaneIKE%20max-
results=2

   
It returns something like this:
   
feed
xmlns='http://www.w3.org/2005/Atom'
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:yt='http://gdata.youtube.com/schemas/2007'
xmlns:gd='http://schemas.google.com/g/2005'
   id/
   updated/
   author/
   generator/
   
openSearch:totalResults127862056/openSearch:totalResults
   ...
   entry
   ...
   /entry
/feed
   
Everything is fine except that I cannot traverse the 
returned xml file
in e4x syntax, while the old school child(0) works just 
fine. After
hours of digging, I found out that it was the namespace of 
the top
node:http://www.w3.org/2005/Atom; that prevents e4x from 
working. I
figured this out by saving a local copy of the xml file and 
trimming
off the aforementioned uri of the namespace, like this:
   
feed
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
xmlns:gml='http://www.opengis.net/gml'
xmlns:georss='http://www.georss.org/georss'
xmlns:media='http://search.yahoo.com/mrss/'
xmlns:batch='http://schemas.google.com/gdata/batch'
xmlns:yt='http://gdata.youtube.com/schemas/2007'
xmlns:gd='http://schemas.google.com/g/2005
...
/feed
   
So what I am trying to do now, without any good advice, is 
trying to
set the namespace for the top node to another uri or just 
null,
because that's what's working with a local copy.
   
BTW, I tried both HTTPService and URLLoader/URLRequest and 
they yield
the same results. I tried copy() the xml file without 
altering the
namespaces for the top node and it ONLY worked for a local 
xml file.
   
Any suggestions?
   
   

   
--
Flexcoders Mailing List
FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location:
   
 
  https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-
446f-b4cf-1e62079f6847
Search Archives:
http://www.mail-archive.com/flexcoders%
40yahoogroups.comYahoo! Groups
Links
   
   
   
   
  
  
   --
   Therefore, send not to know For whom the bell tolls. It tolls 
for
  thee.
  
   http://flex.joshmcdonald.info/
  
   :: Josh 'G-Funk' McDonald
   :: 0437 221 380 :: josh@
  
 
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: 
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
  https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-
446f-b4cf-1e62079f6847
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! 
Groups
  Links
 
 
 
 
 
 
 -- 
 Therefore, send not to know For whom the bell

[flexcoders] Re: e4x not working due to namespace

2008-09-14 Thread gwangdesign
Hi Josh,

Thanks for the lead. I'm new to this but by looking at the Flex
documentation it seems that you would need to hardcode the uri into
QName/namespace? What I mean is that I am trying to get the default
namespace at runtime so that ideally my code would still run in the
case YouTube changed their namespaces;) But unfortunately it doesn't work:

var def:Namespace = new Namespace(xml.namespace());
use namespace def;

...

Could you give the code about QName? Thanks!


--- In flexcoders@yahoogroups.com, Josh McDonald [EMAIL PROTECTED] wrote:

 It should work, but you need to either use a QName (instead of a
String) to
 access nodes. Also, you could probably define an namespace like this
(off
 the top of my head, syntax might be wrong):
 
 private namespace rootNS = http://www.w3.org/2005/Atom;;
 
 using rootNs;
 
 //... Do your e4x stuff here...
 
 I'd say use QNames. I know at first it seems kinda annoying to have to
 define a bunch QName constants, but when Youtube decide to change their
 namespaces, or the name of a node, or something like that, you'll be
glad
 you did.
 
 -Josh
 
 On Mon, Sep 15, 2008 at 4:50 AM, gwangdesign [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I am trying to access the YouTube feed. Like this:
 
  
 
http://gdata.youtube.com/feeds/api/videos?rq=HurricaneIKE%20max-results=2
  
 
  It returns something like this:
 
  feed
  xmlns='http://www.w3.org/2005/Atom'
  xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
  xmlns:gml='http://www.opengis.net/gml'
  xmlns:georss='http://www.georss.org/georss'
  xmlns:media='http://search.yahoo.com/mrss/'
  xmlns:batch='http://schemas.google.com/gdata/batch'
  xmlns:yt='http://gdata.youtube.com/schemas/2007'
  xmlns:gd='http://schemas.google.com/g/2005'
 id/
 updated/
 author/
 generator/
 openSearch:totalResults127862056/openSearch:totalResults
 ...
 entry
 ...
 /entry
  /feed
 
  Everything is fine except that I cannot traverse the returned xml file
  in e4x syntax, while the old school child(0) works just fine. After
  hours of digging, I found out that it was the namespace of the top
  node:http://www.w3.org/2005/Atom; that prevents e4x from working. I
  figured this out by saving a local copy of the xml file and trimming
  off the aforementioned uri of the namespace, like this:
 
  feed
  xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'
  xmlns:gml='http://www.opengis.net/gml'
  xmlns:georss='http://www.georss.org/georss'
  xmlns:media='http://search.yahoo.com/mrss/'
  xmlns:batch='http://schemas.google.com/gdata/batch'
  xmlns:yt='http://gdata.youtube.com/schemas/2007'
  xmlns:gd='http://schemas.google.com/g/2005
  ...
  /feed
 
  So what I am trying to do now, without any good advice, is trying to
  set the namespace for the top node to another uri or just null,
  because that's what's working with a local copy.
 
  BTW, I tried both HTTPService and URLLoader/URLRequest and they yield
  the same results. I tried copy() the xml file without altering the
  namespaces for the top node and it ONLY worked for a local xml file.
 
  Any suggestions?
 
 
  
 
  --
  Flexcoders Mailing List
  FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
  Alternative FAQ location:
 
https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
  Search Archives:
  http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
  Links
 
 
 
 
 
 
 -- 
 Therefore, send not to know For whom the bell tolls. It tolls for
thee.
 
 http://flex.joshmcdonald.info/
 
 :: Josh 'G-Funk' McDonald
 :: 0437 221 380 :: [EMAIL PROTECTED]





[flexcoders] e4x not working due to namespace

2008-09-14 Thread gwangdesign
setuju dengan bung Agung... kadang kadang tender di pemerintahan nggak sampe
ngecheck sampe detil apakah orang nya ada atau nggak, cuman setor KTP,
sertifikat dan CV udah cukup memenuhi persyaratan tender.

2008/9/13 Agung Darmawan [EMAIL PROTECTED]

 ah paling ini cuma akal2an aja buat dokumen tenaga ahli.
 ujung2nya company yg bersangkutan cuma narik CV buat dijadiin dokumen
 tender
 doang.
 fenomena ini sudah ramaijadi hati2 lah CV kalian cuma dijadikan dokumen
 tender doang.


 waspada perlu donk!!!


...del...

-- 
// syarifl.com


[Non-text portions of this message have been removed]




-- 
www.itcenter.or.id - Komunitas Teknologi Informasi Indonesia 
Gabung, Keluar, Mode Kirim : [EMAIL PROTECTED] 

Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/ITCENTER/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://www.w3.org/2005/Atom; that prevents e4x from working. I
figured this out by saving a local copy of the xml file and trimming
off the aforementioned uri of the namespace, like this:

feed
xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' 
xmlns:gml='http://www.opengis.net/gml' 
xmlns:georss='http://www.georss.org/georss' 
xmlns:media='http://search.yahoo.com/mrss/' 
xmlns:batch='http://schemas.google.com/gdata/batch' 
xmlns:yt='http://gdata.youtube.com/schemas/2007' 
xmlns:gd='http://schemas.google.com/g/2005
...
/feed

So what I am trying to do now, without any good advice, is trying to
set the namespace for the top node to another uri or just null,
because that's what's working with a local copy. 

BTW, I tried both HTTPService and URLLoader/URLRequest and they yield
the same results. I tried copy() the xml file without altering the
namespaces for the top node and it ONLY worked for a local xml file.

Any suggestions?



[flexcoders] dynamic tooltip via function call returns 0 for x/y/width/height

2008-08-29 Thread gwangdesign
Hi,

I am trying to use tooltip to show x/y/width/height for some of the 
UIComponents in my app. But it shows 0 for all these values, while a
similar function call for the click event works fine. Can anyone explain
the reason behind this?

Here is the code snippet:

!--ActionScript--
[Bindable]
private function getPosSiz(comp:UIComponent):String
{
return comp+ x: +comp.x+; y: +comp.y+; w:
+comp.measuredWidth+; h: +comp.height;
}
private function tracePosSiz(comp:UIComponent):void
{
trace(comp+ x: +comp.x+; y: +comp.y+; w: +comp.width+; h:
+comp.height);
}

!--MXML--
mx:Button id=prevBtn label=#0060; click=tracePosSiz(prevBtn);
toolTip={getPosSiz(prevBtn)}/



[flexcoders] Re: dynamic tooltip via function call returns 0 for x/y/width/height

2008-08-29 Thread gwangdesign
Thanks, Alex! Any suggestion as to how to implement a truly dynamic
tooltip?

--- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote:

 getPosSize gets run once at init time when the width/height isn't
known.  It doesn't know when to update again
 
 From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf Of gwangdesign
 Sent: Friday, August 29, 2008 10:20 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] dynamic tooltip via function call returns 0
for x/y/width/height
 
 
 Hi,
 
 I am trying to use tooltip to show x/y/width/height for some of the
 UIComponents in my app. But it shows 0 for all these values, while a
 similar function call for the click event works fine. Can anyone explain
 the reason behind this?
 
 Here is the code snippet:
 
 !--ActionScript--
 [Bindable]
 private function getPosSiz(comp:UIComponent):String
 {
 return comp+ x: +comp.x+; y: +comp.y+; w:
 +comp.measuredWidth+; h: +comp.height;
 }
 private function tracePosSiz(comp:UIComponent):void
 {
 trace(comp+ x: +comp.x+; y: +comp.y+; w: +comp.width+; h:
 +comp.height);
 }
 
 !--MXML--
 mx:Button id=prevBtn label=#0060; click=tracePosSiz(prevBtn);
 toolTip={getPosSiz(prevBtn)}/