[flexcoders] No, Flex & Flash Are Not Dead

2011-11-16 Thread turbo_vb
http://www.tricedesigns.com/2011/11/16/no-flex-flash-are-not-dead/



[flexcoders] Re: Binding behaviour

2011-11-05 Thread turbo_vb
I have to disagree.  If a child property is a class or a collection, you will 
be setting a reference to the same objects in the cloned parent.  Thus, updates 
to the child property will be made to both the clone and the original.  
ObjectUtil.copy() is another good way to clone, but does not always work for 
deeply nested objects.

-TH

--- In flexcoders@yahoogroups.com, The Real Napster  wrote:
>
> Ok. But Its Not compulsory that you have to write a clone method. Anyways
> other way you can try is
> 
> public function cloneLeaf():CallMonitoringLeaf
> {
>  var obj:CallMonitoringLeaf = new CallMonitoringLeaf();
>  obj.optionCallMonitoring = this.optionCallMonitoring;
>  obj.nodesSelected =this.nodesSelected;
>  obj.dataCallMonitoring = this.dataCallMonitoring;
>  obj.nodeName = this.nodeName;
>  return obj;
>  }
> 
> So now calling cloneLeaf() returns new duplicated object.
> 
> Hope this works for you. I did't test it, however your reply will tell
> about that. :)
> 
> Thanks
> 
> On Thu, Nov 3, 2011 at 9:26 PM, turbo_vb  wrote:
> 
> > **
> >
> >
> > If nodeName is a class, you'll need to create a clone method in that class
> > as well, and do this:
> >
> > obj.nodeName = nodeName.clone();
> >
> > If it's just a string, you can try:
> >
> > obj.nodeName = nodeName.toString();
> >
> > -TH
> >
> >
> > --- In flexcoders@yahoogroups.com, geckko  wrote:
> > >
> > > Hi all,
> > >
> > > I'm trying to duplicate one object but when i modify the "master" object
> > > the child object is modified too. My code is something similar to this
> > >
> > > private function cloneLeaf():CallMonitoringLeaf{
> > > var obj:CallMonitoringLeaf = new CallMonitoringLeaf();
> > > obj.optionCallMonitoring = optionCallMonitoring;
> > > obj.nodesSelected = nodesSelected;
> > > obj.dataCallMonitoring = dataCallMonitoring;
> > > obj.nodeName = nodeName;
> > > return obj;
> > > }
> > >
> > > But when i modify nodeName (for example) in the object that i use to
> > > duplicate (master object), the child object modifies its name too. Is
> > > there any way to avoid this behaviour?
> > >
> > > Thanks in advance
> > >
> >
> >  
> >
>




[flexcoders] Re: ModuleLoader.child is null

2011-11-03 Thread turbo_vb
Perhaps you're getting an error on load; probably due to the path.  Try adding 
an event listener for ModuleEvent.ERROR.

Also, this line is missing an equal sign:

var test:ITest ITest(this._moduleLoader.child);

Should be:

var test:ITest = ITest(this._moduleLoader.child);

-TH

--- In flexcoders@yahoogroups.com, "method_air"  wrote:
>
> Can anyone explain why ModuleLoader.child is null in the module event 'ready' 
> event listener:
> 
> this._moduleLoader = new ModuleLoader();
> this._moduleLoader.url = "ImageComparisonModule.swf"; // 
>   
> this._moduleLoader.addEventListener(ModuleEvent.READY, onReady);
> 
> private function onReady(e:ModuleEvent):void
> {
>  var test:ITest ITest(this._moduleLoader.child); // null  
> }
> 
> Module code:
> 
> 
> http://ns.adobe.com/mxml/2009"; 
> xmlns:s="library://ns.adobe.com/flex/spark" 
> xmlns:mx="library://ns.adobe.com/flex/mx" 
>implements="com.storefront.interfaces.controller.ITest"
> >
>   
>   
>   
>   
>   
> 
> 
> Cheers,
> 
> Philip
>




[flexcoders] Re: Binding behaviour

2011-11-03 Thread turbo_vb
If nodeName is a class, you'll need to create a clone method in that class as 
well, and do this:

obj.nodeName = nodeName.clone();

If it's just a string, you can try:

obj.nodeName = nodeName.toString();

-TH

--- In flexcoders@yahoogroups.com, geckko  wrote:
>
> Hi all,
> 
> I'm trying to duplicate one object but when i modify the "master" object
> the child object is modified too. My code is something similar to this
> 
> private function cloneLeaf():CallMonitoringLeaf{
> var obj:CallMonitoringLeaf = new CallMonitoringLeaf();
> obj.optionCallMonitoring = optionCallMonitoring;
> obj.nodesSelected = nodesSelected;
> obj.dataCallMonitoring = dataCallMonitoring;
> obj.nodeName = nodeName;
> return obj;
> }
> 
> But when i modify nodeName (for example) in the object that i use to
> duplicate (master object), the child object modifies its name too. Is
> there any way to avoid this behaviour?
> 
> Thanks in advance
>




[flexcoders] Re: Datagrid's Itemrenderer - Access to Datagrid

2011-10-26 Thread turbo_vb
Cool!  -TH

--- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
>
> That worked! I put it in prepare() and was able to get a reference to the 
> datagrid. 
> 
> Thanks to all for the assistance.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Try sticking that in override prepare() or set data(), and make sure that 
> > data isn't null, and I bet you that it'll work.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > hmm, don't know what to tell you.  The following works fine:
> > > 
> > > var myDataProvider:ArrayCollection = DataGrid( owner ).dataProvider as 
> > > ArrayCollection;
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
> > > >
> > > > No, I was casting "owner" and got that error.
> > > > i.e. - Datagrid(owner).dataprovider
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > > That error looks like you were trying to cast "parent" instead of 
> > > > > "owner".
> > > > > 
> > > > > -TH
> > > > > 
> > > > > --- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
> > > > > >
> > > > > > Thanks. I should have mentioned that I did initially that and was
> > > > > > getting the following error:
> > > > > > 
> > > > > > TypeError: Error #1034: Type Coercion failed: cannot convert
> > > > > > spark.components.gridClasses::GridLayer@260fac29 to
> > > > > > spark.components.DataGrid
> > > > > > 
> > > > > > 
> > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > > > >
> > > > > > > Cast the "owner" property to DataGrid.
> > > > > > >
> > > > > > > -TH
> > > > > > >
> > > > > > > --- In flexcoders@yahoogroups.com, "sdl1326" azsl1326-email@ 
> > > > > > > wrote:
> > > > > > > >
> > > > > > > > I have a custom itemrenderer in a GridColumn of a Spark 
> > > > > > > > Datagrid. I
> > > > > > need
> > > > > > > > to get access to the Datagrid from the custom itemrenderer. 
> > > > > > > > What's
> > > > > > the
> > > > > > > > best way to do this?
> > > > > > > >
> > > > > > > > Thanks, in advance.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: Datagrid's Itemrenderer - Access to Datagrid

2011-10-26 Thread turbo_vb
Try sticking that in override prepare() or set data(), and make sure that data 
isn't null, and I bet you that it'll work.

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> hmm, don't know what to tell you.  The following works fine:
> 
> var myDataProvider:ArrayCollection = DataGrid( owner ).dataProvider as 
> ArrayCollection;
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
> >
> > No, I was casting "owner" and got that error.
> > i.e. - Datagrid(owner).dataprovider
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > That error looks like you were trying to cast "parent" instead of "owner".
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
> > > >
> > > > Thanks. I should have mentioned that I did initially that and was
> > > > getting the following error:
> > > > 
> > > > TypeError: Error #1034: Type Coercion failed: cannot convert
> > > > spark.components.gridClasses::GridLayer@260fac29 to
> > > > spark.components.DataGrid
> > > > 
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > > Cast the "owner" property to DataGrid.
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In flexcoders@yahoogroups.com, "sdl1326" azsl1326-email@ wrote:
> > > > > >
> > > > > > I have a custom itemrenderer in a GridColumn of a Spark Datagrid. I
> > > > need
> > > > > > to get access to the Datagrid from the custom itemrenderer. What's
> > > > the
> > > > > > best way to do this?
> > > > > >
> > > > > > Thanks, in advance.
> > > > > >
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: Datagrid's Itemrenderer - Access to Datagrid

2011-10-26 Thread turbo_vb
hmm, don't know what to tell you.  The following works fine:

var myDataProvider:ArrayCollection = DataGrid( owner ).dataProvider as 
ArrayCollection;

-TH

--- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
>
> No, I was casting "owner" and got that error.
> i.e. - Datagrid(owner).dataprovider
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > That error looks like you were trying to cast "parent" instead of "owner".
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
> > >
> > > Thanks. I should have mentioned that I did initially that and was
> > > getting the following error:
> > > 
> > > TypeError: Error #1034: Type Coercion failed: cannot convert
> > > spark.components.gridClasses::GridLayer@260fac29 to
> > > spark.components.DataGrid
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > Cast the "owner" property to DataGrid.
> > > >
> > > > -TH
> > > >
> > > > --- In flexcoders@yahoogroups.com, "sdl1326" azsl1326-email@ wrote:
> > > > >
> > > > > I have a custom itemrenderer in a GridColumn of a Spark Datagrid. I
> > > need
> > > > > to get access to the Datagrid from the custom itemrenderer. What's
> > > the
> > > > > best way to do this?
> > > > >
> > > > > Thanks, in advance.
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: Datagrid's Itemrenderer - Access to Datagrid

2011-10-26 Thread turbo_vb
That error looks like you were trying to cast "parent" instead of "owner".

-TH

--- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
>
> Thanks. I should have mentioned that I did initially that and was
> getting the following error:
> 
> TypeError: Error #1034: Type Coercion failed: cannot convert
> spark.components.gridClasses::GridLayer@260fac29 to
> spark.components.DataGrid
> 
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Cast the "owner" property to DataGrid.
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "sdl1326" azsl1326-email@ wrote:
> > >
> > > I have a custom itemrenderer in a GridColumn of a Spark Datagrid. I
> need
> > > to get access to the Datagrid from the custom itemrenderer. What's
> the
> > > best way to do this?
> > >
> > > Thanks, in advance.
> > >
> >
>




[flexcoders] Re: Datagrid's Itemrenderer - Access to Datagrid

2011-10-26 Thread turbo_vb
Cast the "owner" property to DataGrid.

-TH

--- In flexcoders@yahoogroups.com, "sdl1326"  wrote:
>
> I have a custom itemrenderer in a GridColumn of a Spark Datagrid. I need
> to get access to the Datagrid from the custom itemrenderer. What's the
> best way to do this?
> 
> Thanks, in advance.
>




[flexcoders] Re: Flex 4.1 VBOX background renderer fails

2011-10-24 Thread turbo_vb
In practice, itemRenderers actually tend to be the best candidate for skins.

-TH

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> You cannot set the backgroundColor of the renderer.  Backgrounds are removed 
> in order to allow alternating background colors to show through.  But you 
> should be able to set it on the TextArea.
> 
> 
> On 10/24/11 6:40 PM, "Sells, Fred"  wrote:
> 
> 
> 
> 
> 
> 
> Yes I tried setStyle() as well as styleName= with no success.  I could not 
> set the backgroundColor property in actionscript (compiler did not recognize 
> property) but I could set that property in mxml to a binding expression and 
> set the color in the bound variable.  Suspect bug but deadlines rapidly 
> approaching and this works.
> 
> I'll try upgrading to 4.5 once I get this delivery out.
> 
> 
> From: flexcoders@yahoogroups.com [mailto:flexcoders@yah! oogroups.com] On 
> Behalf Of Alex Harui
> Sent: Monday, October 24, 2011 7:41 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Flex 4.1 VBOX background renderer fails
> 
> 
> 
> Did you try myText.setStyle("backgroundColor", ...)?
> 
> 
> On 10/24/11 9:59 AM, "Sells, Fred"  wrote:
> 
> 
> 
> 
> 
> 
> I'm using a VBox as a renderer for a datagrid as shown below.  I've
> tried every combination I can think of but I can only set the background
> color of the mx:TextArea in the mxml.  I need to change it in the
> actionscri! pt.  I've tried styles and properties with no success. &n! 
> bsp;I'm< br>reluctant to change wrapper or children since I had a very hard 
> time
> getting it to work with a custom row height.  I used HTML text so I
> could add some bold/font color decoration; although that requirement has
> dissipated.
> 
> 
> http://ns.adobe.com/mxml/2009";
>  xmlns:s="library://ns.adobe.com/flex/spark"
>  xmlns:mx="library://ns.adobe.com/flex/mx"
>  borderThickness="0"
>  verticalScrollPolicy="off" horizontalScrollPolicy="off"
>  paddingBottom="0" paddingLeft="0" paddingRight="0"
> paddingTop="0"
>  >
> 
> 
> 
>   useHandCursor="true" buttonMode="true"
> mouseFocusEnabled="false" mouseChildren="false"
>  editable="false"
>  verticalScrollPolicy="off"
> horizontalScrollPolicy="off"
>  >
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: right align the gridcolumn text

2011-10-24 Thread turbo_vb
ClassFactory doesn't support setting styles; they're different than properties. 
 You can get around this by either:

1) use a custom item renderer that has a styleName or css selector.

2) extend ClassFactory to support setting styles on the item renderer 
instances.  See com.blogagic.core.UIComponentFactory at 
http://blogagic.com/_flex/libagic_source/srcview/index.html

-TH

--- In flexcoders@yahoogroups.com, "bhaq1972"  wrote:
>
> GridColumn doesn't have the textAlign style. Instead we can do this -
> 
> 
>   
> 
>   
>   ..
> 
> How can I do this in actionscript? I've tried the following but doesn't work
> 
> var renderer1:ClassFactory = new ClassFactory(DefaultItemRenderer);
> renderer1.properties = { textAlign:"right", color:0xff00ff };
> col.itemRenderer = renderer1; //doesnt work
>




[flexcoders] Re: toggling checkbox's enabled field in datagrid

2011-09-21 Thread turbo_vb
Have you tried this:



-TH

--- In flexcoders@yahoogroups.com, "carriecharp"  wrote:
>
> I've inherited some code to update and I could use some help. 
> 
> I have an Advanced Data Grid where one column uses a custom checkbox 
> component. It's very simple with the checkbox's selected field controlled by 
> column's datafield, which is a Boolean named 'fired'. 
> 
> I want to have the checkbox enabled only in certain situations, dependent 
> upon a second field , an int called 'type'. Basically, enabled = (type!=0).
> 
> 'type' is a field in the grid's dataprovider and I want to set the enabled 
> field in the declaration below but I can't figure out how to reference the 
> 'type' field.
> 
> Any guidance is appreciated!
> Thanks, Carrie
> 
>
>width="100%">
>   
>   
>   
>click="selected=data.fired=cb.selected;" width="15"/>
>   
>
>




[flexcoders] Re: Best practices for dynamically styling components in FlashBuilder 4.5

2011-09-13 Thread turbo_vb
styleManager.getStyleDeclaration(style_name).setStyle("property", value);

-TH

--- In flexcoders@yahoogroups.com, "c0mpl3xxx"  wrote:
>
> Hi all,
> I'm trying to create a set of components for a video player app that require 
> the ability to be styled via user supplied color options. Basically I have a 
> set of buttons and text objects that will receive custom color properties 
> from the user. This would be easy enough to accomplish using custom style 
> properties on the components and a little CSS; however, I can't figure out 
> how to make this work since the color data is dynamic and served up by the 
> server (i.e. I can't hard-code or create any css style sheets during the 
> build process).
> 
> I am looking for any ideas / best practices on how to accomplish the 
> following:
> 
> 1) Styling components using data supplied at run-time
> 2) Updating specific stylesheet properties at run-time (i.e. I want to change 
> the fontSize value for a custom style called ".h1").
> 
> Ideally I'd be able to link the various components to some stored properties 
> (like css) and then just update those properties and have the components 
> automatically respond. Any suggestions would be greatly appreciated!
> 
> Thanks!
>




[flexcoders] Re: Can't see scrollbars on an MX list in a Spark TitleWindow

2011-09-09 Thread turbo_vb
Have you tried setting an explicit height for the List?

-TH

--- In flexcoders@yahoogroups.com, Nick Middleweek  wrote:
>
> Mmmm, I must be doing something silly, I've also tried this using MX only
> components, so MX:TitleWindow with an MX:List.
> 
> Here's my code: http://pastebin.com/ZkzPQBgJ
> 
> ... and I'm not getting any Scrollbars on the List... height = 100%,
> TitleWindow.height=250.
> 
> 
> Can anyone see what I'm missing?
> 
> 
> Cheers,
> Nick
> 
> 
> 
> On 9 September 2011 16:31, Nick Middleweek  wrote:
> 
> > Hi,
> >
> > Are there any obvious reasons why my MX List won't show scrollbars. It's
> > tucked inside a Spark TitleWindow.
> >
> > The list has verticalScrollPolicy = on, width and height = 100% and the
> > TitleWindow is width = 400, height = 250.
> >
> > There is enough data so the List should render scrollbars.
> >
> >
> > Thanks,
> > Nick
> >
> >
>




[flexcoders] Re: Flex 4: MouseOver not firing on a UIComponent Item Renderer

2011-09-06 Thread turbo_vb
It doesn't seem that skinning is something that Adobe considered would need to 
be done in a skin class, for an item renderer.  But, you can apply a skin class 
to them if desired.  At each level: GroupBase, Group, DataRenderer, and finally 
ItemRenderer, you get additional functionality; and consequently, a little more 
overhead.  For instance, if you used ItemRenderer instead of UIComponent, you 
could use the "hovered" state to control the visibility of the button.  
However, I think that you're going about it the most efficient way in creating 
AS item renderers instead of mxml; especially for ADG.

-TH

--- In flexcoders@yahoogroups.com, Nick Middleweek  wrote:
>
> Thanks for the tip...
> 
> If I bumped up to GroupBase, does that mean I can use Spark skinning as well
> or is this not related?
> 
> 
> 
> 
> 
> 
> On 6 September 2011 16:31, turbo_vb  wrote:
> 
> > **
> >
> >
> > You might try bumping up from UIComponent to GroupBase and set
> > mouseEnabledWhereTransparent = true;
> >
> > -TH
> >
> >
> > --- In flexcoders@yahoogroups.com, Alex Harui  wrote:
> > >
> > > Something has to draw onto every pixel, otherwise the mouse hit passes
> > through to underneath. You can set the alpha to 0 and it will still work.
> > You can also set background=true and pick a backgroundColor on the TextField
> > and not have to draw the fill.
> > >
> > >
> > > On 9/6/11 2:18 AM, "Nick Middleweek"  wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > > OK, well I've settled with the white background for now...
> > >
> > >
> > >
> > >
> > >
> > > On 5 September 2011 11:36, Nick Middleweek  wrote:
> > > Hi,
> > >
> > > We're using Flex 4 and have an Item Renderer that extends UIComponent.
> > >
> > > We're adding a TextField that's added in createChildren().
> > >
> > > In the Constructor(), I'm adding the listener:
> > >
> > > this.addEventListener(MouseEvent.MOUSE_OVER, this_onMouseOver);
> > >
> > >
> > > ...And in the listener function, I'm adding a button:
> > >
> > > indicator = new Button();
> > > indicator.width = 20;
> > > indicator.height = 20;
> > > indicator.label = "...";
> > > this.addChild(indicator);
> > >
> > > this.invalidateDisplayList();
> > >
> > >
> > > The problem is that the MouseOver event is ONLY firing when I mouse over
> > the TextField and not the 'background' of the IR.
> > >
> > > If I draw a rectangle in updateDisplayList:
> > >
> > > // draw rect
> > > this.graphics.beginFill(0xFF, 1);
> > > this.graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
> > > this.graphics.endFill();
> > >
> > > ... the MouseOver event DOES fire on the red background.
> > >
> > > Is there a way of achieving this without drawing a rectangle? I did think
> > of setting the rect to white but this doesn't seem like the correct
> > approach.
> > >
> > >
> > > Thanks for any help...
> > >
> > > Nick
> > >
> > >
> > > --
> > > Alex Harui
> > > Flex SDK Team
> > > Adobe System, Inc.
> > > http://blogs.adobe.com/aharui
> > >
> >
> >  
> >
>




[flexcoders] Re: Flex 4: MouseOver not firing on a UIComponent Item Renderer

2011-09-06 Thread turbo_vb
You might try bumping up from UIComponent to GroupBase and set 
mouseEnabledWhereTransparent = true;

-TH

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Something has to draw onto every pixel, otherwise the mouse hit passes 
> through to underneath.  You can set the alpha to 0 and it will still work.  
> You can also set background=true and pick a backgroundColor on the TextField 
> and not have to draw the fill.
> 
> 
> On 9/6/11 2:18 AM, "Nick Middleweek"  wrote:
> 
> 
> 
> 
> 
> 
> OK, well I've settled with the white background for now...
> 
> 
> 
> 
> 
> On 5 September 2011 11:36, Nick Middleweek  wrote:
> Hi,
> 
> We're using Flex 4 and have an Item Renderer that extends UIComponent.
> 
> We're adding a TextField that's added in createChildren().
> 
> In the Constructor(), I'm adding the listener:
> 
>this.addEventListener(MouseEvent.MOUSE_OVER, this_onMouseOver);
> 
> 
> ...And in the listener function, I'm adding a button:
> 
>indicator = new Button();
> indicator.width = 20;
> indicator.height = 20;
> indicator.label = "...";
> this.addChild(indicator);
> 
> this.invalidateDisplayList();
> 
> 
> The problem is that the MouseOver event is ONLY firing when I mouse over the 
> TextField and not the 'background' of the IR.
> 
> If I draw a rectangle in updateDisplayList:
> 
>// draw rect
> this.graphics.beginFill(0xFF, 1);
> this.graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
> this.graphics.endFill();
> 
> ... the MouseOver event DOES fire on the red background.
> 
> Is there a way of achieving this without drawing a rectangle? I did think of 
> setting the rect to white but this doesn't seem like the correct approach.
> 
> 
> Thanks for any help...
> 
> Nick
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: Why don't horizontalCenter and verticalCenter work with Spark ColumnConstraints?

2011-08-31 Thread turbo_vb
Ok, that makes a little more sense now.  It can still work, but instead of 
moving the boxes, during transition, move the groups; and resize the boxes 
within the groups.  As an alternative, you could choose to use a custom layout 
class.  

-TH

--- In flexcoders@yahoogroups.com, RobertTr  wrote:
>
> 
> Can't do it.  Boxes must be constrained via ConstraintColumns.  The boxes
> switch sides, resize, appear and disappear, etc. via different states and
> there are transitions on those states to ease the boxes in as they move and
> resize.  Picture a "reverse" button upper right that when clicked reverses
> the position of the boxes. When the boxes reverse, they smoothly transition
> to their new reversed positions. Those transitions won't work if the
> components are in different groups. They have to be horizontally centered on
> a ColumnConstraint, not a Group container.
> 
> This isn't a new app.  It's an existing app with a well designed UI.  I'm
> just transitioning to Spark so as to take advantage of the new skinning
> model and facilitate parallel browser and mobile skins.  Can't change the
> app's behavior in the process.
> 
> In any event, I heard back from Adobe on this.  They said, "we didn't have
> enough time to implement horizontal/verticalCenter in the last release
> (hopefully coming in the next!).". I asked if they meant for all Spark
> containers or what. They responded, "Yes, basically, they are not
> implemented in ConstraintLayout. ConstraintLayout handles all of the
> ConstraintColumns/ConstraintRows layout logic." So that leaves me stuck
> until the next release unless I can find a workaround.
> 
> 
> 
> turbo_vb wrote:
> > 
> > Constraints are designed to be used to constrain other components for
> > things like alignment and size.  For your app, just add a group around
> > each of your containers and you're fine.
> > 
> > -TH
> > 
> > 
> > http://ns.adobe.com/mxml/2009";
> > xmlns:s="library://ns.adobe.com/flex/spark"
> > xmlns:mx="library://ns.adobe.com/flex/mx"
> > backgroundColor="blue">
> > 
> >  > backgroundColor="red"
> > bottom="100"
> > top="100">
> > 
> > 
> > 
> >  > width="{ width / 2 }" />
> >  > width="{ width / 2 }" />
> > 
> > 
> > 
> > 
> >  > height="100%"
> > left="col1:0"
> > right="col1:0">
> >  > width="400"
> > height="300"
> > backgroundColor="green"
> > horizontalCenter="0"
> > verticalCenter="0" />
> > 
> > 
> >  > height="100%"
> > left="col2:0"
> > right="col2:0">
> >  > width="200"
> > height="150"
> > backgroundColor="yellow"
> > horizontalCenter="0"
> > verticalCenter="0" />
> > 
> > 
> > 
> > 
> > 
> > 
> > --- In flexcoders@yahoogroups.com, RobertTr  wrote:
> >>
> >> 
> >> Here's code that splits the screen into two columns, left and right. Then
> >> it
> >> puts a box in each column and attempts to center them. The
> >> horizontalCenter
> >> and verticalCenter properties are ignored:
> >> 
> >> 
> >> http://ns.adobe.com/mxml/2009"; 
> >>   xmlns:s="library://ns.adobe.com/flex/spark" 
> >>   xmlns:mx="library://ns.adobe.com/flex/mx"
> >>   backgroundColor="blue">
> >>
> >>
> >>
> >> &g

[flexcoders] Re: Why don't horizontalCenter and verticalCenter work with Spark ColumnConstraints?

2011-08-29 Thread turbo_vb
Constraints are designed to be used to constrain other components for things 
like alignment and size.  For your app, just add a group around each of your 
containers and you're fine.

-TH


http://ns.adobe.com/mxml/2009";
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
backgroundColor="blue">























--- In flexcoders@yahoogroups.com, RobertTr  wrote:
>
> 
> Here's code that splits the screen into two columns, left and right. Then it
> puts a box in each column and attempts to center them. The horizontalCenter
> and verticalCenter properties are ignored:
> 
> 
> http://ns.adobe.com/mxml/2009"; 
>  xmlns:s="library://ns.adobe.com/flex/spark" 
>  xmlns:mx="library://ns.adobe.com/flex/mx"
>  backgroundColor="blue">
>   
>   
>   
>   top="100" bottom="100"
>backgroundColor="red">
>   
>   
>   
>width="{width/2}" />
>width="{width/2}" />  
> 
> 
>   
>   
> backgroundColor="green"
>  width="400" height="300"
>  horizontalCenter="col1:0"
>  verticalCenter="0">
>   
> backgroundColor="yellow"
>  width="200" height="150"
>  horizontalCenter="col2:0"
>  verticalCenter="0">
>   
>   
> 
> 
> -- 
> View this message in context: 
> http://old.nabble.com/Why-don%27t-horizontalCenter-and-verticalCenter-work-with-Spark-ColumnConstraints--tp32358020p32358020.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>




[flexcoders] Re: Best Practice for Subclassed UIComponent and DataProvider

2011-08-28 Thread turbo_vb
Back to your problem.  If you're not seeing the combo box's dataProvider 
populate or update, then it's a binding problem.  Good idea to try the 
BindingUtils, but it's easier to fix the binding events in the model.  If 
you're using a getter / setter in the model, for the facilities collection, 
make sure that the binding event is dispatched in the setter.  If you're not 
seeing the collection update, when existing items have been changed elsewhere, 
then listen for the COLLECTION_CHANGE event on the facilities collection, and 
in the listener function, manually dispatch the collection's binding event 
(same as the one in the setter).  If this doesn't work, look further upstream; 
in the service, delegate or controller.  You'll find the short.

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> You have the right idea; to encapsulate the dataProvider, validation and 
> change event handler.  But, instead of putting them inside the control, wrap 
> all of that into a common facilities model, that gets used anywhere it's 
> needed in the application.  I stopped using Cairngorm a long time ago, but 
> hopefully the newest version supports dependency injection; so you can just 
> inject a reference to the facilities model where needed, and hook it up to 
> the combo box.  That would be best practice.  But, at the end of the day, the 
> goal is to make it work, so...
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "hanzo55"  wrote:
> >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > I very much appreciate the help! Any chance I can take to improve the 
> > design would be greatly beneficial, from a maintenance standpoint.
> > 
> > My feeling originally was if I have two comboboxes that are in entirely 
> > different parts of the app, but that will always be populated by the same 
> > data provider, always have the same validation and always utilize the same 
> > change function (while being different from other comboboxes in the site), 
> > it made sense to encapsulate the dataprovider/validation/change events into 
> > the box itself so it could be added to a view without having to specify all 
> > of the various attributes a combobox needs--since they are not changing.
> > 
> > Initially, it seemed a bit pointless to write:
> > 
> > 
> > 
> > everywhere I implemented the Facility ComboBox since everywhere the 
> > Facility ComboBox is implemented...the dataProvider is *going* to be 
> > model.facilities and will never change.
> > 
> > If you think that there is a good example somewhere that demonstrates a 
> > better design for this type of class hierachy, please point me to it and 
> > I'll have a look. As the subject states, I'm very much looking for the best 
> > practice here.
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > Validation can be abstracted just like dataProviders.  For a combo box, 
> > > you only need to validate the selectedItem; from the view, presentation 
> > > model, or a common utility class.  Most other stuff happens in 
> > > itemRenderers; that have a little more freedom.  It may be that you're 
> > > locked into a structure that was handed to you, but hardcoding a 
> > > reference to a singleton model, from which you set the data provider of a 
> > > combo box from within the combo box, breaks the rules.  If you're having 
> > > problems with binding the dataProvider to the model's property, the 
> > > binding problem is probably upstream from the combo box.  Good luck 
> > > Shawn, just trying to help.
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "hanzo55"  wrote:
> > > >
> > > > 
> > > > 
> > > > There's more to the story in regards to the class design than what's 
> > > > provided here; The subclass is actually part of a larger set of classes 
> > > > that share common functionality in terms of their validation and change 
> > > > events based on the data-providers for a global app. 
> > > > 
> > > > That common functionality is centralized in their parent class. The 
> > > > dataProvider assignment in the constructor is tying those specific 
> > > > ComboBox subclasses to a family of service providers that produce an 
> > > > expected set of columns. Since those ComboBoxes, with their very 
> > > > specific validation and change routines (which are common to each

[flexcoders] Re: How to call container's method into component file

2011-08-28 Thread turbo_vb
That's bad advice Rishi; that leads to tight coupling and "parent abuse".  It's 
ok to have a parent call a method on a child ( data binding is preferred 
though).  But, children shouldn't call methods directly on their parents.  
Instead, have the child component dispatch an event to initiate the save method 
on the parent.

-TH

--- In flexcoders@yahoogroups.com, Rishi Tandon  wrote:
>
> Use object oriented best practice.
> Mxml I'd nothing but a actionscript class.
> If u r initializing  the custom component inside the other component, then u 
> can directly access the method or else use the 
> Application.application.componentiD.methodName if u are 
> Where are u initializing globally.
> 
> Sent from my iPhone
> 
> On Aug 28, 2011, at 2:21 AM, "shail"  wrote:
> 
> > Hi Group,
> > 
> > I have a customize container component in which i am using one 
> > sub-component. The customize container has one overriden method save(), i 
> > want to call this method in subcomponent. Can this be possible?
> > 
> > my code looks like this -
> > 
> > GraphDex.mxml
> > 
> > 
> > overrides public void save(){
> > //plz ignore syntex
> > }
> > 
> > 
> > 
> > 
> > 
> > Here I want to call mentioned save() method in Dex component that contain 
> > some graphs, so on click event of Dex graphs i want to call save 
> > functionality.
> > 
> > As being new bee,Please suggest if my approach is wrong.
> > 
> >
>




[flexcoders] Re: Best Practice for Subclassed UIComponent and DataProvider

2011-08-28 Thread turbo_vb
You have the right idea; to encapsulate the dataProvider, validation and change 
event handler.  But, instead of putting them inside the control, wrap all of 
that into a common facilities model, that gets used anywhere it's needed in the 
application.  I stopped using Cairngorm a long time ago, but hopefully the 
newest version supports dependency injection; so you can just inject a 
reference to the facilities model where needed, and hook it up to the combo 
box.  That would be best practice.  But, at the end of the day, the goal is to 
make it work, so...

-TH

--- In flexcoders@yahoogroups.com, "hanzo55"  wrote:
>
> 
> 
> 
> 
> 
> 
> 
> 
> I very much appreciate the help! Any chance I can take to improve the design 
> would be greatly beneficial, from a maintenance standpoint.
> 
> My feeling originally was if I have two comboboxes that are in entirely 
> different parts of the app, but that will always be populated by the same 
> data provider, always have the same validation and always utilize the same 
> change function (while being different from other comboboxes in the site), it 
> made sense to encapsulate the dataprovider/validation/change events into the 
> box itself so it could be added to a view without having to specify all of 
> the various attributes a combobox needs--since they are not changing.
> 
> Initially, it seemed a bit pointless to write:
> 
> 
> 
> everywhere I implemented the Facility ComboBox since everywhere the Facility 
> ComboBox is implemented...the dataProvider is *going* to be model.facilities 
> and will never change.
> 
> If you think that there is a good example somewhere that demonstrates a 
> better design for this type of class hierachy, please point me to it and I'll 
> have a look. As the subject states, I'm very much looking for the best 
> practice here.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Validation can be abstracted just like dataProviders.  For a combo box, you 
> > only need to validate the selectedItem; from the view, presentation model, 
> > or a common utility class.  Most other stuff happens in itemRenderers; that 
> > have a little more freedom.  It may be that you're locked into a structure 
> > that was handed to you, but hardcoding a reference to a singleton model, 
> > from which you set the data provider of a combo box from within the combo 
> > box, breaks the rules.  If you're having problems with binding the 
> > dataProvider to the model's property, the binding problem is probably 
> > upstream from the combo box.  Good luck Shawn, just trying to help.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "hanzo55"  wrote:
> > >
> > > 
> > > 
> > > There's more to the story in regards to the class design than what's 
> > > provided here; The subclass is actually part of a larger set of classes 
> > > that share common functionality in terms of their validation and change 
> > > events based on the data-providers for a global app. 
> > > 
> > > That common functionality is centralized in their parent class. The 
> > > dataProvider assignment in the constructor is tying those specific 
> > > ComboBox subclasses to a family of service providers that produce an 
> > > expected set of columns. Since those ComboBoxes, with their very specific 
> > > validation and change routines (which are common to each other), apply 
> > > very tightly to those service providers and no others, it made sense to 
> > > subclass them and encapsulate dataProvider assignment, so those 
> > > ComboBoxes could be used in any views that apply to that family of 
> > > services.
> > > 
> > > ...if that makes sense.
> > > 
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > Can't see any good reason to subclass a control in order to hardcode 
> > > > the dataProvider.  The idea is to keep the components loosely coupled.  
> > > > Are you having a problem with dataProvider="{model.facilities}"?
> > > > 
> > > > -TH
> > > > 
> > > > --- In flexcoders@yahoogroups.com, Alex Harui  wrote:
> > > > >
> > > > > Binding a visual component to a singleton limits its reuse.  So there 
> > > > > may not really a best practice.  The minimum code way is probably to 
> > > > > assign the dataProvider in commitProperties instead of the 
> > > > > constructor.  The model.facilities might have its fin

[flexcoders] Re: Best Practice for Subclassed UIComponent and DataProvider

2011-08-26 Thread turbo_vb
Validation can be abstracted just like dataProviders.  For a combo box, you 
only need to validate the selectedItem; from the view, presentation model, or a 
common utility class.  Most other stuff happens in itemRenderers; that have a 
little more freedom.  It may be that you're locked into a structure that was 
handed to you, but hardcoding a reference to a singleton model, from which you 
set the data provider of a combo box from within the combo box, breaks the 
rules.  If you're having problems with binding the dataProvider to the model's 
property, the binding problem is probably upstream from the combo box.  Good 
luck Shawn, just trying to help.

-TH

--- In flexcoders@yahoogroups.com, "hanzo55"  wrote:
>
> 
> 
> There's more to the story in regards to the class design than what's provided 
> here; The subclass is actually part of a larger set of classes that share 
> common functionality in terms of their validation and change events based on 
> the data-providers for a global app. 
> 
> That common functionality is centralized in their parent class. The 
> dataProvider assignment in the constructor is tying those specific ComboBox 
> subclasses to a family of service providers that produce an expected set of 
> columns. Since those ComboBoxes, with their very specific validation and 
> change routines (which are common to each other), apply very tightly to those 
> service providers and no others, it made sense to subclass them and 
> encapsulate dataProvider assignment, so those ComboBoxes could be used in any 
> views that apply to that family of services.
> 
> ...if that makes sense.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Can't see any good reason to subclass a control in order to hardcode the 
> > dataProvider.  The idea is to keep the components loosely coupled.  Are you 
> > having a problem with dataProvider="{model.facilities}"?
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, Alex Harui  wrote:
> > >
> > > Binding a visual component to a singleton limits its reuse.  So there may 
> > > not really a best practice.  The minimum code way is probably to assign 
> > > the dataProvider in commitProperties instead of the constructor.  The 
> > > model.facilities might have its final assignment by then.
> > > 
> > > 
> > > On 8/25/11 9:41 AM, "hanzo55"  wrote:
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > I am working with a project already in place. It uses Cairngorm and is 
> > > built on Flex 3.0.2.2113
> > > 
> > > A standard ComboBox is implemented in one of the views like so:
> > > 
> > > 
> > > 
> > > "model" is a bindable singleton, and one of its properties, "facilities" 
> > > is a public ArrayCollection. On initialization, a function runs in the 
> > > singleton to populate facilities; it does this by pointing 
> > > model.facilities to another ArrayCollection that has been previously 
> > > populated, such as:
> > > 
> > > model.facilities = model.assigned_facilities;
> > > 
> > > This works without issue; when the application starts, the ComboBox is 
> > > properly populated with the values pointed to by model.facilities.
> > > 
> > > I have decided! to come in and build a subclass of ComboBox in 
> > > ActionScript, and rather than pass the dataProvider in, I want to include 
> > > the singleton within the ActionScript, and simply do the same assignment 
> > > in the constructor. The resulting MXML would look like this:
> > > 
> > > 
> > > 
> > > and the constructor would look like this:
> > > 
> > > public function FacilityComboBox()
> > > {
> > > super();
> > > ! BindingUtils.bindProperty(this, "dataProvider", model, "facilities");
> > > }
> > > 
> > > My question is: Is this the best practice when subclassing a UIComponent 
> > > and wanting to handle the dataProvider assignment internally? The reason 
> > > I ask is, I had originally built the constructor like this:
> > > 
> > > public function FacilityComboBox()
> > > {
> > > super();
> > > thi! s.dataProperty = model.facilities;
> > > }
> > > 
> > > which worked for other subclassed ComboBoxes where the dataProvider *did 
> > > not change after initialization*. However, because of how 
> > > model.facilities is assigned (to an existing ArrayCollection), no change 
> > > was ever detected, and upon launch the application, the ComboBox sat 
> > > dormant and never received any values to populate. Changing to the 
> > > BindingUtils method solved this problem, but I now fear I'm missing a 
> > > much broader concept about dataProvider assignment in pure ActionScript 
> > > classes. Is my BindingUtils methodology the one to go with? Or should I 
> > > be considering something drastically different?
> > > 
> > > 
> > > 
> > > 
> > > 
> > > --
> > > Alex Harui
> > > Flex SDK Team
> > > Adobe System, Inc.
> > > http://blogs.adobe.com/aharui
> > >
> >
>




[flexcoders] Re: Best Practice for Subclassed UIComponent and DataProvider

2011-08-26 Thread turbo_vb
Can't see any good reason to subclass a control in order to hardcode the 
dataProvider.  The idea is to keep the components loosely coupled.  Are you 
having a problem with dataProvider="{model.facilities}"?

-TH

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> Binding a visual component to a singleton limits its reuse.  So there may not 
> really a best practice.  The minimum code way is probably to assign the 
> dataProvider in commitProperties instead of the constructor.  The 
> model.facilities might have its final assignment by then.
> 
> 
> On 8/25/11 9:41 AM, "hanzo55"  wrote:
> 
> 
> 
> 
> 
> 
> I am working with a project already in place. It uses Cairngorm and is built 
> on Flex 3.0.2.2113
> 
> A standard ComboBox is implemented in one of the views like so:
> 
> 
> 
> "model" is a bindable singleton, and one of its properties, "facilities" is a 
> public ArrayCollection. On initialization, a function runs in the singleton 
> to populate facilities; it does this by pointing model.facilities to another 
> ArrayCollection that has been previously populated, such as:
> 
> model.facilities = model.assigned_facilities;
> 
> This works without issue; when the application starts, the ComboBox is 
> properly populated with the values pointed to by model.facilities.
> 
> I have decided! to come in and build a subclass of ComboBox in ActionScript, 
> and rather than pass the dataProvider in, I want to include the singleton 
> within the ActionScript, and simply do the same assignment in the 
> constructor. The resulting MXML would look like this:
> 
> 
> 
> and the constructor would look like this:
> 
> public function FacilityComboBox()
> {
> super();
> ! BindingUtils.bindProperty(this, "dataProvider", model, "facilities");
> }
> 
> My question is: Is this the best practice when subclassing a UIComponent and 
> wanting to handle the dataProvider assignment internally? The reason I ask 
> is, I had originally built the constructor like this:
> 
> public function FacilityComboBox()
> {
> super();
> thi! s.dataProperty = model.facilities;
> }
> 
> which worked for other subclassed ComboBoxes where the dataProvider *did not 
> change after initialization*. However, because of how model.facilities is 
> assigned (to an existing ArrayCollection), no change was ever detected, and 
> upon launch the application, the ComboBox sat dormant and never received any 
> values to populate. Changing to the BindingUtils method solved this problem, 
> but I now fear I'm missing a much broader concept about dataProvider 
> assignment in pure ActionScript classes. Is my BindingUtils methodology the 
> one to go with? Or should I be considering something drastically different?
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: how to make a class can be iterated by for each/in

2011-08-11 Thread turbo_vb
If you're using Flex 4.5, something like this works:

var myClassObject:Object = new MyClass();
var classInfo:XML = describeType( myClassObject );
var propertyType:String;
var propertyName:String;

for each ( var property:XML in classInfo..accessor )
{
propertyName = property.@name;
propertyType = property.@type;
}

-TH

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> You can't directly loop over a class like you could in AS2.  That's what 
> describeType and ObjectUtil are for.  You can probably loop over the 
> properties returned from ObjectUtil.getClassInfo.
> 
> 
> On 8/11/11 3:23 AM, "j2me_soul"  wrote:
> 
> 
> 
> 
> 
> 
> Sorry I think I express not very clear.
> I want to iterate all the properies in a class using for each/in.
> How can achieve that ?
> 
> At 2011-08-11 17:52:34,"Rishi Tandon"  wrote:
> 
> 
> 
> 
> 
> 
> for each works for collection.
> If you have an instance of the collections consist of your class object then 
> u can retrieve each item as class object using for each iterator.
> 
> Sent from my iPhone
> 
> On Aug 11, 2011, at 2:25 PM, j2me_soul  wrote:
> 
> 
> 
> 
> How to custom a class can by iterate all children by for each
> 
> for each( var item:* in myCustomeClass ){
> 
> }
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread turbo_vb
Not that I know of.  You could avoid all of this by just listening for the 
DataGrid's itemClick event. (mx.events.ListEvent)  In the result handler you 
could check if ( event.itemRenderer is btnRenderer ) { do your thing }

-TH

--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
>
> 
> 
> Would it be possible to simply add it to the MXML file where I am declaring 
> the 
> datagrid, instead of subclassing it?
> 
> Thanks.
> 
> 
> ____
> From: turbo_vb 
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:30:29
> Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> 
>   
> Hi Angelo,
> 
> You're close.  You'll need to declare the event in the DataGrid.  A simple 
> subclass should do the trick.  This way you can add the event listener in 
> mxml 
> too:
> 
> package myPackage
> {
> import mx.controls.DataGrid;
> 
> [Event( name="myTest", type="flash.events.Event")]
> 
> public class MyDataGrid extends DataGrid
> {
> 
> }
> }
> 
> -TH--- In flexcoders@yahoogroups.com, Angelo Anolin  wrote:
> >
> > I have written the following scripts, and yet this does not seem to work.
> > 
> > in my MXML file (main)
> > 
> > private function myDataGrid_CreationComplete() :void
> > {
> >   myDataGrid.addEventListener('myTest', myTesting);
> > }
> > 
> > private function myTesting() :void
> > {
> >   Alert.show('This event should have been called!');
> > }
> > 
> > 
> > in my datagrid, i have declared
> > creationComplete="myDataGrid_CreationComplete()"
> > 
> > In my itemrenderer, I have placed a code :
> > 
> > override protected function clickHandler(event:MouseEvent) :void
> > {
> >   dispatchEvent(new Event('myTest', true));
> > }
> > 
> > For some reason, this does not seem to work. From what I have read mostly, 
> > this 
> >
> > should be able to do the trick.
> > 
> > Any input and ideas appreciated. Thanks..
> > 
> > 
> > 
> > 
> > From: Angelo Anolin angelo_anolin@
> > To: flexcoders@yahoogroups.com
> > Sent: Tue, 17 August, 2010 8:34:07
> > Subject: Re: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> > 
> > 
> > Hi Don,
> > 
> > Thanks for the reply.
> > 
> > I do am able to do the same using an in-line itemrenderer.
> > 
> > But right now, my itemrenderer is an external AS file.
> > 
> > So I declare my MXML like:
> > 
> >  > id="dgActionColumn" width="100" visible="true" 
> >itemRenderer="myButtonItemRenderer"
> >  />
> > 
> > Where myButtonItemRenderer is an external AS file which extends the button.
> > 
> > Now, where I declare the datagrid, I am writing a function which I need to 
> > wire 
> >
> > up to the itemrenderer so that on the click of the button, that method is 
> > dispatched.
> > 
> > Thanks.
> > 
> > 
> > 
> > 
> > 
> > 
> > From: fusionpage fusionpage@
> > To: flexcoders@yahoogroups.com
> > Sent: Tue, 17 August, 2010 8:29:11
> > Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
> > 
> > 
> > I typically use code like this to call a method in the parent MXML page 
> > that 
> > contains the dataGrid...
> > 
> >  > dataField="contentURL">
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > Don
> > 
> > --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote:
> > >
> > > I know someone has encountered this before. 
> > > 
> > > Better to rephrase this one I guess.
> > > 
> > > I have an MXML file, where I have a method.  In that MXML file, I have a 
> > > datagrid, where one of the columns, I created an external itemrenderer.  
> > > The 
> 
> > > itemrenderer is a button.  When I click that button, I want that button 
> > > to 
> >call 
> >
> > >
> > > the method in the MXML file (so that I could re-use the button on other 
> > > datagrids). 
> > > 
> > > Thanks.
> > > 
> > > 
> > > 
> > > 
> > > From: Angelo Anolin angelo_anolin@
> > > To: flexcoders@yahoogroups.com
> > > Sent: Mon, 16 August, 2010 13:54:33
> > > Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> > > 
> > > 
> > > Hi Flexcoders,
> > > 
> > > I have a datagrid and an button itemrenderer named btnRenderer.as
> > > 
> > > I have set this button as an itemRenderer in one of my datagrid columns.
> > > 
> > >  > > itemRenderer="btnRenderer" 
> />
> > > 
> > > I need to respond to an click event on button, passing some of the value 
> > > from 
> >
> > > the dataProvider attached to the datagrid.
> > > 
> > > Should I place my codes on the mxml file where my datagrid is declared?  
> > > How 
> 
> > > would the btnRenderer know that the method is called?
> > > 
> > > Thanks.
> > >
> >
>




[flexcoders] Re: Method for a Datagrid Button Itemrenderer

2010-08-17 Thread turbo_vb
Hi Angelo,
You're close.  You'll need to declare the event in the DataGrid.  A
simple subclass should do the trick.  This way you can add the event
listener in mxml too:

package myPackage

{

import mx.controls.DataGrid;




[Event( name="myTest", type="flash.events.Event" )]




public class MyDataGrid extends DataGrid

{




}

}




-TH
--- In flexcoders@yahoogroups.com, Angelo Anolin 
wrote:
>
> I have written the following scripts, and yet this does not seem to
work.
>
> in my MXML file (main)
>
> private function myDataGrid_CreationComplete() :void
> {
>   myDataGrid.addEventListener('myTest', myTesting);
> }
>
> private function myTesting() :void
> {
>   Alert.show('This event should have been called!');
> }
>
>
> in my datagrid, i have declared
> creationComplete="myDataGrid_CreationComplete()"
>
> In my itemrenderer, I have placed a code :
>
> override protected function clickHandler(event:MouseEvent) :void
> {
>   dispatchEvent(new Event('myTest', true));
> }
>
> For some reason, this does not seem to work. From what I have read
mostly, this
> should be able to do the trick.
>
> Any input and ideas appreciated. Thanks..
>
>
>
> 
> From: Angelo Anolin angelo_ano...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:34:07
> Subject: Re: [flexcoders] Re: Method for a Datagrid Button
Itemrenderer
>
>
> Hi Don,
>
> Thanks for the reply.
>
> I do am able to do the same using an in-line itemrenderer.
>
> But right now, my itemrenderer is an external AS file.
>
> So I declare my MXML like:
>
>  id="dgActionColumn" width="100" visible="true"
itemRenderer="myButtonItemRenderer"
>  />
>
> Where myButtonItemRenderer is an external AS file which extends the
button.
>
> Now, where I declare the datagrid, I am writing a function which I
need to wire
> up to the itemrenderer so that on the click of the button, that method
is
> dispatched.
>
> Thanks.
>
>
>
>
>
> 
> From: fusionpage fusionp...@...
> To: flexcoders@yahoogroups.com
> Sent: Tue, 17 August, 2010 8:29:11
> Subject: [flexcoders] Re: Method for a Datagrid Button Itemrenderer
>
>
> I typically use code like this to call a method in the parent MXML
page that
> contains the dataGrid...
>
>  dataField="contentURL">
> 
> 
> 
> 
> 
> 
>
> Don
>
> --- In flexcoders@yahoogroups.com, Angelo Anolin angelo_anolin@ wrote:
> >
> > I know someone has encountered this before.
> >
> > Better to rephrase this one I guess.
> >
> > I have an MXML file, where I have a method.  In that MXML file, I
have a
> > datagrid, where one of the columns, I created an external
itemrenderer.  The
> > itemrenderer is a button.  When I click that button, I want that
button to call
> >
> > the method in the MXML file (so that I could re-use the button on
other
> > datagrids).
> >
> > Thanks.
> >
> >
> >
> > 
> > From: Angelo Anolin angelo_anolin@
> > To: flexcoders@yahoogroups.com
> > Sent: Mon, 16 August, 2010 13:54:33
> > Subject: [flexcoders] Method for a Datagrid Button Itemrenderer
> >
> >
> > Hi Flexcoders,
> >
> > I have a datagrid and an button itemrenderer named btnRenderer.as
> >
> > I have set this button as an itemRenderer in one of my datagrid
columns.
> >
> > 
> >
> > I need to respond to an click event on button, passing some of the
value from
> > the dataProvider attached to the datagrid.
> >
> > Should I place my codes on the mxml file where my datagrid is
declared?  How
> > would the btnRenderer know that the method is called?
> >
> > Thanks.
> >
>



[flexcoders] Re: Flex 4 data management - how do I approach this?

2010-08-13 Thread turbo_vb
Hi Henrik,
So you're getting back a collection of products from the service and
binding them to the DataGrid.  Let's assume that the product objects are
Product Value Objects.  You have every thing that you need for an order
except for the quantity of the product(s) to order.  Keep it simple, add
a Transient field to the Product VO and use that for the quantity column
in the same DataGrid.

[Transient]

/**

* The product quantity to order

*/

public var productQuantity:int = 0;




The itemEditor in the DataGrid can then just update the quantity
property directly in the Product VO.  The next step is to take the
Product(s) that have a quantity and submit them to become an order. 
Usually the user can select multiple products for an order, so I'll go
that route.  After the user has entered all of the product quantities to
order, the Products in the ArrayCollection are ready to be processed
into an order.  The user clicks a submit button; or you do this when the
individual quantities change.  For each (or one)  Product in the
ArrayCollection that has a quantity > 0, create an OrderDetail VO from
the necessary Product properties; including productQuantity.  You might
prefer OrderContent VO since that's the table that you're updating on
the server.  Add the OrderDetail VOs to an ArrayCollection and send the
collection to the service; to process and create an order.  Or, you can
send a single VO; if that fits your needs better.  The php service can
create the order and then add the details to the order from the
submitted collection of  or single OrderDetail DTO.  That's a simple
round trip.  Good luck.




-TH



--- In flexcoders@yahoogroups.com, "henrik.hedberg"  wrote:
>
> Thanks for the reply, this is what I did to get it to work so far:
>
> I created a value object class to hold exactly the data I wanted for
each row in the datagrid. When the php service returned the data I
looped throught it and transfered what I needed to instances of my VO
and then added those to a new array collection. That array collection I
then bound as a dataprovider for my datagrid.
>
> I put in an inline item renderer for the amount with a numeric
stepper.
>
> The next step will then be to take the correct data from that array
collection (item id and item amount) and transfer it to a php service
that will save it in the order-table of the database.
>
> Since the grid and the ac are bound, I do not need to fire an event on
focus out, I already have the data in the ac. I wonder how that solution
might have worked when the user changes her mind and alters the amount
many times on the products(?)
>
>
> --- In flexcoders@yahoogroups.com, "valdhor" valdhorlists@ wrote:
> >
> > First off, adding this one column datagrid and getting it to line up
correctly must be a pain. I wouldn't do that. Just add another column to
the datagrid for the quantity. You can add as many columns to the
datagrid as you want - they do not have to match the dataprovider.
> >
> > I would design my item editor with a textfield with a focus out
event listener. When the event fires, grab the ID, amount and price and
populate a value object. Add this object to a custom event and dispatch
it.
> >
> > At the same level of the datagrid (Or wherever), have an event
listener for the custom event. When you get it, add the value object to
an orders array collection. If the user commits to buy, send this array
collection to the server to populate the orders database. You can return
the order number and save it in a shared object if you want.
> >
> >
> > --- In flexcoders@yahoogroups.com, "henrik.hedberg"  wrote:
> > >
> > >
> > > Hi guys, quite an explanation here, hope someone has the patience
to
> > > read it through
> > >
> > > I'm building an application in Flex 4 that handles an ordering 
system.
> > > I have a small mySql database and I've written a few services in 
php to
> > > handle the database.
> > >
> > > Basically the logic goes like this:
> > >
> > > I have tables for customers, products, productGroups, orders, and
> > > orderContent
> > >
> > > I have no problem with the CRUD management of the products, orders
and
> > > customers, it is the order submission that the customer will fill
in
> > > that is giving me headaches:
> > >
> > > What I want is to display the products in dataGrids, ordered by 
group,
> > > which will be populated with Flex datamanagement via the 
php-services,
> > > and that per se is no problem. But I also want an extra  column in
the
> > > datagrid that the user can fill in with the amount he  wishes to
order
> > > of that product. This column would in theory then bind  to the db
table
> > > "orderContent" via the php services.
> > >
> > > The problem is that you would need to create a new order in the
> > > database first that the data could bind to (orderContent is linked
to an
> > > order in the db).
> > >
> > > I do not want to create a new order every time a user enters the
page
> > > to look at the products, rather I would like 

[flexcoders] Re: Could not resolve * to a component implementation.

2010-07-27 Thread turbo_vb
The point is that creating 2 files in the same folder, with the same 
case-sensitive name, is ambiguous.  When you import one of the files into a 
component, how do you suppose that the compiler would know which one to use?  
It doesn't matter if its a file or class or interface or whatever.  The 
compiler can't read your mind; yet :)  Your approach of abstracting the view 
script code out of the view is a good idea; especially for unit tests.  Just 
use a different name and you'll be fine.

-TH

--- In flexcoders@yahoogroups.com, "Brian J. Ackermann"  
wrote:
>
> So, its a class, even thought it doesn't declare a class inside the text?
> 
> --
> Brian J. Ackermann
> brian.ackerm...@...
> 952.373.1626
> ------
> 
> 
> 
> 
> 
> On Thu, Jul 1, 2010 at 10:21 PM, turbo_vb  wrote:
> 
> >
> >
> > Glad that you were able to resolve the problem. The AS file IS a class, and
> > if it lives in the same package as the mxml component, the compiler will
> > balk; because it doesn't know which one to import elsewhere. Adobe best
> > practice would have you use Uppercase for the first letter of all classes.
> > Renaming the script class to something like FooScript.as or FooModel.as
> > might be a better way to go.
> >
> > Cheers,
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com , "Brian
> > J. Ackermann"  wrote:
> > >
> > > Here's what the problem was.
> > >
> > > I had originally had a file called "Foo.mxml" which contained a lot of
> > > ActionScript Code. I decided to create a new ActionScript FILE to contain
> > > that script code. I named the file "Foo.as", to indicate the correlation
> > > with the mxml file.
> > >
> > > Renaming this new as file to "foo.as" (lowercase f), resolves the issue.
> > >
> > > I'm not at all sure why this would have caused a conflict with the
> > compiler,
> > > since it wasn't a classbut at least I've resolved the issue.
> > >
> > > On Thu, Jul 1, 2010 at 7:57 AM, valdhor  wrote:
> > >
> > > >
> > > >
> > > > One other thing to check. Make sure you are not using a reserved name
> > for
> > > > your component.
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com 
> > > >  > 40yahoogroups.com>,
> >
> > > > "turbo_vb"  wrote:
> > > > >
> > > > > A couple things that you can check that might help:
> > > > >
> > > > > • Make sure that you have an import statement for the component in
> > the
> > > > parent class.
> > > > > • If your component is an AS class, make sure that the package, at
> > the
> > > > top of the class, is correct.
> > > > > • If your component is an AS component make sure that the class name,
> > > > within the component, is correct. If you are using a constructor check
> > that
> > > > too.
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In flexcoders@yahoogroups.com 
> > > > >  > 40yahoogroups.com>, "Brian
> >
> > > > J. Ackermann"  wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I'm a wee bit stuck on this, and was hoping you might have some
> > input
> > > > to
> > > > > > help me.
> > > > > >
> > > > > > I'm getting the "Could not resolve * to a component
> > implementation."
> > > > error
> > > > > > message. However, everything I've read about this via Google hasn't
> > > > helped
> > > > > > my case in the slightest. I presume I'm just missing something
> > obvious,
> > > > but
> > > > > > maybe its something more serious.
> > > > > >
> > > > > > So, to solve this problem, I've tried two things, and both work, as
> > far
> > > > as
> > > > > > they take me. First, I added a new component, of the exact same
> > > > variety,
> > > > > > and then copied the contents of the erroring component into it. I
> > > > replace
> > > > > > the viewstack 'page' with the new component (which as near as I can
> > > > tell is
> > > > > > IDENTICAL, but with a different name), and the compiler error goes
> > > > away.
> > > > > >
> > > > > > I can also solve this by simply renaming the original component &
> > > > letting
> > > > > > FB4 refactor for me. The error goes away again. But if I then
> > re-rename
> > > > > > back to the original name, I get the compiler error again.
> > > > > >
> > > > > > I've tried to clean the project several times, and that doesn't
> > help.
> > > > > >
> > > > > > I'd really like to understand what I've done wrong here. What am I
> > > > missing?
> > > > > >
> > > > > > Thanks much!
> > > > > >
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> >  
> >
>




[flexcoders] Re: Button with tooltip but no overskin

2010-07-22 Thread turbo_vb
Probably no more elegant, but an alternative:

package

{

import mx.controls.Button;

import mx.core.mx_internal;




use namespace mx_internal;




public class DeadButton extends Button

{

public function DeadButton()

{

super();




mx_internal::overSkinName = "upSkin";

}

}

}




-TH



--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> I should have noted that this is for Flex 3.
>
> I created a subclass of ButtonSkin which overrides name() to return
"upSkin".
>
> If anyone has a more elegant solution please let me know.
>
> On Thu, Jul 22, 2010 at 12:35 PM, Richard Rodseth rrods...@... wrote:
> > Is there a simple way to set up a button so that it's appearance
> > doesn't change on rollOver, but the tooltip does appear?
> >
> > I am simulating a menu bar of sorts using a horizontal layout of
> > PopUpButtons and Buttons. The Buttons are just filler that need to
> > follow the style of the others, but have no associated action. But
> > some have meaningful labels and tooltips.
> >
> > In other words, I need to create a "dead" button with the same style
> > as others, and a tooltip.
> >
>



[flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread turbo_vb
Yeah, the cool thing about Swiz, is that this would only add 2 lines of code. 
:-)

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> Haven't looked at Swiz yet, but as I mentioned, I can certainly announce an
> event in the faultHandler and inject a listener for it in the PM.
> 
> On Fri, Jul 2, 2010 at 3:36 PM, turbo_vb  wrote:
> 
> >
> >
> > I agree, but it can; since the map knows about the PM anyway. This is where
> > Swiz has an advantage with the Mediate metadata. In that case the PM method
> > can just listens for an event; which can be dispatched on fault.
> >
> > -TH
> >
> >
> > --- In flexcoders@yahoogroups.com , Richard
> > Rodseth  wrote:
> > >
> > > The map shouldn't interact with the PM (other than building it with
> > > ObjectBuilder and injecting it into the view).
> > > I'm leaning towards a). That way it's centralized and manager properties
> > can
> > > potentially be injected into multiple presentation models.
> > >
> > >
> > >
> > >
> > > On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb  wrote:
> > >
> > > >
> > > >
> > > > I usually use (b). For the error, you can call a public method in the
> > PM
> > > > from the faultHandler in the map; as one alternative.
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com 
> > > >  > 40yahoogroups.com>, Richard
> >
> > > > Rodseth  wrote:
> > > > >
> > > > > Design question for any other Mate users out there. Will cross-post
> > to
> > > > Mate
> > > > > forum.
> > > > >
> > > > > I use Mate with the Manager + Presentation Model pattern.
> > > > > i.e. presentation model dispatches bubbling events. Mate event map
> > > > invokes
> > > > > services calls, sets result on manager. Properties are injected from
> > > > manager
> > > > > to presentation model.
> > > > >
> > > > > I find it very convenient to have a "data status" property in the
> > > > > presentation model for each service call, with values NOT_CURRENT,
> > > > LOADING,
> > > > > LOADED and ERROR. Then the view can display appropriate status and
> > > > progress
> > > > > indicators based on this property.
> > > > >
> > > > > One approach (a) is to have the event map set the status on the
> > manager
> > > > and
> > > > > have the map inject that status into the presentation model.
> > > > >
> > > > > Another (b) is to set the status in the presentation model just
> > before
> > > > > dispatching the event, and when receiving the result (i.e. in a
> > custom
> > > > > setter).
> > > > >
> > > > > I like the directness of (b), but it doesn't cover the error case
> > unless
> > > > the
> > > > > manager also has something like a faultevent property that also gets
> > > > > injected into the presentation model.
> > > > >
> > > > > A third approach (c) would use listener injectors. The map would
> > inject a
> > > > > listener into the presentation model and would announce a special
> > failure
> > > > > event.
> > > > >
> > > > > Thoughts?
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> >  
> >
>




[flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread turbo_vb
Another alternative would be to extend ArrayCollection, or whatever collection 
type desired, with a status property.

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> The map shouldn't interact with the PM (other than building it with
> ObjectBuilder and injecting it into the view).
> I'm leaning towards a). That way it's centralized and manager properties can
> potentially be injected into multiple presentation models.
> 
> 
> 
> 
> On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb  wrote:
> 
> >
> >
> > I usually use (b). For the error, you can call a public method in the PM
> > from the faultHandler in the map; as one alternative.
> >
> >
> > --- In flexcoders@yahoogroups.com , Richard
> > Rodseth  wrote:
> > >
> > > Design question for any other Mate users out there. Will cross-post to
> > Mate
> > > forum.
> > >
> > > I use Mate with the Manager + Presentation Model pattern.
> > > i.e. presentation model dispatches bubbling events. Mate event map
> > invokes
> > > services calls, sets result on manager. Properties are injected from
> > manager
> > > to presentation model.
> > >
> > > I find it very convenient to have a "data status" property in the
> > > presentation model for each service call, with values NOT_CURRENT,
> > LOADING,
> > > LOADED and ERROR. Then the view can display appropriate status and
> > progress
> > > indicators based on this property.
> > >
> > > One approach (a) is to have the event map set the status on the manager
> > and
> > > have the map inject that status into the presentation model.
> > >
> > > Another (b) is to set the status in the presentation model just before
> > > dispatching the event, and when receiving the result (i.e. in a custom
> > > setter).
> > >
> > > I like the directness of (b), but it doesn't cover the error case unless
> > the
> > > manager also has something like a faultevent property that also gets
> > > injected into the presentation model.
> > >
> > > A third approach (c) would use listener injectors. The map would inject a
> > > listener into the presentation model and would announce a special failure
> > > event.
> > >
> > > Thoughts?
> > >
> >
> >  
> >
>




[flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread turbo_vb
I agree, but it can; since the map knows about the PM anyway.  This is where 
Swiz has an advantage with the Mediate metadata.  In that case the PM method 
can just listens for an event; which can be dispatched on fault.

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> The map shouldn't interact with the PM (other than building it with
> ObjectBuilder and injecting it into the view).
> I'm leaning towards a). That way it's centralized and manager properties can
> potentially be injected into multiple presentation models.
> 
> 
> 
> 
> On Fri, Jul 2, 2010 at 1:56 PM, turbo_vb  wrote:
> 
> >
> >
> > I usually use (b). For the error, you can call a public method in the PM
> > from the faultHandler in the map; as one alternative.
> >
> >
> > --- In flexcoders@yahoogroups.com , Richard
> > Rodseth  wrote:
> > >
> > > Design question for any other Mate users out there. Will cross-post to
> > Mate
> > > forum.
> > >
> > > I use Mate with the Manager + Presentation Model pattern.
> > > i.e. presentation model dispatches bubbling events. Mate event map
> > invokes
> > > services calls, sets result on manager. Properties are injected from
> > manager
> > > to presentation model.
> > >
> > > I find it very convenient to have a "data status" property in the
> > > presentation model for each service call, with values NOT_CURRENT,
> > LOADING,
> > > LOADED and ERROR. Then the view can display appropriate status and
> > progress
> > > indicators based on this property.
> > >
> > > One approach (a) is to have the event map set the status on the manager
> > and
> > > have the map inject that status into the presentation model.
> > >
> > > Another (b) is to set the status in the presentation model just before
> > > dispatching the event, and when receiving the result (i.e. in a custom
> > > setter).
> > >
> > > I like the directness of (b), but it doesn't cover the error case unless
> > the
> > > manager also has something like a faultevent property that also gets
> > > injected into the presentation model.
> > >
> > > A third approach (c) would use listener injectors. The map would inject a
> > > listener into the presentation model and would announce a special failure
> > > event.
> > >
> > > Thoughts?
> > >
> >
> >  
> >
>




[flexcoders] Re: Mate: listener injector vs manager/PM binding

2010-07-02 Thread turbo_vb
I usually use (b).  For the error, you can call a public method in the PM from 
the faultHandler in the map; as one alternative.

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> Design question for any other Mate users out there. Will cross-post to Mate
> forum.
> 
> I use Mate with the Manager + Presentation Model pattern.
> i.e. presentation model dispatches bubbling events. Mate event map invokes
> services calls, sets result on manager. Properties are injected from manager
> to presentation model.
> 
> I find it very convenient to have a "data status" property in the
> presentation model for each service call, with values NOT_CURRENT, LOADING,
> LOADED and ERROR. Then the view can display appropriate status and progress
> indicators based on this property.
> 
> One approach (a) is to have the event map set the status on the manager and
> have the map inject that status into the presentation model.
> 
> Another (b) is to set the status in the presentation model just before
> dispatching the event, and when receiving the result (i.e. in a custom
> setter).
> 
> I like the directness of (b), but it doesn't cover the error case unless the
> manager also has something like a faultevent property that also gets
> injected into the presentation model.
> 
> A third approach (c) would use listener injectors. The map would inject a
> listener into the presentation model and would announce a special failure
> event.
> 
> Thoughts?
>




[flexcoders] Re: Could not resolve * to a component implementation.

2010-07-01 Thread turbo_vb
Glad that you were able to resolve the problem.  The AS file IS a class, and if 
it lives in the same package as the mxml component, the compiler will balk; 
because it doesn't know which one to import elsewhere.  Adobe best practice 
would have you use Uppercase for the first letter of all classes.  Renaming the 
script class to something like FooScript.as or FooModel.as might be a better 
way to go.

Cheers,
-TH

--- In flexcoders@yahoogroups.com, "Brian J. Ackermann"  
wrote:
>
> Here's what the problem was.
> 
> I had originally had a file called "Foo.mxml" which contained a lot of
> ActionScript Code.  I decided to create a new ActionScript FILE to contain
> that script code.  I named the file "Foo.as", to indicate the correlation
> with the mxml file.
> 
> Renaming this new as file to "foo.as" (lowercase f), resolves the issue.
> 
> I'm not at all sure why this would have caused a conflict with the compiler,
> since it wasn't a classbut at least I've resolved the issue.
> 
> On Thu, Jul 1, 2010 at 7:57 AM, valdhor  wrote:
> 
> >
> >
> > One other thing to check. Make sure you are not using a reserved name for
> > your component.
> >
> >
> > --- In flexcoders@yahoogroups.com ,
> > "turbo_vb"  wrote:
> > >
> > > A couple things that you can check that might help:
> > >
> > > • Make sure that you have an import statement for the component in the
> > parent class.
> > > • If your component is an AS class, make sure that the package, at the
> > top of the class, is correct.
> > > • If your component is an AS component make sure that the class name,
> > within the component, is correct. If you are using a constructor check that
> > too.
> > >
> > > -TH
> > >
> > > --- In flexcoders@yahoogroups.com , "Brian
> > J. Ackermann"  wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'm a wee bit stuck on this, and was hoping you might have some input
> > to
> > > > help me.
> > > >
> > > > I'm getting the "Could not resolve * to a component implementation."
> > error
> > > > message. However, everything I've read about this via Google hasn't
> > helped
> > > > my case in the slightest. I presume I'm just missing something obvious,
> > but
> > > > maybe its something more serious.
> > > >
> > > > So, to solve this problem, I've tried two things, and both work, as far
> > as
> > > > they take me. First, I added a new component, of the exact same
> > variety,
> > > > and then copied the contents of the erroring component into it. I
> > replace
> > > > the viewstack 'page' with the new component (which as near as I can
> > tell is
> > > > IDENTICAL, but with a different name), and the compiler error goes
> > away.
> > > >
> > > > I can also solve this by simply renaming the original component &
> > letting
> > > > FB4 refactor for me. The error goes away again. But if I then re-rename
> > > > back to the original name, I get the compiler error again.
> > > >
> > > > I've tried to clean the project several times, and that doesn't help.
> > > >
> > > > I'd really like to understand what I've done wrong here. What am I
> > missing?
> > > >
> > > > Thanks much!
> > > >
> > >
> >
> >  
> >
>




[flexcoders] Re: Could not resolve * to a component implementation.

2010-06-30 Thread turbo_vb
A couple things that you can check that might help:

•   Make sure that you have an import statement for the component 
in the parent class.
•   If your component is an AS class, make sure that the package, 
at the top of the class, is correct.
•   If your component is an AS component make sure that the class 
name, within the component, is correct.  If you are using a constructor check 
that too.

-TH

--- In flexcoders@yahoogroups.com, "Brian J. Ackermann"  
wrote:
>
> Hi,
> 
> I'm a wee bit stuck on this, and was hoping you might have some input to
> help me.
> 
> I'm getting the "Could not resolve * to a component implementation." error
> message.  However, everything I've read about this via Google hasn't helped
> my case in the slightest.  I presume I'm just missing something obvious, but
> maybe its something more serious.
> 
> So, to solve this problem, I've tried two things, and both work, as far as
> they take me.  First, I added a new component, of the exact same variety,
> and then copied the contents of the erroring component into it.  I replace
> the viewstack 'page' with the new component (which as near as I can tell is
> IDENTICAL, but with a different name), and the compiler error goes away.
> 
> I can also solve this by simply renaming the original component & letting
> FB4 refactor for me.  The error goes away again.  But if I then re-rename
> back to the original name, I get the compiler error again.
> 
> I've tried to clean the project several times, and that doesn't help.
> 
> I'd really like to understand what I've done wrong here.  What am I missing?
> 
> Thanks much!
>




[flexcoders] Re: Pass two arraycollections to one component

2010-06-29 Thread turbo_vb
Have you tried just one instance of the component?



-TH

--- In flexcoders@yahoogroups.com, "Liam"  wrote:
>
> I need to pass two separate arraycollections to one component. I'm sure this 
> is possible but I can't find anything online as to how to do this.
> 
> I thought I could do this but it only displays the last arraycollection:
> 
> From main application:
> 
> 
> 
> With such little information, any suggestions?  Can I do this?
> 
> Thanks,
> Liam
>




[flexcoders] Re: Yes/No RadioButton

2010-06-11 Thread turbo_vb
Well. it's pretty clear that the answer can only be yes or no in this case, so 
use a RadioButtonGroup for the two RadioButtons.

-TH

--- In flexcoders@yahoogroups.com, "jossminker"  wrote:
>
> Can you clarify? Do you mean you ahve two radio buttons one for no and one 
> for yes?
> In which case the mode of operation the user would expect is to deselect YES 
> by selecting NO instead.
> If it is a button which if selected denotes yes and if not selected denotes 
> No then you should be using checkboxes instead.
> 
> However, if you wish it to be possible for the user to deselect Yes and thus 
> leave neither control selected you can either- change your interface to use a 
> 3rd option NEITHER or you use the YES buttons click event handler to switch 
> teh buttons selected property.
> 
> This will however, leave the user with IMO a potentially confusing interface. 
> 
> hth
> joss
> 
> --- In flexcoders@yahoogroups.com, "Christophe"  wrote:
> >
> > Hello, 
> > 
> > I have two radio buttons: Yes and No.
> > 
> > At the beginning they are unchecked. Then I press on Yes to select Yes. 
> > 
> > How to desactivate Yes, if we click a second successive time on Yes.
> > 
> > Thank you,
> > Christophe,
> >
>




[flexcoders] Re: dispatchEvent import

2010-06-08 Thread turbo_vb
Actually, you weren't wrong.  It seems that if you use [Bindable], the compiler 
will allow dispatchEvent() in any class; in a black-box manner.

-TH

--- In flexcoders@yahoogroups.com, "valdhor"  wrote:
>
> Ooops, my bad.
> 
> I didn't look at the example extensively and didn't note which component he 
> was trying to use.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Hey Steve,
> > 
> > The component that Marco is referring to is not a UIComponent, so it 
> > doesn't have a dispatchEvent() method.  He'll have to change thel class to 
> > extend EventDispatcher.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "valdhor"  wrote:
> > >
> > > The component itself has a dispatchEvent method. The this keyword is 
> > > implicit in the call. It could have been written as this.dispatchEvent.
> > > 
> > > --- In flexcoders@yahoogroups.com, Marco Catunda  wrote:
> > > >
> > > > Hi,
> > > > 
> > > > I'm learning swiz framework and stumble upon this code 
> > > > http://www.pastebin.org/307313
> > > > at 
> > > > http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html
> > > >  
> > > > 
> > > > My question is how could flex compiler understand the 'dispatchEvent' 
> > > > method in
> > > > line 41 and 65? I haven't seen any explicit import of it.
> > > > 
> > > > Cheers
> > > > 
> > > > --
> > > > Marco Catunda
> > > >
> > >
> >
>




[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
The example does compile and the binding works; even when you remove the 
injected dispatcher.  Kind of stumped on why this works in a class that doesn't 
extend EventDispatcher.

-TH

--- In flexcoders@yahoogroups.com, Oleg Sivokon  wrote:
>
> If it ever worked that may be because of the patched compiler /
> preprocessor, and so all dispatchEvent calls were translated to what is
> marked as [Dispatcher]. Maybe it does the same as [Bindable] on class, or
> maybe like HaXe "using" directive. Otherwise - just a confusing piece of
> code... Well, you know, so far the only reasonable place to put metadata in
> AS3 was __go_to_definitionHelp, and that you don't have to write... :S
>




[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
Hey Steve,

The component that Marco is referring to is not a UIComponent, so it doesn't 
have a dispatchEvent() method.  He'll have to change thel class to extend 
EventDispatcher.

-TH

--- In flexcoders@yahoogroups.com, "valdhor"  wrote:
>
> The component itself has a dispatchEvent method. The this keyword is implicit 
> in the call. It could have been written as this.dispatchEvent.
> 
> --- In flexcoders@yahoogroups.com, Marco Catunda  wrote:
> >
> > Hi,
> > 
> > I'm learning swiz framework and stumble upon this code 
> > http://www.pastebin.org/307313
> > at 
> > http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.html 
> > 
> > My question is how could flex compiler understand the 'dispatchEvent' 
> > method in
> > line 41 and 65? I haven't seen any explicit import of it.
> > 
> > Cheers
> > 
> > --
> > Marco Catunda
> >
>




[flexcoders] Re: dispatchEvent import

2010-06-04 Thread turbo_vb
Hi Marco,
That does look like a problem.  The dispatchEvent() method is available
for any UIComponent subclass or any class that extends EventDispatcher. 
So, if you're going to use [Bindable] properties in the presentation
model, you would want to have the PM extend EventDispatcher:

import flash.events.EventDispatcher;




public class UserPresentationModel extends EventDispatcher

{

private var _currentState : String;





[Bindable( "currentStateChanged" )]

public function get currentState() : String

{

return _currentState;

}




public function set currentState( state : String ) : void

{

_currentState = state;

dispatchEvent( new Event( "currentStateChanged" ) );

}


}

This will allow you to bind the property to a view.
For events that you want to [Mediate], you would use the injected
dispatcher:

[Dispatcher]

public var dispatcher:IEventDispatcher;




dispatcher.dispatchEvent( new Event( "myEvent" ) );




-TH

--- In flexcoders@yahoogroups.com, Marco Catunda 
wrote:
>
> Hi,
>
> I'm learning swiz framework and stumble upon this code
http://www.pastebin.org/307313
> at
http://www.briankotek.com/blog/files/swiz_10_rc_example/srcview/index.ht\
ml
>
> My question is how could flex compiler understand the 'dispatchEvent'
method in
> line 41 and 65? I haven't seen any explicit import of it.
>
> Cheers
>
> --
> Marco Catunda
>



[flexcoders] Re: Setting UI components in a composite component to private?

2010-05-27 Thread turbo_vb
Hi Nick,

The best option is to create your composite components in Action Script.  This 
gives you direct control over the scope of the children, and they can be 
referenced within the component by the name of the var.  For MXML composite 
components, if you don't give the children id's, they won't be public.  This 
can be tricky if you're used to referencing the children inside the component 
by their id's, but you can usually rework logic like that to rely on events, 
like click and change, instead of references; since events have a reference to 
the target or currentTarget.

-TH

--- In flexcoders@yahoogroups.com, Nick Middleweek  wrote:
>
> Hi,
> 
> When we create a composite component, such as an itemRenderer, based on an
> HBox and there's a button and TextInput inside, those sub-components are
> public, is there a way to specify they're private?
> 
> 
> Thanks,
> Nick
> 
> -- 
> Sent by Nick Middleweek ( { email: n...@..., blog:
> http://blog.middleweek.co.uk } );
>




[flexcoders] Re: TabNavigator

2010-05-21 Thread turbo_vb
Yeah, see the last post.  You could extend TabNavigator and bubble up the 
tabBar itemClick event.  Not too difficult, but not out of the box.

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> You might mean "click", in which case yes. It is dispatched when clicking
> with the content area of the navigator, but not on the button bar.
> And it wouldn't cover keyboard navigation.
> 
> On Fri, May 21, 2010 at 1:06 PM, turbo_vb  wrote:
> 
> >
> >
> > You try itemClick?
> >
> > -TH
> >
> >
> > --- In flexcoders@yahoogroups.com , Richard
> > Rodseth  wrote:
> > >
> > > Is there an event dispatched by TabNavigator when the *user* switches
> > tabs?
> > >
> > > "change" is dispatched when the selected change happens
> > > programmatically (eg. because selectedChild is bound).
> > >
> >
> >  
> >
>




[flexcoders] Re: TabNavigator

2010-05-21 Thread turbo_vb
Strike that first response; no itemClick event there.  But, the protected var 
tabBar does dispatch itemClick, so...

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> Is there an event dispatched by TabNavigator when the *user* switches tabs?
> 
> "change" is dispatched when the selected change happens
> programmatically (eg. because selectedChild is bound).
>




[flexcoders] Re: TabNavigator

2010-05-21 Thread turbo_vb
You try itemClick?

-TH

--- In flexcoders@yahoogroups.com, Richard Rodseth  wrote:
>
> Is there an event dispatched by TabNavigator when the *user* switches tabs?
> 
> "change" is dispatched when the selected change happens
> programmatically (eg. because selectedChild is bound).
>




[flexcoders] QTP Automation and Custom Flex CheckBox itemRenderer

2010-05-14 Thread turbo_vb
Using QTP 10 and SDK 3.5 and having a tough time figuring out how to record and 
play back the "click" event of a extended CheckBox itemRenderer in an extended 
DataGrid component.  I've tried different combinations of custom automation 
delegates and class definitions file properties, for the itemRenderer and the 
DataGrid, but haven't found a solution yet.  Other custom components have been 
instrumented successfully, but no love for the itemRenderers. Anyone else run 
into this problem?

Thanks ahead,
-TH



[flexcoders] Re: Deleting row datagrid | Itemrenderer shows incorrect data

2010-05-14 Thread turbo_vb
http://blogs.adobe.com/aharui/item_renderers/
<http://blogs.adobe.com/aharui/item_renderers/>

-TH
--- In flexcoders@yahoogroups.com, "ilikeflex"  wrote:
>
> Hi
>
> You are right that renderer is being recycled. If you have notice that
i am using inline custom item renderer. Secondly, i do hot have property
in the dataprovider which is attached to checkbox. So how can i stop
itemrenderer to be recycled.
>
> Thanks
> ilikeflex
>
> --- In flexcoders@yahoogroups.com, "turbo_vb" TimHoff@ wrote:
> >
> > Your CheckBox itemRenderer is getting recycled after the delete. 
Use a
> > custom itemRenderer for the CheckBox.
> > http://blogs.adobe.com/aharui/item_renderers/
> > <http://blogs.adobe.com/aharui/item_renderers/>
> > -TH
> > --- In flexcoders@yahoogroups.com, "ilikeflex"  wrote:
> > >
> > > Hi
> > >
> > > I want to remove the row of datagrid. In one of the columns i have
> > checkbox as item renderer.I select checkbox and i delete the row.But
the
> > challenge, i am facing is that when i remove the row from datagrid,
the
> > next row's checkbox becomes selected which i do not want. How can i
> > avoid this?? Please see the test case below.
> > >
> > > Any pointers are highly appreciated.
> > >
> > > Thanks
> > > ilikeflex
> > >
> > > I have a sample test case
> > > 
> > > http://www.adobe.com/2006/mxml";>
> > >  
> > >   
> > >  
> > >   > >  dataProvider="{xc}">
> > >   
> > > > >   dataField="item">
> > > 
> > >  
> > >   
> > >  
> > > 
> > >
> > >
> > > 
> > >  
> > >> >   click="outerDocument.deleteItem(event)"/>
> > >  
> > > 
> > >
> > >   
> > >  
> > > 
> > >
> >
>



[flexcoders] Re: Deleting row datagrid | Itemrenderer shows incorrect data

2010-05-13 Thread turbo_vb
Your CheckBox itemRenderer is getting recycled after the delete.  Use a
custom itemRenderer for the CheckBox.
http://blogs.adobe.com/aharui/item_renderers/

-TH
--- In flexcoders@yahoogroups.com, "ilikeflex"  wrote:
>
> Hi
>
> I want to remove the row of datagrid. In one of the columns i have
checkbox as item renderer.I select checkbox and i delete the row.But the
challenge, i am facing is that when i remove the row from datagrid, the
next row's checkbox becomes selected which i do not want. How can i
avoid this?? Please see the test case below.
>
> Any pointers are highly appreciated.
>
> Thanks
> ilikeflex
>
> I have a sample test case
> 
> http://www.adobe.com/2006/mxml";>
>  
>   
>  
>dataProvider="{xc}">
>   
>   dataField="item">
> 
>  
>   
>  
> 
>
>
> 
>  
>  click="outerDocument.deleteItem(event)"/>
>  
> 
>
>   
>  
> 
>



[flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-04-29 Thread turbo_vb
I thought that this response showed the kind of class that we've come to
expect from Adobe.
http://blogs.adobe.com/conversations/2010/04/moving_forward.html


-TH
--- In flexcoders@yahoogroups.com, Oleg Sivokon  wrote:
>
> I've got this same link from my friend, and it's funny how it serves
the
> facts... well, flash was in fact the first to use h.264 codec for
video on
> the web (could be that some other existed before, but the HTML5 wasn't
the
> first, that's for sure), and it does use hardware rendering to display
that
> on Windows. It is true it uses pure CPU rendering on Macs and both
sides
> blame it on poor cooperation of the other side. I think, maybe one
valid
> point that he makes is that Adobe didn't invest to much into mobile
market
> until very recently... and, to be honest, flash rendering may be more
> optimized... like using platform available graphics tools - be it
DirectX or
> OpenGL. It is also true that flash is kind of stuck in it's
development...
> well, the language hadn't seen any significant change in years...
> But I don't think that what Apple cares about is how flash performs...
not
> is it at all familiar with the situation around the product... For
example I
> have Adobe tools to develop for flash on my Windows installation, but
on
> Linux I have only non-Adobe tools, which is more by accident, but,
anyway,
> this kind of contradicts what he says about non openess of the
platform.
>
> I also think that the main profit from banning other popular
development
> tools like .NET and Java from Macs Apple may hope for good revenues
from
> selling their development tools... Think about that due to iProducts
> popularity the popularity of Obj-C grew a lot. It was a marginal
language in
> terms of penetration until iPhone... So, they may hope to build a
community
> of developers, who would develop in this language and thus became
dependent
> on Apple's tools and the entire ecosystem... well, just like there's a
lot
> of C# programmers in the world, not because it's the best language
ever, but
> because of the demand.
>
> I think that Mac world sees the surrounding world from the
entrenchment
> level, it's like "after all those years!" they are going to win one
> marketing war. They won't think about that their "victory" may turn
into
> much larger loss on a general scale. Like, what good will come out of
> promoting obsolete technologies like HTML and JavaScript? And that's
after
> it's been proven many times that the disadvantages are inherent to the
> technology and it is probably seeing it's last years... Well, for me
going
> back to making web apps in HTML and JavaScript would be like dark ages
> comparing to any technology, not necessarily Flash, that offers
compiled
> language and better integration with the native API...
>
> There may be to many marketing factors involved, of which I have
little
> knowledge... and this may sound out of place... but, what would be if
Abobe
> have cooperated with projects like HaXe and GNash? Or, offer to
download the
> SWFTools' AS3 compiler along with Flex / Flash Builder? Or, at least
bring
> their existence to the public attention somehow.
> What I'm saying is, this will not be a turning point in this pure
battle of
> commercial interests, but, maybe it's a good time to put the plans of
world
> domination aside and invest a bit more in the technical aspect of
things?
>



[flexcoders] Re: How to get rid space between lines?

2010-04-29 Thread turbo_vb
Uh, verticalGap="-4".

-TH

--- In flexcoders@yahoogroups.com, "markflex2007"  wrote:
>
> Hi,
> 
> I use Flex builder 3. I have following simple code
> 
>   
>
> 
> 
>
>  
> 
> but there are space between lines.
> 
> I want to make the line close,How to get rid space between lines?
> 
> Please help me.
> 
> Thanks
> 
> Mark
>




[flexcoders] Re: How to find the Value of a Property in the Last Object of An Array Collectio

2010-04-23 Thread turbo_vb
If you keep the id's in sync with the index values of the ArrayCollection you 
can just use:

linksFullAC.addItem({linkid:linksFullAC.length, label:userenteredlabel.text});

-TH

--- In flexcoders@yahoogroups.com, "James"  wrote:
>
> I want to allow my users to add their own values to my array collection 
> 'linksFullAC' using the following code which gets fired when they click a 
> button:-
> 
> linksFullAC.addItem({linkid:?, label:userenteredlabel.text})
>  
> Except I want the link id value to autoincrement so that each time they add 
> an item it is the value of the highest linkid in the array collection +1. For 
> example if the highest linkid in the array collection is 53 and the user 
> clicks this button the new link would be assigned a value of 54 for the 
> linkid. Can anyone please help me out on the code I'd use to do this?
>




[flexcoders] Re: Useless error from Adobe. Any hints?

2010-04-19 Thread turbo_vb
You can use reflexUtil to do what Alex describes:

http://code.google.com/p/reflexutil/

-TH

--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> If AppHolder is height = 0, then the rect might draw from y=0 to y=-2 or 
> something like that.   I use FDB for my debugging so I can always examine 
> objects on the stack and see which one it is and what its properties are.  
> I'm not sure how to do that with the debugger in FlexBuilder.
> 
> 
> On 4/19/10 10:59 AM, "Wally Kolcz"  wrote:
> 
> 
> 
> 
> 
> 
> AppHolder is the id of a s:Group that is set to 100% / 100%. What constaints? 
> I only have it set to be 2 pixels from the bottom and 5 pixels from the left.
> 
> On 4/19/2010 1:42 PM, Alex Harui wrote:
> 
> 
> 
> What is appHolder? If it gets layed out too small, the constraints you set
> might force a negative height.
> 
> On 4/19/10 10:17 AM, "Wally Kolcz"   > wrote:
> 
> > Here is the bugger. Ok, now I know what the issue is, no idea which
> > parameter is invalid and how to fix it. Guess I need to reread up on how
> > to create a spark button in AS...
> >
> > var back_btn:spark.components.Button = new spark.components.Button()
> > back_btn.label = "Back";
> > back_btn.addEventListener(MouseEvent.CLICK, backToNav);
> > appHolder.addElement(back_btn);
> > back_btn.setStyle("bottom", 2);
> > back_btn.setStyle("left", 5)
> >
> >
> >
> > 
> >
> > --
> > 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-1e6207
> > 9f6847
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links
> >
> >
> >
> 
> 
> --
> Alex Harui
> Flex SDK Team
> Adobe System, Inc.
> http://blogs.adobe.com/aharui
>




[flexcoders] Flex 4 State Names and Binding

2010-04-14 Thread turbo_vb
Hi All,

Unlike Flex 3, it seems that Flex 4 doesn't allow state names to be bound to 
constants anymore.  An example that no longer works would be something like 
this:



While I appreciate the improvements that have been made to Flex 4 states, this 
can be a problem for MVC oriented navigation frameworks.  Just wondering what 
the rational was for making this change.

Thanks,
-TH



[flexcoders] Re: Positioning / Scrolling problem with Flex popup

2010-04-09 Thread turbo_vb
You'll want to create a method that does something like this:

var target:Point = localToGlobal( new Point( hbox.x, hbox.y ) );
popup.move( target.x, target.y );

Call the method after you add the popup and when the container is scrolled.  In 
some cases localToContent is more appropriate.

-TH

--- In flexcoders@yahoogroups.com, "s_grollins"  wrote:
>
> Hi all,
> 
> I'm trying to work out a specific problem I'm having with positioning in Flex 
> using the PopUpManager. Basically I'm wanting to create a popup which will 
> scroll with the parent container - this is necessary because the parent 
> container is large and if the user's browser window isn't large enough (this 
> will be the case the majority of the time) - they will have to use the 
> scrollbar of the container to scroll down. The problem is that the popup is 
> positioned relative to another component, and it needs to stay by that 
> component. (also sorry if the code below isn't formatted right, but I pasted 
> it right from Eclipse).
> 
> 
> http://www.adobe.com/2006/mxml"; layout="absolute">
> 
>   
> 
>   
> 
>   
> 
>   
> 
> 
>




[flexcoders] Re: A Viewstack but not with Canvases

2010-04-09 Thread turbo_vb
Hi Leonardo,

ViewStack requires its children to be a Container, or subclass of Container.  
Box, HBox and VBox all extend Container and should work just fine.  Besides, 
you're talking about adding a sibling to your current app.  So, you could wrap 
the code for your current app into any Container; the children don't matter.

-TH

--- In flexcoders@yahoogroups.com, Leonardo Camargo  wrote:
>
> Hi,
> 
> I have a complex flex app I've been building for months, most of the
> containers are Boxes,VBoxes, HBoxes.. now I need to have two layers: my
> current app(1st layer), and a videodisplay that will take the whole
> space(2nd layer). That would be easily done(I assume) if both of my layers
> were Canvas and I used a Viewstack to switch between them. But apparently
> the Viewstack won't work properly with Boxes...
> 
> Assuming you guys got my problem, any ideas?
> 
> Best regards,
> Leonardo C.
>




[flexcoders] Re: Handling dataProvider of ComboBox on another navigatorContent

2010-04-05 Thread turbo_vb
An easier approach than using these events, is to bind the ComboBox 
selectedIndex property to a variable like: [Bindable] public var 
myComboBoxSelectedIndex : int; that lives in the same class as the data array.  
When you get or initialize the array, set the variable to the desired value, 
and the binding will automatically display the correct item in the ComboBox.  
This way, you don't have to worry about timing.  If the ComboBox exists, when 
the variable changes, the selectedItem will change then.  If the ComboBox 
doesn't exists when you set the variable, when the ComboBox is instantiated the 
binding will kick in then. 

-TH

--- In flexcoders@yahoogroups.com, "Ivan"  wrote:
>
> I have TabNavigator component with two navigatorContent components.
> At the beginning I'm focused on first tab and on another tab I have combobox.
> 
> ComboBox uses Array data provider that is populated with initialize event 
> handler on Application component.
> 
> When I click on first tab, I initialize event which goes on another tab and I 
> want my combobox to show specific item from ComboBox.
> 
> My problem is:
> In first attempt my combobox does not display desired option, but this thing 
> happens only if I hadn't displayed second tab. If I click first on the second 
> tab, then go back on first one and click on it to create desired event, 
> everything works just fine.
> 
> I tried to use creationPolicy on TabNavigator and NavigatorContent, but no 
> use.
> 
> Does anyone has any idea?
>




[flexcoders] Re: TextInput textAlign

2010-03-23 Thread turbo_vb
Just use paddingTop.

-TH

--- In flexcoders@yahoogroups.com, "chandruflex"  wrote:
>
> I am using Flex 3. Is it possible to align the text in the TextInput control 
> to be vertically centered?
>




[flexcoders] Re: Scale 9

2010-03-20 Thread turbo_vb
Scale 9 has nothing to do with the position of the image.  You would use the 
normal properties for that ( top, bottom, left, right ).  What scale 9 defines 
is the portion of the image to stretch when the dimensions of the image are 
changed to be bigger than the original image size.  So, if you look at the 
sample in your link, the blue rectangle in the very center is what will be 
stretched.  The rest of the image ( the fancy corners ) will remain unchanged.

-TH

--- In flexcoders@yahoogroups.com, "hgnowhg"  wrote:
>
> I'm very confused on using scale 9 to position images in flex. I am using 
> this link: 
> http://www.adobe.com/devnet/flex/quickstart/embedding_assets/#EmbeddingImagesScale9
> 
> They have a width of 266 and height of 55...I get where the 266 and 55 come 
> into play in the embed code:
> scaleGridTop="55", scaleGridBottom="137",  scaleGridLeft="57", 
> scaleGridRight="266"
> 
> But where do the 57 and 137 come from?
>




[flexcoders] Re: multicolor in single line chart

2010-03-18 Thread turbo_vb
This might give you some ideas:
http://www.timothyhoff.com/projects/LineRendererSample/LineRendererSampl\
e.html

-TH
--- In flexcoders@yahoogroups.com, Krunal Panchal 
wrote:
>
> Hi All,
>
> Is it possible to have multicolor in single line chart.
>
> Suppose i have line chart. there will be break point after that break
point my line color will be different.
>
> Thanks in advance.
>
> Regards,
>
> 
>
> Krunal Panchal | *panchal_...@...
>



[flexcoders] Re: ViewStack and CreationComplete...

2010-03-12 Thread turbo_vb
Hey Laurence,

When ViewStack children are instantiated the creationComplete event is 
dispatched, but not the show event.  So, if you navigate to the second 
ViewStack child, the first time, you'll only get creationComplete.  After that, 
when you navigate to the second child the show event will be dispatched; from 
the second child's top-level container.  Usually, if you need to do something 
regardless if its the first, or subsequent, times that you navigate to a child, 
you have to listen for both events.

-TH

--- In flexcoders@yahoogroups.com, "Laurence"  wrote:
>
> I replaced creationComplete="init();" with show="init();", but it never seems 
> to get called now...  So I guess either the show event isn't getting thrown, 
> or I'm not using it properly...
> 
> Any suggestions?
> 
> L.
> 
> 
> --- In flexcoders@yahoogroups.com, "valdhor"  wrote:
> >
> > As I understand it, yes.
> > 
> > CreationComplete will only fire once (When the component is first created). 
> > From then on you will need to monitor the show event if you need to make 
> > changes based on when the component is displayed.
> > 
> > --- In flexcoders@yahoogroups.com, "Laurence"  wrote:
> > >
> > > I have not.  "show" happens every time the child of the ViewStack shown, 
> > > I assume?  And no other times?  Sounds like that might work.
> > > 
> > > The first time you switch to that view, the CreationComplete event 
> > > happens, of course.  Does the Show event occur after CreationComplete is 
> > > done, or before?  I assume after, but I don't want to guess incorrectly.
> > > 
> > > Thanks,
> > > L.
> > > 
> > > 
> > > --- In flexcoders@yahoogroups.com, "valdhor"  wrote:
> > > >
> > > > Have you tried the show event?
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "Laurence"  wrote:
> > > > >
> > > > > I've been using a ViewStack to switch between views in my app...  The 
> > > > > first time you jump to a particular view, that view runs throws its 
> > > > > CreationComplete event, whereupon I have it running an init() 
> > > > > function.
> > > > > 
> > > > > The subsequent times you jump to that view, there is no 
> > > > > CreationComplete event, obviously...
> > > > > 
> > > > > So what I need is an event that happens every time you jump to that 
> > > > > view in the ViewStack...  So I can intialize the view properly on the 
> > > > > 2nd, 3rd, 4th, etc, time you jump to that view...
> > > > > 
> > > > > Any ideas?
> > > > > 
> > > > > Thanks,
> > > > > Laurence MacNeill
> > > > > Mableton, Georgia, USA
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: Partial LineSeries - is it possible?

2010-02-23 Thread turbo_vb
Hi Jeff,

Probably going to have to add mock data for the remaining months in the decade 
and then use a lineSegmentRenderer and itemRenderer to hide the lines/points 
that are in the future.

-TH

--- In flexcoders@yahoogroups.com, "Battershall, Jeff"  
wrote:
>
> I have a line chart with a DateTimeAxis that is stipulated to be about 750 
> pixels wide and it's used to display a decade's worth of data points.  
> However, in the current decade, there are only a couple month's worth of data 
> points.  As a result the line series takes up the entire chart's entire 
> available horizontal space.  What I'd LIKE to have happen is have the line 
> series only as wide as the data points require - kind of like a YTD graph.  
> See what I'm getting at?
> 
> Any charting experts available?  Eli?
> 
> Jeff Battershall
> Application Architect
> Dow Jones Indexes
> jeff.battersh...@...
> (609) 520-5637 (p)
> 
> (484) 477-9900 (c)
>




[flexcoders] Re: Twitter Feed Within An Air/Flex Application

2010-02-13 Thread turbo_vb
Polling the twitter service every 60 seconds (refresh) would be a way
that you could get updates semi-automatically.  You're not using RTMP,
so you're never going to be really live.   HTTPService calls are
asynchronous, so there isn't much overhead just listening to a Timer().
For extending the functionality, here's a couple links.
http://blogs.adobe.com/flexdoc/2009/03/simple_twitter_client_in_flex.htm
<http://blogs.adobe.com/flexdoc/2009/03/simple_twitter_client_in_flex.ht\
ml>  l http://apiwiki.twitter.com/Twitter-API-Documentation
<http://apiwiki.twitter.com/Twitter-API-Documentation>
-TH

--- In flexcoders@yahoogroups.com, "James" 
wrote:
>
> But is it possible within flex to have a feed that acts live such as
this i.e. it is constantly changing? I thought within flex you could
only load data upon some sort of event such as the click of a button?
>
> The user can refresh their tweets simply by clicking the load tweets
button again but may it be better to have a refresh function constantly
running and refreshing the feed every couple of seconds to keep it
essentially 'live'? I thought something like this would take up
memory/loading times though.
>
> The ability to post tweets to twitter from within an app does sound
like a great idea though. I wouldn't know where to start on this though.
Do you know of any examples on the net that show this being done that I
could implement into my own?
>
> Cheers for your help though. These are good ideas.
>
> --- In flexcoders@yahoogroups.com, "turbo_vb" TimHoff@ wrote:
> >
> > Hi James,
> >
> > If your application automatically displays new tweets, those created
after the initial load, than yes; that would be considered "live".  If
however its just taking a snapshot, then no.  A starting point would be
to "refresh" the tweets.  Having the ability to post tweets, and see
them instantly show up, would also make it more live.  Other ideas would
be IM, chat, or other real-time activities that involve the course; like
live test scoring, or something.
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "James" 
wrote:
> > >
> > > I've previously made an air application for my university course
and my tutor has suggested that I incorporate more "live data" into it.
One of the ways he suggested was to include a twitter feed. I have no
experience of using feeds within flex but I think I've managed to get
one in.
> > >
> > > How it works is when users type in their twitter id and click a
load button all of their tweets are displayed within a repeater
component. They can then click a save button to save their twitter id
and whenever they start the application in the future their tweets will
load into the repeater component automatically as long as their name has
been saved.
> > >
> > > This may seem like silly question but does what I've described
constitute a 'live twitter feed' which is what I've been asked to
include or am I missing something?
> > >
> >
>



[flexcoders] Re: Twitter Feed Within An Air/Flex Application

2010-02-13 Thread turbo_vb
Hi James,

If your application automatically displays new tweets, those created after the 
initial load, than yes; that would be considered "live".  If however its just 
taking a snapshot, then no.  A starting point would be to "refresh" the tweets. 
 Having the ability to post tweets, and see them instantly show up, would also 
make it more live.  Other ideas would be IM, chat, or other real-time 
activities that involve the course; like live test scoring, or something.

-TH

--- In flexcoders@yahoogroups.com, "James"  wrote:
>
> I've previously made an air application for my university course and my tutor 
> has suggested that I incorporate more "live data" into it. One of the ways he 
> suggested was to include a twitter feed. I have no experience of using feeds 
> within flex but I think I've managed to get one in.
> 
> How it works is when users type in their twitter id and click a load button 
> all of their tweets are displayed within a repeater component. They can then 
> click a save button to save their twitter id and whenever they start the 
> application in the future their tweets will load into the repeater component 
> automatically as long as their name has been saved.
> 
> This may seem like silly question but does what I've described constitute a 
> 'live twitter feed' which is what I've been asked to include or am I missing 
> something?
>




Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-12 Thread turbo_vb
If you don't have too many items in the dataProvider, you could create a second 
DataGrid, with the same DataProvider and itemRenderers, that does not have a 
height set and is not visible.  The second DataGrid would render all of the 
items in the dataProvider, because the height isn't set.  Then go about 
inspecting the itemRenderers like you proposed earlier; to get the data for 
your service call. Not the best solution, but this is an unusual use-case.

-TH

--- In flexcoders@yahoogroups.com, "Mike"  wrote:
>
> I need to post the displayed data to a server, complete with formatting.  The 
> dataProvider does not help much; I'd have to replicate the work that the 
> datagrid does in determining the properties displayed by each column, and 
> duplicate the job of the item renderers in order to extract the displayed 
> property of each column.
> 
> I see that itemRenderers can be created ad hoc, so it must be possible to 
> shove data into them and obtain the displayed values.
> 
> ... it is nice to get a response, and so quickly too :)
>




[flexcoders] Re: Custom GridLines

2010-02-05 Thread turbo_vb
Or to put the lines in back, use backgroundElements. -TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> Your best bet is to NOT show any default horizontal lines and then use 
> annotationElements to draw your 2 custom lines.
>  
> -TH
> 
> --- In flexcoders@yahoogroups.com, "lauraff_mu"  wrote:
> >
> > Hello!
> > 
> > I'm trying to make a chart (in Flex 3). I only want to show two horizontal 
> > gird lines instead of all the lines the chart displays. Is there any way to 
> > do that? I have already try with "horizontalChangeCount" but it doesn't 
> > work ok.
> > 
> > (Sorry about my English...)
> > Thanks in advance!
> >
>




[flexcoders] Re: Custom GridLines

2010-02-05 Thread turbo_vb
Your best bet is to NOT show any default horizontal lines and then use 
annotationElements to draw your 2 custom lines.
 
-TH

--- In flexcoders@yahoogroups.com, "lauraff_mu"  wrote:
>
> Hello!
> 
> I'm trying to make a chart (in Flex 3). I only want to show two horizontal 
> gird lines instead of all the lines the chart displays. Is there any way to 
> do that? I have already try with "horizontalChangeCount" but it doesn't work 
> ok.
> 
> (Sorry about my English...)
> Thanks in advance!
>




[flexcoders] Re: horizontalAlign Puzzling

2010-01-21 Thread turbo_vb
I think because horizontalAlign is a style, not a property.  Try setStyle();

-TH

--- In flexcoders@yahoogroups.com, "criptopus"  wrote:
>
> var boxArray:Array=new Array();
> var boxIdx:int=boxArray.length;
> boxArray.push(new Box());
> boxArray[boxIdx].percentWidth=100;
> 
> Why not...?
> 
> boxArray[boxIdx].horizontalAlign="center";
> 
> - Stephen
>




[flexcoders] Re: Resize and Save an Image

2010-01-21 Thread turbo_vb
If the image is in a container, you could capture a bitmap of the container 
component and save that:

import flash.display.Bitmap;
import flash.display.BitmapData;

import mx.core.UIComponent;
import mx.graphics.ImageSnapshot;

private function getSnapshotImage( component:UIComponent ):Bitmap
{
var bitmapData:BitmapData = ImageSnapshot.captureBitmapData( component 
);
var bitmap:Bitmap = new Bitmap( bitmapData );

return bitmap;
}

-TH

--- In flexcoders@yahoogroups.com, "s_hernandez01"  wrote:
>
> Hey does anyone know if it's possible to resize and image in flex and save it 
> to a mysql database so that I have say a 512x512 and a 60x60? If so, is there 
> a tutorial out on the web somewhere? This is just to avoid having to resize 
> it myself manually when I receive the 512x512.
>




[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-19 Thread turbo_vb
My pleasure Monette.

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> Tim,
> It works!!! Hooray!!! You Rock!!!
> Thank you so much for all your help.
> Monette
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Three time's a charm:
> > 
> > var series:LineSeries = LineSeries( o.element );
> > var seriesIndex:int;
> > 
> > for ( seriesIndex = 0; seriesIndex < myChart.series.length; seriesIndex++ )
> > {
> > var lineSeries:LineSeries = myChart.series[ seriesIndex ] as LineSeries;
> > 
> > if ( lineSeries == series )
> > {
> > break;
> > }
> > }
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > Cleaner:
> > > 
> > > private function dtFunction( o:HitData ):String
> > > {
> > >   var series:LineSeries = LineSeries( o.element ) as LineSeries;
> > >   var seriesIndex:int;
> > > 
> > >   for ( seriesIndex = 0; seriesIndex < myChart.series.length; 
> > > seriesIndex++ )
> > >   {
> > >   var lineSeries:LineSeries = myChart.series[ seriesIndex ] as 
> > > LineSeries;
> > > 
> > >   if ( lineSeries.displayName == series.displayName )
> > >   {
> > >   break;
> > >   }
> > >   }
> > > 
> > >   var s:String = "" + LineSeries( o.element ).displayName + "\n";
> > >   s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
> > >   s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> > > "\n";
> > >   s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> > > 
> > >   return s;
> > > }
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > So, maybe something like this:
> > > > 
> > > > private function dtFunction( o:HitData ):String
> > > > {
> > > > var series:LineSeries = LineSeries( o.element ) as LineSeries;
> > > > var seriesIndex:int;
> > > > 
> > > > for ( var a:int = 0; a < myChart.series.length; a++ )
> > > > {
> > > > var lineSeries:LineSeries = myChart.series[ a ] as 
> > > > LineSeries;
> > > > 
> > > > if ( lineSeries.displayName == series.displayName )
> > > > {
> > > > seriesIndex = a;
> > > > break;
> > > > }
> > > > }
> > > > 
> > > > var s:String = "" + LineSeries( o.element ).displayName + 
> > > > "\n";
> > > > s += "Books: " + LineSeriesItem( o.chartItem ).yValue + 
> > > > "\n";
> > > > s += "Book rate: " + o.item.session[ seriesIndex 
> > > > ].bookrate + "\n";
> > > > s += "Status: " + o.item.session[ seriesIndex ].status + 
> > > > "\n";
> > > > 
> > > > return s;
> > > > }
> > > > 
> > > > -TH
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > > Easy enough, create a dictionary (id or name) when the series's are 
> > > > > created; with the index.  And/Or you can get the count from 
> > > > > myChart.series.length.
> > > > > 
> > > > > -TH
> > > > > 
> > > > > --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> > > > > >
> > > > > > This will work.  However, the series count is not limited to just 
> > > > > > "3" series, it's count is dynamic depending on the amount of data 
> > > > > > collected.  So the code needs to check how many series exists and 
> > > > > > then generate the datatip for the different series data points.  It 
> > > > > > is easy for me to accomplish this in VB.NET or vbscript but I am 
> > > > > > just having problems accomplishing what I need in AS.
> > > > > > 
> > > > > 

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-18 Thread turbo_vb
Three time's a charm:

var series:LineSeries = LineSeries( o.element );
var seriesIndex:int;

for ( seriesIndex = 0; seriesIndex < myChart.series.length; seriesIndex++ )
{
var lineSeries:LineSeries = myChart.series[ seriesIndex ] as LineSeries;

if ( lineSeries == series )
{
break;
}
}

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> Cleaner:
> 
> private function dtFunction( o:HitData ):String
> {
>   var series:LineSeries = LineSeries( o.element ) as LineSeries;
>   var seriesIndex:int;
> 
>   for ( seriesIndex = 0; seriesIndex < myChart.series.length; 
> seriesIndex++ )
>   {
>   var lineSeries:LineSeries = myChart.series[ seriesIndex ] as 
> LineSeries;
> 
>   if ( lineSeries.displayName == series.displayName )
>   {
>   break;
>   }
>   }
> 
>   var s:String = "" + LineSeries( o.element ).displayName + "\n";
>   s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
>   s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> "\n";
>   s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> 
>   return s;
> }
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > So, maybe something like this:
> > 
> > private function dtFunction( o:HitData ):String
> > {
> > var series:LineSeries = LineSeries( o.element ) as LineSeries;
> > var seriesIndex:int;
> > 
> > for ( var a:int = 0; a < myChart.series.length; a++ )
> > {
> > var lineSeries:LineSeries = myChart.series[ a ] as LineSeries;
> > 
> > if ( lineSeries.displayName == series.displayName )
> > {
> > seriesIndex = a;
> > break;
> > }
> > }
> > 
> > var s:String = "" + LineSeries( o.element ).displayName + "\n";
> > s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
> > s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> > "\n";
> > s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> > 
> > return s;
> > }
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > Easy enough, create a dictionary (id or name) when the series's are 
> > > created; with the index.  And/Or you can get the count from 
> > > myChart.series.length.
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> > > >
> > > > This will work.  However, the series count is not limited to just "3" 
> > > > series, it's count is dynamic depending on the amount of data 
> > > > collected.  So the code needs to check how many series exists and then 
> > > > generate the datatip for the different series data points.  It is easy 
> > > > for me to accomplish this in VB.NET or vbscript but I am just having 
> > > > problems accomplishing what I need in AS.
> > > > 
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > > Ok, good.  Not sure exactly what you're trying to do, but it's 
> > > > > basically the same type of thing as the data function.  It's all 
> > > > > about getting to right data for the series.  Here's some code for 
> > > > > getting individual values and for calculating totals for the week
> > > > > 
> > > > > private function dtFunction( o:HitData ):String
> > > > > {
> > > > >   var seriesId:String = LineSeries( o.element ).id;
> > > > >   var seriesIndex:int;
> > > > > 
> > > > >   switch ( seriesId )
> > > > >   {
> > > > >   case "s0":
> > > > >   seriesIndex = 0;
> > > > >   break;
> > > > >   case "s1":
> > > > >   seriesIndex = 1;
> > > > >   break;
> > > > >   case "s2":
> > > > >   seriesIndex = 2;
> > &g

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-18 Thread turbo_vb
Cleaner:

private function dtFunction( o:HitData ):String
{
var series:LineSeries = LineSeries( o.element ) as LineSeries;
var seriesIndex:int;

for ( seriesIndex = 0; seriesIndex < myChart.series.length; 
seriesIndex++ )
{
var lineSeries:LineSeries = myChart.series[ seriesIndex ] as 
LineSeries;

if ( lineSeries.displayName == series.displayName )
{
break;
}
}

var s:String = "" + LineSeries( o.element ).displayName + "\n";
s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
"\n";
s += "Status: " + o.item.session[ seriesIndex ].status + "\n";

return s;
}

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> So, maybe something like this:
> 
> private function dtFunction( o:HitData ):String
> {
>   var series:LineSeries = LineSeries( o.element ) as LineSeries;
>   var seriesIndex:int;
> 
>   for ( var a:int = 0; a < myChart.series.length; a++ )
>   {
>   var lineSeries:LineSeries = myChart.series[ a ] as LineSeries;
> 
>   if ( lineSeries.displayName == series.displayName )
>   {
>   seriesIndex = a;
>   break;
>   }
>   }
> 
>   var s:String = "" + LineSeries( o.element ).displayName + "\n";
>   s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
>   s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> "\n";
>   s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> 
>   return s;
> }
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Easy enough, create a dictionary (id or name) when the series's are 
> > created; with the index.  And/Or you can get the count from 
> > myChart.series.length.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> > >
> > > This will work.  However, the series count is not limited to just "3" 
> > > series, it's count is dynamic depending on the amount of data collected.  
> > > So the code needs to check how many series exists and then generate the 
> > > datatip for the different series data points.  It is easy for me to 
> > > accomplish this in VB.NET or vbscript but I am just having problems 
> > > accomplishing what I need in AS.
> > > 
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > Ok, good.  Not sure exactly what you're trying to do, but it's 
> > > > basically the same type of thing as the data function.  It's all about 
> > > > getting to right data for the series.  Here's some code for getting 
> > > > individual values and for calculating totals for the week
> > > > 
> > > > private function dtFunction( o:HitData ):String
> > > > {
> > > > var seriesId:String = LineSeries( o.element ).id;
> > > > var seriesIndex:int;
> > > > 
> > > > switch ( seriesId )
> > > > {
> > > > case "s0":
> > > > seriesIndex = 0;
> > > > break;
> > > > case "s1":
> > > > seriesIndex = 1;
> > > > break;
> > > > case "s2":
> > > > seriesIndex = 2;
> > > > break;
> > > > default:
> > > > break;
> > > > }
> > > > 
> > > > var totalBooksForWeek:int = 0;
> > > > 
> > > > for ( var a:int = 0; a < 3; a++ )
> > > > {
> > > > var sessionBooks:int = o.item.session[ a ].books;
> > > > totalBooksForWeek += sessionBooks;
> > > > }
> > > > 
> > > > var s:String = "" + LineSeries( o.element ).displayName + 
> > > > "\n";
> > > > s += "Books: " + LineSeriesItem( o.chartItem ).yValue + 
> > > > "\n

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-18 Thread turbo_vb
So, maybe something like this:

private function dtFunction( o:HitData ):String
{
var series:LineSeries = LineSeries( o.element ) as LineSeries;
var seriesIndex:int;

for ( var a:int = 0; a < myChart.series.length; a++ )
{
var lineSeries:LineSeries = myChart.series[ a ] as LineSeries;

if ( lineSeries.displayName == series.displayName )
{
seriesIndex = a;
break;
}
}

var s:String = "" + LineSeries( o.element ).displayName + "\n";
s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
"\n";
s += "Status: " + o.item.session[ seriesIndex ].status + "\n";

return s;
}

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> Easy enough, create a dictionary (id or name) when the series's are created; 
> with the index.  And/Or you can get the count from myChart.series.length.
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> >
> > This will work.  However, the series count is not limited to just "3" 
> > series, it's count is dynamic depending on the amount of data collected.  
> > So the code needs to check how many series exists and then generate the 
> > datatip for the different series data points.  It is easy for me to 
> > accomplish this in VB.NET or vbscript but I am just having problems 
> > accomplishing what I need in AS.
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > Ok, good.  Not sure exactly what you're trying to do, but it's basically 
> > > the same type of thing as the data function.  It's all about getting to 
> > > right data for the series.  Here's some code for getting individual 
> > > values and for calculating totals for the week
> > > 
> > > private function dtFunction( o:HitData ):String
> > > {
> > >   var seriesId:String = LineSeries( o.element ).id;
> > >   var seriesIndex:int;
> > > 
> > >   switch ( seriesId )
> > >   {
> > >   case "s0":
> > >   seriesIndex = 0;
> > >   break;
> > >   case "s1":
> > >   seriesIndex = 1;
> > >   break;
> > >   case "s2":
> > >   seriesIndex = 2;
> > >   break;
> > >   default:
> > >   break;
> > >   }
> > > 
> > >   var totalBooksForWeek:int = 0;
> > > 
> > >   for ( var a:int = 0; a < 3; a++ )
> > >   {
> > >   var sessionBooks:int = o.item.session[ a ].books;
> > >   totalBooksForWeek += sessionBooks;
> > >   }
> > > 
> > >   var s:String = "" + LineSeries( o.element ).displayName + "\n";
> > >   s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
> > >   s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> > > "\n";
> > >   s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> > >   s += "Total Books for All Sessions: " + totalBooksForWeek + "\n";
> > > 
> > >   return s;
> > > }
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> > > >
> > > > Almost there!  I assigned an id to each series - s1, s2, s3 etc. Below I
> > > > am trying to loop for the total amount of series.  The values show up
> > > > for bookrate and status but they are the incorrect values for some of
> > > > the datapoints.  If I define a as 0, 1 or 3 without the loop the values
> > > > are correct for just that particular series.  Why isn't the for loop or
> > > > while loop working?
> > > > 
> > > > Thanks so much for your help Tim!
> > > > Monette
> > > > 
> > > > private function dtFunction( o:HitData ):String
> > > > var s:String;
> > > >  for (var a:int=0; a < 3; a++)
> > > >  {
> > > >  var index:int = (LineSeries(o.element).id == "s" + a)? > > > > 0
> > > > : 1;
> > 

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-18 Thread turbo_vb
Easy enough, create a dictionary (id or name) when the series's are created; 
with the index.  And/Or you can get the count from myChart.series.length.

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> This will work.  However, the series count is not limited to just "3" series, 
> it's count is dynamic depending on the amount of data collected.  So the code 
> needs to check how many series exists and then generate the datatip for the 
> different series data points.  It is easy for me to accomplish this in VB.NET 
> or vbscript but I am just having problems accomplishing what I need in AS.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Ok, good.  Not sure exactly what you're trying to do, but it's basically 
> > the same type of thing as the data function.  It's all about getting to 
> > right data for the series.  Here's some code for getting individual values 
> > and for calculating totals for the week
> > 
> > private function dtFunction( o:HitData ):String
> > {
> > var seriesId:String = LineSeries( o.element ).id;
> > var seriesIndex:int;
> > 
> > switch ( seriesId )
> > {
> > case "s0":
> > seriesIndex = 0;
> > break;
> > case "s1":
> > seriesIndex = 1;
> > break;
> > case "s2":
> > seriesIndex = 2;
> > break;
> > default:
> > break;
> > }
> > 
> > var totalBooksForWeek:int = 0;
> > 
> > for ( var a:int = 0; a < 3; a++ )
> > {
> > var sessionBooks:int = o.item.session[ a ].books;
> > totalBooksForWeek += sessionBooks;
> > }
> > 
> > var s:String = "" + LineSeries( o.element ).displayName + "\n";
> > s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
> > s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
> > "\n";
> > s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
> > s += "Total Books for All Sessions: " + totalBooksForWeek + "\n";
> > 
> > return s;
> > }
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "Monette"  wrote:
> > >
> > > Almost there!  I assigned an id to each series - s1, s2, s3 etc. Below I
> > > am trying to loop for the total amount of series.  The values show up
> > > for bookrate and status but they are the incorrect values for some of
> > > the datapoints.  If I define a as 0, 1 or 3 without the loop the values
> > > are correct for just that particular series.  Why isn't the for loop or
> > > while loop working?
> > > 
> > > Thanks so much for your help Tim!
> > > Monette
> > > 
> > > private function dtFunction( o:HitData ):String
> > > var s:String;
> > >  for (var a:int=0; a < 3; a++)
> > >  {
> > >  var index:int = (LineSeries(o.element).id == "s" + a)? 0
> > > : 1;
> > >  s =  "" + LineSeries(o.element).displayName + "
> > > \n";
> > >  s += "Books: " +
> > > LineSeriesItem(o.chartItem).yValue + "\n" + "Book rate: " +
> > > o.item.session[index].bookrate +  "\n" ;
> > >  s += "Status: " + o.item.session[index].status +
> > > "\n" ;
> > >  }
> > >  return s;
> > >  }
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > Assuming that you have assigned an id to each series
> > > > ("baseline","2009-8"), you could use something like this:
> > > >
> > > > private function dtFunction( o:HitData ):String
> > > >
> > > > {
> > > >
> > > >   var index:int = ( LineSeries( o.element ).id == "baseline" ) ? 0
> > > :
> > > > 1;
> > > >
> > > >   var s:String = "Book rate: " + o.item.session[ index
> > > > ].bookrate;
> > > >
> > >

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-18 Thread turbo_vb
Ok, good.  Not sure exactly what you're trying to do, but it's basically the 
same type of thing as the data function.  It's all about getting to right data 
for the series.  Here's some code for getting individual values and for 
calculating totals for the week

private function dtFunction( o:HitData ):String
{
var seriesId:String = LineSeries( o.element ).id;
var seriesIndex:int;

switch ( seriesId )
{
case "s0":
seriesIndex = 0;
break;
case "s1":
seriesIndex = 1;
break;
case "s2":
seriesIndex = 2;
break;
default:
break;
}

var totalBooksForWeek:int = 0;

for ( var a:int = 0; a < 3; a++ )
{
var sessionBooks:int = o.item.session[ a ].books;
totalBooksForWeek += sessionBooks;
}

var s:String = "" + LineSeries( o.element ).displayName + "\n";
s += "Books: " + LineSeriesItem( o.chartItem ).yValue + "\n";
s += "Book rate: " + o.item.session[ seriesIndex ].bookrate + 
"\n";
s += "Status: " + o.item.session[ seriesIndex ].status + "\n";
s += "Total Books for All Sessions: " + totalBooksForWeek + "\n";

return s;
}

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> Almost there!  I assigned an id to each series - s1, s2, s3 etc. Below I
> am trying to loop for the total amount of series.  The values show up
> for bookrate and status but they are the incorrect values for some of
> the datapoints.  If I define a as 0, 1 or 3 without the loop the values
> are correct for just that particular series.  Why isn't the for loop or
> while loop working?
> 
> Thanks so much for your help Tim!
> Monette
> 
> private function dtFunction( o:HitData ):String
> var s:String;
>  for (var a:int=0; a < 3; a++)
>  {
>  var index:int = (LineSeries(o.element).id == "s" + a)? 0
> : 1;
>  s =  "" + LineSeries(o.element).displayName + "
> \n";
>  s += "Books: " +
> LineSeriesItem(o.chartItem).yValue + "\n" + "Book rate: " +
> o.item.session[index].bookrate +  "\n" ;
>  s += "Status: " + o.item.session[index].status +
> "\n" ;
>  }
>  return s;
>  }
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Assuming that you have assigned an id to each series
> > ("baseline","2009-8"), you could use something like this:
> >
> > private function dtFunction( o:HitData ):String
> >
> > {
> >
> >   var index:int = ( LineSeries( o.element ).id == "baseline" ) ? 0
> :
> > 1;
> >
> >   var s:String = "Book rate: " + o.item.session[ index
> > ].bookrate;
> >
> >   return s;
> >
> > }
> >
> >
> >
> >
> > -TH
> >
> >
> >
> > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote:
> > >
> > > Tim,
> > > Your recommendation sounds so simple and logical but I am not
> getting
> > it
> > > to work.  My problem is parsing the XML and returning the correct
> info
> > > for the datapoints.  Following, is a sample of my XML file:
> > >
> > > 
> > >  
> > >  
> > >  Baseline
> > >  0
> > >  2
> > >  red
> > >  
> > >  
> > >  2009-8
> > >  0
> > >  6
> > >  red
> > >  
> > >  
> > >  
> > >  
> > >  Baseline
> > >  0
> > >  3
> > >  red
> > >  
> > >  
> > >  2009-8
> > >  0
> > >  1
> > >  red
> > >  
> > >  
> > > 
> > >
> > > What are your thoughts?
> > > Thanks.
> > > Monette
> > >
> > > --- In flexcoders@yahoogroups.com, "turbo_vb" TimHoff@ wrote:
> > > >
> > > &g

[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-15 Thread turbo_vb
Assuming that you have assigned an id to each series
("baseline","2009-8"), you could use something like this:

private function dtFunction( o:HitData ):String

{

  var index:int = ( LineSeries( o.element ).id == "baseline" ) ? 0 :
1;

  var s:String = "Book rate: " + o.item.session[ index
].bookrate;

  return s;

}




-TH



--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> Tim,
> Your recommendation sounds so simple and logical but I am not getting
it
> to work.  My problem is parsing the XML and returning the correct info
> for the datapoints.  Following, is a sample of my XML file:
>
> 
>  
>  
>  Baseline
>  0
>  2
>  red
>  
>  
>  2009-8
>  0
>  6
>  red
>  
>  
>  
>  
>  Baseline
>  0
>  3
>  red
>  
>  
>  2009-8
>  0
>  1
>  red
>  
>  
> 
>
> What are your thoughts?
> Thanks.
> Monette
>
> --- In flexcoders@yahoogroups.com, "turbo_vb" TimHoff@ wrote:
> >
> > Yeah, you're very close.  Now it's just a matter of xml.  I'd start
by
> tracing o.  If the children are still in o, then drill down. 
Otherwise,
> you'll have to go and find the nodes; like you're trying below.  Some
> things that you can start with:
> >
> > trace( o.toXMLString() );
> >
> > var myXMLChildren:XMLList = o.children();
> >
> > o.child("myProperty")[0].valueOf();
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote:
> > >
> > > Below is my DataTipFunction.  The commented part on top works
fine.
> > > However, there is additional information that I need to include
from
> the
> > > XML file into the data tip.
> > > When I mouse over the datapoint I would like to retrieve from the
> XML
> > > file the additional child nodes that correspond with that
datapoint.
> I
> > > feel that I am very close and missing one piece. How can I
> accomplish
> > > this dynamically by displaying the correct data for the series?
> Note, I
> > > can have more than 1 series in the XML data file.
> > >
> > > private  function DTPFunction(o:HitData):String
> > >  {
> > >  //WORKS for data that is used on the chart x and
y
> > > values
> > >  //var s:String;
> > >  //s =  "" + LineSeries(o.element).displayName
+
> "
> > > \n";
> > >  //s += "Books: " +
> > > LineSeriesItem(o.chartItem).yValue + "\n" + "Book rate: " +
> > > series. o.item.session.bookrate + "\n" ;
> > >  //s += "Status: " + o.item.session.status
+
> "\n"
> > > ;
> > >   //END WORKS
> > >
> > >  var s:String;
> > >  var a:int=0;
> > >      var fNode:XML = chart.dataProvider[0];
> > >  if ((LineSeries(o.element).displayName) ==
> > > fNode.child('sessionname'))
> > >  {
> > >  s =  "" + o.item.session.sessionname[a] +
"
> \n";
> > >  s += "Books: " + o.item.session.books[a] +
> "\n" +
> > > "Book rate: " + o.item.session.bookrate[a] +  "\n" ;
> > >  s += "Status: " + o.item.session.status[a]
+
> > > "\n" ;
> > >  a++
> > >  }
> > >  return s;
> > >  }
> > >
> > > Thanks.
> > > Monette
> > >
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > If the dataTipFunction doesn't give you enough flexibility, you
> could
> > > try a dataTipRenderer.  In either case, you can drill down to the
> child
> > > nodes there.
> > > >
> > > > -TH
> > > >
> > > > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote:
> > > > >
> > > > > The line chart displays multiple series created with the
> > > seriesDataFunction (assigning the x and y points).  The XML file
> > > includes additional child nodes per item that I would like to
> include in
> > > the datatip.  How do I include those items?  When I use
o.item.rate,
> it
> > > lists all the rates for each series in the datatip.
> > > > > Thanks.
> > > > > Monette
> > > > >
> > > >
> > >
> >
>



[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-15 Thread turbo_vb
Yeah, you're very close.  Now it's just a matter of xml.  I'd start by tracing 
o.  If the children are still in o, then drill down.  Otherwise, you'll have to 
go and find the nodes; like you're trying below.  Some things that you can 
start with:

trace( o.toXMLString() );

var myXMLChildren:XMLList = o.children();

o.child("myProperty")[0].valueOf();

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> Below is my DataTipFunction.  The commented part on top works fine. 
> However, there is additional information that I need to include from the
> XML file into the data tip.
> When I mouse over the datapoint I would like to retrieve from the XML
> file the additional child nodes that correspond with that datapoint.  I
> feel that I am very close and missing one piece. How can I accomplish
> this dynamically by displaying the correct data for the series?  Note, I
> can have more than 1 series in the XML data file.
> 
> private  function DTPFunction(o:HitData):String
>  {
>  //WORKS for data that is used on the chart x and y
> values
>  //var s:String;
>  //s =  "" + LineSeries(o.element).displayName + "
> \n";
>  //s += "Books: " +
> LineSeriesItem(o.chartItem).yValue + "\n" + "Book rate: " +
> series. o.item.session.bookrate + "\n" ;
>  //s += "Status: " + o.item.session.status + "\n"
> ;
>   //END WORKS
> 
>  var s:String;
>  var a:int=0;
>  var fNode:XML = chart.dataProvider[0];
>  if ((LineSeries(o.element).displayName) ==
> fNode.child('sessionname'))
>  {
>  s =  "" + o.item.session.sessionname[a] + " \n";
>  s += "Books: " + o.item.session.books[a] + "\n" +
> "Book rate: " + o.item.session.bookrate[a] +  "\n" ;
>  s += "Status: " + o.item.session.status[a] +
> "\n" ;
>  a++
>  }
>  return s;
>  }
> 
> Thanks.
> Monette
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > If the dataTipFunction doesn't give you enough flexibility, you could
> try a dataTipRenderer.  In either case, you can drill down to the child
> nodes there.
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com, "Monette" monettemm@ wrote:
> > >
> > > The line chart displays multiple series created with the
> seriesDataFunction (assigning the x and y points).  The XML file
> includes additional child nodes per item that I would like to include in
> the datatip.  How do I include those items?  When I use o.item.rate, it
> lists all the rates for each series in the datatip.
> > > Thanks.
> > > Monette
> > >
> >
>




[flexcoders] Re: Displaying additional child nodes in Datatip

2010-01-14 Thread turbo_vb
If the dataTipFunction doesn't give you enough flexibility, you could try a 
dataTipRenderer.  In either case, you can drill down to the child nodes there.

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> The line chart displays multiple series created with the seriesDataFunction 
> (assigning the x and y points).  The XML file includes additional child nodes 
> per item that I would like to include in the datatip.  How do I include those 
> items?  When I use o.item.rate, it lists all the rates for each series in the 
> datatip.
> Thanks.
> Monette
>




[flexcoders] Re: Help: Line chart multiple series datatip

2010-01-14 Thread turbo_vb
Think that you're looking for the dataTipFunction.

-TH

--- In flexcoders@yahoogroups.com, "Monette"  wrote:
>
> I assigned the y and x axis to each series in a line chart.  I need to 
> include additional information for each datapoint in the datatip from the XML 
> file. How can this be accomplished?
> Thanks.
>




[flexcoders] Re: Setting variables

2010-01-11 Thread turbo_vb
On the line above your setter, use the Inspectable metadata:

[Inspectable(category="General", enumeration="auto,up,down", 
defaultValue="auto")]

-TH

--- In flexcoders@yahoogroups.com, "Warren"  wrote:
>
> I'm creating my own actionscript class which will have a public property 
> accessed via a getter and setter.  I want this property to have one of thew 
> values: up. down. auto.  How do I set things up so that when I use the class 
> in Flexbuilder, only these choices appear as property selections?
> 
> I'm in Flex 3.2.0
> 
> Thanks!
> 
> Warren Koch
>




[flexcoders] Re: Flex LineChart. Show only line.

2010-01-08 Thread turbo_vb
Just set showLabels="false" on the AxisRenderers.

-TH

--- In flexcoders@yahoogroups.com, "Slackware"  wrote:
>
> I'm using a mx:LineChart. And I need to show just the line (no vertical and 
> horizontal labels). Is that possible? How? 
> 
> Many thanks.
>




[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
We're not so off really, I hear what you're saying.  Now we're getting a better 
idea of the use-case.  In this case, all of the itemRenderers need to be 
controlled the same way; by changing their styles and/or labels.  So let's go 
up a level.  Extend the List, or whatever.  Both the dataProvider and the 
collection of itemRenderers are there, so you could do it either way from the 
parent.  For the styles, I'd still try the StyleDeclaration routes.  For the 
labels, you have to ask, are the labels data related, like from a table 
somewhere?.  Are they related to the parent object of the data in the 
dataProvider?  Or, are they constants or persisted values?  Each case could 
have a different solution.   One way, is to create a public var in the 
itemRenderers, or a getter/setter, if you want to do something when the value 
changes.  So, the itemRenderer's label.text is bound to the public var.  In the 
extended list you create a method to update all of the public vars in the 
itemRenderers.  It's a loop, but not so bad.  Make your extended List's method 
public.  Or, you can also use getter/setter vars, if you wanted to bind out 
further.  When set, they could trigger the method that updates the 
itemRenderers.

Or, you can always use "owner as List," in the itemRenderer to check the value 
of a public var in the parent List during updateDisplayList(), and set your 
label's text value there. 

Like I said, it's usually all about the use-case.  In general, I don't see a 
lot of itemRenderers that all display the same thing; unless the data happens 
to be identical.  Common labels are often pulled up to the parent component.  
And the manipulation of an itemRenderer, for me, is usually based on data 
properties; that make sense to be included in every item.  Interesting 
discussion.

-TH

--- In flexcoders@yahoogroups.com, Aaron Hardy  wrote:
>
> I think there might be a misunderstanding.  If it's a transient property on
> the data objects that come through the data provider, I would have to change
> the property for all the objects in the data provider to be the same value
> since I want all the renderers to change in the same way.  For example,
> let's say all my renderers say "Woot: " and then the data's text value.
> Then at runtime, the user, in a different part of the app, enters "Niner"
> into a text input and therefore I want all my renderers to now say "Niner: "
> and then the data's text value.  In my case, the word "Niner" really has
> nothing to do with the data, it's almost more about the "style" of the
> renderers--or what the renderers look like around the actual data.  If I
> were to use the transient property of the data provider objects, I'd have to
> loop through all of them and set the property's value to "Niner".  I'm not
> sure if that's what you were suggesting, but that seems dirtier to me than
> referencing a separate model from the renderers.
> 
> I'm interested in understanding your analysis of this though even if we may
> disagree in the end.
> 
> Aaron
> 
> On Thu, Jan 7, 2010 at 5:13 PM, turbo_vb  wrote:
> 
> >
> >
> > Sure, but you don't necessarily need a model to use a VO; it can just be
> > the strongly typed object that the dataProvider uses for its items. If you
> > then change the transient properties of that VO, the set data method of the
> > itemRenderer will work out of the box; and you can then adjust the renderer.
> > You're right in feeling dirty having an itemRenderer reference a model. But
> > reacting to changes in the data is fine. IMHO.
> >
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com , Aaron
> > Hardy  wrote:
> > >
> > > Yes, I suppose the line of what is or is not a style can be blurry at
> > > times. In any case, using transient properties inside a VO is what I was
> > > eluding in the first item of "things I've thought of", the downside being
> > > that a model/VO of some type is needed in order to keep the renderer
> > > notified of updates to the property. In other words, I don't see a viable
> > > way of creating a "foobar" property inside the renderer and keeping it
> > > updated from an external source. Instead, the renderer would need access
> > to
> > > a model that was set at instantiation through the renderer class factory.
> > > The renderer would then watch the model for changes to its "foobar"
> > > property.
> > >
> > > Aaron
> > >
> > > On Thu, Jan 7, 2010 at 2:58 PM, turbo_vb  wrote:
> > >
> > > >
&g

[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
Sure, but you don't necessarily need a model to use a VO; it can just be the 
strongly typed object that the dataProvider uses for its items.  If you then 
change the transient properties of that VO, the set data method of the 
itemRenderer will work out of the box; and you can then adjust the renderer.  
You're right in feeling dirty having an itemRenderer reference a model.  But 
reacting to changes in the data is fine. IMHO.

-TH

--- In flexcoders@yahoogroups.com, Aaron Hardy  wrote:
>
> Yes, I suppose the line of what is or is not a style can be blurry at
> times.  In any case, using transient properties inside a VO is what I was
> eluding in the first item of "things I've thought of", the downside being
> that a model/VO of some type is needed in order to keep the renderer
> notified of updates to the property.  In other words, I don't see a viable
> way of creating a "foobar" property inside the renderer and keeping it
> updated from an external source.  Instead, the renderer would need access to
> a model that was set at instantiation through the renderer class factory.
> The renderer would then watch the model for changes to its "foobar"
> property.
> 
> Aaron
> 
> On Thu, Jan 7, 2010 at 2:58 PM, turbo_vb  wrote:
> 
> >
> >
> > If it's a pure style, then yes that is a viable approach. However, if it's
> > something like changing text (characters, not styles), then you might want
> > to use [Transient] properties in a VO and/or use states in the itemRenderer.
> >
> >
> > -TH
> >
> > --- In flexcoders@yahoogroups.com , Aaron
> > Hardy  wrote:
> > >
> > > Good point. So maybe I have to categorize everything as being data (in
> > > which case it hangs out with the data object) or style (in which case it
> > > would be applied to all the renderers and can be ran through the various
> > > style mechanisms). To be clear, the changes (that aren't data-dependent)
> > > being made to the renderers in my case can even be text and other such
> > > things which may not normally be thought of as "styles" but in reality it
> > > seems they actually are styles and could be treated as such.
> > >
> > > Thanks.
> > >
> > > Aaron
> > >
> > > On Thu, Jan 7, 2010 at 1:23 PM, turbo_vb  wrote:
> > >
> > > >
> > > >
> > > > One thought, since you're taking about a style, is to assign a
> > styleName to
> > > > the itemRenderer and update the backgroundColor style of the
> > > > StyleDeclaration when the user changes the color. You may need to
> > override
> > > > the styleChanged() method the itemRenderer, to handle the update.
> > > >
> > > > -TH
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com 
> > > >  > 40yahoogroups.com>, Aaron
> >
> > > > Hardy  wrote:
> > > > >
> > > > > Hey folks. I have a renderer that needs information that is not based
> > on
> > > > > the "data" object it's associated with. Essentially what I have is in
> > > > View
> > > > > A of the app is a color selector. In View B, I have a tilelist with a
> > > > > custom renderer. All the renderers in the tile list display their
> > data
> > > > > using the color that was selected in Part A. The way I see it, the
> > color
> > > > > selected in Part A should be kept separate from the "data" object
> > that
> > > > gets
> > > > > injected into the item renderers. The color is just to make the data
> > > > pretty
> > > > > in some way, it's not really "data" itself nor is it specific to an
> > > > > individual data object--it applies to all renderers in the list. This
> > > > leads
> > > > > me to somehow keep the renderers updated with a separate "color"
> > > > property.
> > > > > What's your preferred way of handling this scenario?
> > > > >
> > > > > Things I've thought of so far:
> > > > >
> > > > > (1) If I have an application-wide model (like in Cairngorm) I can set
> > a
> > > > > color property there and either access it using the singleton accesor
> > > > from
> > > > > within the renderer (cringe) or pass the model into the renderer
> > using a
> > > > > class factory. Since the model instance shouldn't really ever change,
> > I
> > > > can
> > > > > then watch the model for changes to the color property.
> > > > >
> > > > > (2) Whenever the color changes, I can grab all the renderers for the
> > > > given
> > > > > list and set their color property (cringe).
> > > > >
> > > > > Thoughts?
> > > > >
> > > > > Aaron
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> >  
> >
>




[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
If it's a pure style, then yes that is a viable approach.  However, if it's 
something like changing text (characters, not styles), then you might want to 
use [Transient] properties in a VO and/or use states in the itemRenderer.

-TH

--- In flexcoders@yahoogroups.com, Aaron Hardy  wrote:
>
> Good point.  So maybe I have to categorize everything as being data (in
> which case it hangs out with the data object) or style (in which case it
> would be applied to all the renderers and can be ran through the various
> style mechanisms). To be clear, the changes (that aren't data-dependent)
> being made to the renderers in my case can even be text and other such
> things which may not normally be thought of as "styles" but in reality it
> seems they actually are styles and could be treated as such.
> 
> Thanks.
> 
> Aaron
> 
> On Thu, Jan 7, 2010 at 1:23 PM, turbo_vb  wrote:
> 
> >
> >
> > One thought, since you're taking about a style, is to assign a styleName to
> > the itemRenderer and update the backgroundColor style of the
> > StyleDeclaration when the user changes the color. You may need to override
> > the styleChanged() method the itemRenderer, to handle the update.
> >
> > -TH
> >
> >
> > --- In flexcoders@yahoogroups.com , Aaron
> > Hardy  wrote:
> > >
> > > Hey folks. I have a renderer that needs information that is not based on
> > > the "data" object it's associated with. Essentially what I have is in
> > View
> > > A of the app is a color selector. In View B, I have a tilelist with a
> > > custom renderer. All the renderers in the tile list display their data
> > > using the color that was selected in Part A. The way I see it, the color
> > > selected in Part A should be kept separate from the "data" object that
> > gets
> > > injected into the item renderers. The color is just to make the data
> > pretty
> > > in some way, it's not really "data" itself nor is it specific to an
> > > individual data object--it applies to all renderers in the list. This
> > leads
> > > me to somehow keep the renderers updated with a separate "color"
> > property.
> > > What's your preferred way of handling this scenario?
> > >
> > > Things I've thought of so far:
> > >
> > > (1) If I have an application-wide model (like in Cairngorm) I can set a
> > > color property there and either access it using the singleton accesor
> > from
> > > within the renderer (cringe) or pass the model into the renderer using a
> > > class factory. Since the model instance shouldn't really ever change, I
> > can
> > > then watch the model for changes to the color property.
> > >
> > > (2) Whenever the color changes, I can grab all the renderers for the
> > given
> > > list and set their color property (cringe).
> > >
> > > Thoughts?
> > >
> > > Aaron
> > >
> >
> >  
> >
>




[flexcoders] Re: Updating renderer properties

2010-01-07 Thread turbo_vb
One thought, since you're taking about a style, is to assign a styleName to the 
itemRenderer and update the backgroundColor style of the StyleDeclaration when 
the user changes the color.  You may need to override the styleChanged() method 
the itemRenderer, to handle the update.

-TH

--- In flexcoders@yahoogroups.com, Aaron Hardy  wrote:
>
> Hey folks.  I have a renderer that needs information that is not based on
> the "data" object it's associated with.  Essentially what I have is in View
> A of the app is a color selector.  In View B, I have a tilelist with a
> custom renderer.  All the renderers in the tile list display their data
> using the color that was selected in Part A.  The way I see it, the color
> selected in Part A should be kept separate from the "data" object that gets
> injected into the item renderers.  The color is just to make the data pretty
> in some way, it's not really "data" itself nor is it specific to an
> individual data object--it applies to all renderers in the list. This leads
> me to somehow keep the renderers updated with a separate "color" property.
> What's your preferred way of handling this scenario?
> 
> Things I've thought of so far:
> 
> (1) If I have an application-wide model (like in Cairngorm) I can set a
> color property there and either access it using the singleton accesor from
> within the renderer (cringe) or pass the model into the renderer using a
> class factory.  Since the model instance shouldn't really ever change, I can
> then watch the model for changes to the color property.
> 
> (2) Whenever the color changes, I can grab all the renderers for the given
> list and set their color property (cringe).
> 
> Thoughts?
> 
> Aaron
>




[flexcoders] Re: Multiple initializers for property 'dataProvider'

2010-01-07 Thread turbo_vb
Hi Raymond,

You're missing the  tag that wraps the DataGridColumns.

-TH

--- In flexcoders@yahoogroups.com, Raymond Brown  wrote:
>
> Below is a snapshot of one of my components. However I am always getting an 
> error on the Datagrid (id="cmdTable') and the error is:
> 
> Multiple initializers for property 'dataProvider'. (note: 'dataProvider' is 
> the default property of  'mx.controls.DataGrid').
> 
> Does this mean you can't keep more than one datagrid or datagrid type in a 
> file?
> 
> Here is my source -
> 
> 
> http://www.adobe.com/2006/mxml"; xmlns:comp="components.*" 
> width="100%" height="100%" backgroundAlpha="0.0" fontSize="14" 
> initialize="init()">
> 
> 
>  alphaTo="1.0"/>
>
> 
> 
> 
>  blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0" 
> color="0x22A050"/>
>  blurXFrom="50.0" blurXTo="0.0" blurYFrom="50.0" blurYTo="0.0" 
> color="0x3380DD"/>
> 
> 
> 
> 
> 
>  blurXFrom="50.0" blurXTo="0.0" blurYFrom="50.0" blurYTo="0.0" 
> color="0x3380DD"/>
>  blurXFrom="0.0" blurXTo="50.0" blurYFrom="0.0" blurYTo="50.0" 
> color="0x22A050"/>
> 
> 
>  verticalAlign="middle">
>  verticalAlign="middle" backgroundAlpha="0.0">
> 
> 
>  enabled="{siteCB.selectedIndex >= 1}" dataProvider="['Select a device', 
> '6501']" close="deviceSelected(event)" />
> 
>  width="100%" height="100%" autoLoad="true" scaleContent="true" 
> hideEffect="{dissolveOut}" showEffect="{dissolveIn}"/>
> 
>  visible="{deviceCB.selectedIndex >= 1}" showEffect="{showMe}">
> 
> 
>  showHeaders="false" width="100%" height="85%" 
> selectedIndex="0" backgroundAlpha="0.0" color="#FF">
> 
> 
>
> 
> 
>  borderColor="#FF" color="#FF" backgroundAlpha="0.0"/>
> 
> 
> 
> 
>  backgroundAlpha="0.0"
> width="40%" height="100%" color="#FF" 
> dataProvider="{settingStatusData}"/>
> 
>  height="15%" backgroundAlpha="0.0" visible="{deviceCB.selectedIndex >= 1}" 
> showEffect="{showMe}"/>
> 
>   
>   
> 
>   
>   
> 
> 
> thanks for the insights or help to solving this.
>




[flexcoders] Re: how to use stage in mxml

2010-01-06 Thread turbo_vb
Yep, even better.

-TH

--- In flexcoders@yahoogroups.com, "ag_rcuren"  wrote:
>
> Why not just use the addedToStage event instead? This will guarantee that 
> stage is not null.
> 
> http://www.adobe.com/2006/mxml";
> addedToStage="init();">
> 
> public function init():void
> {
> stage.addEventListener(Event.RESIZE, resizeHandler);
> }
> 
> private function resizeHandler(event:ResizeEvent):void
> {
> trace("height:" + stage.height);
> trace("height:" + stage.width);
> }
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > Btw, adding a new topic every few hours that addresses the same issue, but 
> > with a slightly different name, is really bad form.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > The stage isn't available immediately.  That's why you get a null error.
> > > With a little trickery:
> > > 
> > > http://www.adobe.com/2006/mxml";
> > > 
> > > creationComplete="onCreationComplete()"
> > > 
> > > resize="getStageDimensions()">
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > -TH
> > > 
> > > --- In flexcoders@yahoogroups.com, "markflex2007" 
> > > wrote:
> > > >
> > > >
> > > > I try to get current stage size with the code,but I get error
> > > > "TypeError: Error #1009: Cannot access a property or method of a null
> > > object reference.".
> > > > It seems I get error for stage.height.
> > > >
> > > > http://www.adobe.com/2006/mxml";
> > > layout="absolute"
> > > > creationPolicy="all" resize="resizeHandler(event)">
> > > > 
> > > >  
> > > > 
> > > >
> > > > ...
> > > > ...
> > > >
> > > > 
> > > >
> > > >
> > > > Please help me.Thanks
> > > >
> > > > Mark
> > > >
> > >
> >
>




[flexcoders] Re: how to use stage in mxml

2010-01-06 Thread turbo_vb
Btw, adding a new topic every few hours that addresses the same issue, but with 
a slightly different name, is really bad form.

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> The stage isn't available immediately.  That's why you get a null error.
> With a little trickery:
> 
> http://www.adobe.com/2006/mxml";
> 
> creationComplete="onCreationComplete()"
> 
> resize="getStageDimensions()">
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -TH
> 
> --- In flexcoders@yahoogroups.com, "markflex2007" 
> wrote:
> >
> >
> > I try to get current stage size with the code,but I get error
> > "TypeError: Error #1009: Cannot access a property or method of a null
> object reference.".
> > It seems I get error for stage.height.
> >
> > http://www.adobe.com/2006/mxml";
> layout="absolute"
> > creationPolicy="all" resize="resizeHandler(event)">
> > 
> >  
> > 
> >
> > ...
> > ...
> >
> > 
> >
> >
> > Please help me.Thanks
> >
> > Mark
> >
>




[flexcoders] Re: how to use stage in mxml

2010-01-06 Thread turbo_vb
The stage isn't available immediately.  That's why you get a null error.
With a little trickery:

http://www.adobe.com/2006/mxml";

creationComplete="onCreationComplete()"

resize="getStageDimensions()">













-TH

--- In flexcoders@yahoogroups.com, "markflex2007" 
wrote:
>
>
> I try to get current stage size with the code,but I get error
> "TypeError: Error #1009: Cannot access a property or method of a null
object reference.".
> It seems I get error for stage.height.
>
> http://www.adobe.com/2006/mxml";
layout="absolute"
> creationPolicy="all" resize="resizeHandler(event)">
> 
>  
> 
>
> ...
> ...
>
> 
>
>
> Please help me.Thanks
>
> Mark
>



[flexcoders] Re: Creating XML Document from Data

2010-01-03 Thread turbo_vb
Why change from an ArrayCollection to xml; especially if it contains strongly 
typed objects?  A bit easier to work with for hierarchical components or charts 
perhaps?

-TH

--- In flexcoders@yahoogroups.com, Paul Andrews  wrote:
>
> Better still, create the XML in the backend rather than generate data on 
> the server and have to translate that data again.
> 
> Paul
> 
> 
> Tracy Spratt wrote:
> >
> >
> > I do not know of an example, but creating XMl with AS is pretty easy.  
> > You have two choices, either building a string representation, the 
> > feeding that to XML() function, or build the xml directly using the 
> > e4x API.  I do it both ways.
> >
> >  
> >
> > Start with the static parts of the xml, then in the dynamic parts, 
> > filter the ArrayCollection for the applicable items, loop over those, 
> > and build a node for each one.
> >
> >  
> >
> > Tracy Spratt,
> >
> > Lariat Services, development services available
> >
> > 
> >
> > *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] 
> > *On Behalf Of *Wally Kolcz
> > *Sent:* Sunday, January 03, 2010 7:26 PM
> > *To:* flexcoders@yahoogroups.com
> > *Subject:* [SPAM] [flexcoders] Creating XML Document from Data
> >
> >  
> >
> >  
> >
> > Can someone give me a hint (Class to look into) or paste a URL to an 
> > example of how to create an XML structure, using a returned 
> > ArrayCollection of dynamic values, to use as the XML Datasource for a 
> > .
> >
> > I create a backend system for my client to use to create views 
> > ('pages'), but need to take the pageTitles and pageID, base on 
> > categories ('galleries' and 'personal'), and create a drop down menu 
> > system using 
> >
> > Something like:
> >
> > 
> > 
> > //Loop all the galleries by the returned data
> > 
> > 
> > 
> > //Loop all the personal pages by the returned data
> > 
> > 
> > 
> >  
> >  
> >
> >
> >
>




[flexcoders] Re: event when page is shown in ViewStack?

2010-01-01 Thread turbo_vb
The "show" event will work except for the first time; in which case you'd want 
to listen for the "creationComplete" event.

-TH

--- In flexcoders@yahoogroups.com, "mitchgrrt"  wrote:
>
> Is there an event I can listen for on a page, which would be sent 
> automatically whenever the page is shown in a ViewStack?  I thought "show" 
> might work but it doesn't seem to.  We have an application with a set of 
> nested tabs implemented with ViewStacks, and a couple of the pages need to 
> execute a function whenever they are shown.  Thanks.
>




[flexcoders] Re: Getting the Y value for a line at a given point

2010-01-01 Thread turbo_vb
Hi Ryan,

You can get the coordinates of the point by using coordinate geometry and 
trigonometry.  The key would be to determine the angle (or slope) of the line 
segment and the distance to the event point.  Or, if you wanted to make the 
segments square, use form="step":



-TH

--- In flexcoders@yahoogroups.com, "Ryan"  wrote:
>
> I've got a line chart showing a dollar value over time. Think of it as the 
> balance of a savings account. It goes up and down every month or so. What I'm 
> trying to do is overlay little widgets on top of that line on the chart to 
> represent events that may or may not have affected the line's value. This is 
> actually similar to the Yahoo Finance stock chart with the event overlays. 
> 
> Anyway, it's easy enough to add a CartesianDataCanvas as an annotation 
> element to my line chart and then add children to it. It has a nice little 
> addDataChild method that allows you to specify an x axis value and a y axis 
> value and it figures out what the corresponding x and y coordinates are and 
> places the child there. Great so far. 
> 
> Say my line series data provider looks like this:
> {date:new Date(2009, 1, 1), balance:100}
> {date:new Date(2009, 2, 8), balance:140}
> {date:new Date(2009, 3, 5), balance:95}
> 
> If I have an event for 1/1/2009, I can look up that the balance was 100 on 
> that day and place the event widget at [1/1/2009, 100]. However, if I have an 
> event on 1/15/2009, from looking at the data provider above, I know that the 
> balance was still 100, but because the line is diagonally vectoring towards 
> the next value of 140, my data point is misplaced if I put it at [1/15/2009, 
> 100]. 
> 
> Is there a way to get the line's y value given an x value?
> or
> Can I change my line chart to not draw diagonal lines and instead draw square 
> lines so I won't have this problem?
> 
> Ryan
>




[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread turbo_vb
Ok, an easy way would be to add paddingLeft to the titleStyleName, or try to 
move the titleTextField in updateDisplayList();

-TH

--- In flexcoders@yahoogroups.com, "invertedspear"  wrote:
>
> I may not be able to sell that to the project manager. Anyway to keep it on 
> the left without covering the title?
> 
> Thanks, you've helped a lot so far.
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > In updateDispayList() position the box:
> > 
> > tempBox.move( unscaledWidth - tempBox.width - 10, ( unscaledHeight / 2 ) - 
> > ( tempBox.height / 2 ) );
> > 
> > This would put it on the right side of the header, minus 10 pixels.
> > 
> > -TH
> > 
> > --- In flexcoders@yahoogroups.com, "invertedspear"  wrote:
> > >
> > > I am adding the box but now it's covering up the normal title text of the 
> > > panel. Any quick fix for that (I'm just adding space to the front of the 
> > > text for the time being)?
> > > 
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > That's exactly what you should do.  To get around the the titleBar add
> > > > the box to rawChildren.
> > > > http://dougr.net/?p=160 <http://dougr.net/?p=160>
> > > > -TH
> > > > --- In flexcoders@yahoogroups.com, "invertedspear" 
> > > > wrote:
> > > > >
> > > > > Alternatively it would be nice if I could extend the Panel class to
> > > > allow me to add click events to the title area at the top, but I can't
> > > > find any way of making that public so I can do it outside of my custom
> > > > class, any ideas on exposing that protected property?
> > > > >
> > > > > Thanks
> > > > >
> > > > > --- In flexcoders@yahoogroups.com, "invertedspear" invertedspear@
> > > > wrote:
> > > > > >
> > > > > > This should be easy but I'm kind of a newbie.
> > > > > >
> > > > > > The concept of this seems easy, but I'm having trouble getting it
> > > > right and can't find anything to help me on this.
> > > > > >
> > > > > > I have a panel I need to perform a drag and drop operation on, but I
> > > > only want to perform that if the user mouses down on a particular area
> > > > of the panel. I can add an Icon to the panel by doing this:
> > > > > >
> > > > > > **
> > > > > > [Embed("/img/icon.png")]
> > > > > > [Bindable]
> > > > > > public var dragIcon:Class;
> > > > > >
> > > > > > newPanel.titleIcon = dragIcon;
> > > > > > **
> > > > > >
> > > > > > But what I really want to add is a box, which I can then add my
> > > > listeners to for the drag and mouse down like I do on some canvases
> > > > created in actionscript like so:
> > > > > >
> > > > > > **
> > > > > > var tempBox:Box = new Box;
> > > > > > tempBox.x=0;
> > > > > > tempBox.y=0;
> > > > > > tempBox.width = 20;
> > > > > > tempBox.height = 44;
> > > > > > tempBox.setStyle("horizontalAlign","center");
> > > > > > tempBox.setStyle("verticalAlign","middle");
> > > > > > tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
> > > > > > tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
> > > > > > tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
> > > > > > var tempImg:Image = new Image();
> > > > > > tempImg.source = grabbableItem;
> > > > > > tempBox.addChild(tempImg);
> > > > > > myCanvas.addChild(tempBox);
> > > > > > **
> > > > > >
> > > > > > So what do I need to do to use that tempBox and turn it into a class
> > > > to be used as my panels titleIcon?
> > > > > >
> > > > >
> > > >
> > >
> >
>




[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread turbo_vb
In updateDispayList() position the box:

tempBox.move( unscaledWidth - tempBox.width - 10, ( unscaledHeight / 2 ) - ( 
tempBox.height / 2 ) );

This would put it on the right side of the header, minus 10 pixels.

-TH

--- In flexcoders@yahoogroups.com, "invertedspear"  wrote:
>
> I am adding the box but now it's covering up the normal title text of the 
> panel. Any quick fix for that (I'm just adding space to the front of the text 
> for the time being)?
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > That's exactly what you should do.  To get around the the titleBar add
> > the box to rawChildren.
> > http://dougr.net/?p=160 <http://dougr.net/?p=160>
> > -TH
> > --- In flexcoders@yahoogroups.com, "invertedspear" 
> > wrote:
> > >
> > > Alternatively it would be nice if I could extend the Panel class to
> > allow me to add click events to the title area at the top, but I can't
> > find any way of making that public so I can do it outside of my custom
> > class, any ideas on exposing that protected property?
> > >
> > > Thanks
> > >
> > > --- In flexcoders@yahoogroups.com, "invertedspear" invertedspear@
> > wrote:
> > > >
> > > > This should be easy but I'm kind of a newbie.
> > > >
> > > > The concept of this seems easy, but I'm having trouble getting it
> > right and can't find anything to help me on this.
> > > >
> > > > I have a panel I need to perform a drag and drop operation on, but I
> > only want to perform that if the user mouses down on a particular area
> > of the panel. I can add an Icon to the panel by doing this:
> > > >
> > > > **
> > > > [Embed("/img/icon.png")]
> > > > [Bindable]
> > > > public var dragIcon:Class;
> > > >
> > > > newPanel.titleIcon = dragIcon;
> > > > **
> > > >
> > > > But what I really want to add is a box, which I can then add my
> > listeners to for the drag and mouse down like I do on some canvases
> > created in actionscript like so:
> > > >
> > > > **
> > > > var tempBox:Box = new Box;
> > > > tempBox.x=0;
> > > > tempBox.y=0;
> > > > tempBox.width = 20;
> > > > tempBox.height = 44;
> > > > tempBox.setStyle("horizontalAlign","center");
> > > > tempBox.setStyle("verticalAlign","middle");
> > > > tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
> > > > tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
> > > > tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
> > > > var tempImg:Image = new Image();
> > > > tempImg.source = grabbableItem;
> > > > tempBox.addChild(tempImg);
> > > > myCanvas.addChild(tempBox);
> > > > **
> > > >
> > > > So what do I need to do to use that tempBox and turn it into a class
> > to be used as my panels titleIcon?
> > > >
> > >
> >
>




[flexcoders] Re: change slideer look?

2009-12-29 Thread turbo_vb
Using the "tickValues" property will help you a little. 

-TH

--- In flexcoders@yahoogroups.com, "markflex2007"  wrote:
>
> Hi,
> 
> I have a slider that is like following:
> 
>  tickColor="0x323232"  snapInterval="0.5" tickInterval="0.5" 
> dataTipPrecision="1" labels="['0.5mile','5miles']" liveDragging="true" />
> 
> I want to only let it to choose value 0.5,1,2,3,4,5. My question is how to 
> make ticks for 1.5,2.5,3.5,4.5 not to display so we can not select that 
> values.
> 
> Thanks for help
> 
> Marks
>




[flexcoders] Re: Adding a custom UI component as a panel titleIcon.

2009-12-29 Thread turbo_vb
That's exactly what you should do.  To get around the the titleBar add
the box to rawChildren.
http://dougr.net/?p=160 
-TH
--- In flexcoders@yahoogroups.com, "invertedspear" 
wrote:
>
> Alternatively it would be nice if I could extend the Panel class to
allow me to add click events to the title area at the top, but I can't
find any way of making that public so I can do it outside of my custom
class, any ideas on exposing that protected property?
>
> Thanks
>
> --- In flexcoders@yahoogroups.com, "invertedspear" invertedspear@
wrote:
> >
> > This should be easy but I'm kind of a newbie.
> >
> > The concept of this seems easy, but I'm having trouble getting it
right and can't find anything to help me on this.
> >
> > I have a panel I need to perform a drag and drop operation on, but I
only want to perform that if the user mouses down on a particular area
of the panel. I can add an Icon to the panel by doing this:
> >
> > **
> > [Embed("/img/icon.png")]
> > [Bindable]
> > public var dragIcon:Class;
> >
> > newPanel.titleIcon = dragIcon;
> > **
> >
> > But what I really want to add is a box, which I can then add my
listeners to for the drag and mouse down like I do on some canvases
created in actionscript like so:
> >
> > **
> > var tempBox:Box = new Box;
> > tempBox.x=0;
> > tempBox.y=0;
> > tempBox.width = 20;
> > tempBox.height = 44;
> > tempBox.setStyle("horizontalAlign","center");
> > tempBox.setStyle("verticalAlign","middle");
> > tempBox.addEventListener(MouseEvent.ROLL_OVER,over);
> > tempBox.addEventListener(MouseEvent.ROLL_OUT,out);
> > tempBox.addEventListener(MouseEvent.MOUSE_DOWN,mouseDownAnswer);
> > var tempImg:Image = new Image();
> > tempImg.source = grabbableItem;
> > tempBox.addChild(tempImg);
> > myCanvas.addChild(tempBox);
> > **
> >
> > So what do I need to do to use that tempBox and turn it into a class
to be used as my panels titleIcon?
> >
>



[flexcoders] Re: addItem Trouble with TileList

2009-12-23 Thread turbo_vb
Cool, yea didn't know if you wanted to remind and add or just remind.

Cheers,
-TH

--- In flexcoders@yahoogroups.com, "s_hernandez01"  wrote:
>
> Thanks again TH it works great I just adjusted it to an if..else.. 
> conditional statement to avoid it still adding the duplicate to the tiles on 
> the right.  Appreciate it!
> 
> -Sal
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> > If you need to check dups for other reasons that would work fine.  but,
> > if you just need it for this particular use-case, this is simpler:
> > 
> > public function addButton():void
> > 
> > {
> > 
> > 
> >   if ( dataRight.getItemIndex( rightTiles.selectedItem ) != -1 )
> > Alert.show( "Already exists" );
> > 
> > 
> > 
> > 
> > 
> >   dataRight.addItem( rightTiles.selectedItem );
> > 
> > }
> > 
> > 
> > 
> > 
> > -TH
> > 
> > 
> > 
> > --- In flexcoders@yahoogroups.com, "s_hernandez01" 
> > wrote:
> > >
> > > What about if I wanted to check for duplicates so that it will remind
> > the user that this button already exists on the right?  I came up with
> > something like this, but doesn't work:
> > >
> > > public function addButton():void{
> > > dataRight.addItem(rightTiles.selectedItem);
> > > checkDuplicates();
> > >}
> > >
> > >public function checkDuplicates():void{
> > > for(var i:int=0; i < dataRight.length; i++){
> > >  if(dataLeft[i].id==dataRight[i].id){
> > >   Alert.show("Already exists");
> > >  }
> > > }
> > >}
> > >
> > > -Sal
> > >
> > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@
> > wrote:
> > > >
> > > > hey thanks TH, i knew it was something with one line of code. You
> > rock! This was driving me nuts.
> > > >
> > > > Sal
> > > >
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > > Because guys like Gordon are here, I'll also say that Instantiate
> > is the correct word; instead of initialize. :)
> > > > >
> > > > > -TH
> > > > >
> > > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > > >
> > > > > > Man, I always forget at least one thing.   You also need to
> > initialize
> > > > > > the second ArrayCollection().
> > > > > >
> > > > > >
> > > > > > [Bindable] public var dataRight:ArrayCollection= new
> > ArrayCollection();
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > Might want to give the itemRenderer a background, so that the
> > double
> > > > > > clicks will be triggered on the entire area.
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > -TH
> > > > > >
> > > > > >
> > > > > >
> > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > > > >
> > > > > > >
> > > > > > > Hey Sal,
> > > > > > > minor tweaks:
> > > > > > >
> > > > > > > public function addButton():void
> > > > > > >
> > > > > > > {
> > > > > > >
> > > > > > > dataRight.addItem( rightTiles.selectedItem );
> > > > > > >
> > > > > > > }
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > and:
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >  > > > > > >
> > > > > > > url="buttonData.xml"
> > > > > > >
> > > > > > > useProxy="false

[flexcoders] Re: addItem Trouble with TileList

2009-12-23 Thread turbo_vb
If you need to check dups for other reasons that would work fine.  but,
if you just need it for this particular use-case, this is simpler:

public function addButton():void

{


  if ( dataRight.getItemIndex( rightTiles.selectedItem ) != -1 )
Alert.show( "Already exists" );





  dataRight.addItem( rightTiles.selectedItem );

}




-TH



--- In flexcoders@yahoogroups.com, "s_hernandez01" 
wrote:
>
> What about if I wanted to check for duplicates so that it will remind
the user that this button already exists on the right?  I came up with
something like this, but doesn't work:
>
> public function addButton():void{
> dataRight.addItem(rightTiles.selectedItem);
> checkDuplicates();
>}
>
>public function checkDuplicates():void{
> for(var i:int=0; i < dataRight.length; i++){
>  if(dataLeft[i].id==dataRight[i].id){
>   Alert.show("Already exists");
>  }
> }
>}
>
> -Sal
>
> --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@
wrote:
> >
> > hey thanks TH, i knew it was something with one line of code. You
rock! This was driving me nuts.
> >
> > Sal
> >
> > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > >
> > > Because guys like Gordon are here, I'll also say that Instantiate
is the correct word; instead of initialize. :)
> > >
> > > -TH
> > >
> > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > >
> > > > Man, I always forget at least one thing.   You also need to
initialize
> > > > the second ArrayCollection().
> > > >
> > > >
> > > > [Bindable] public var dataRight:ArrayCollection= new
ArrayCollection();
> > > >
> > > >
> > > >
> > > >
> > > > Might want to give the itemRenderer a background, so that the
double
> > > > clicks will be triggered on the entire area.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > -TH
> > > >
> > > >
> > > >
> > > > --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> > > > >
> > > > >
> > > > > Hey Sal,
> > > > > minor tweaks:
> > > > >
> > > > > public function addButton():void
> > > > >
> > > > > {
> > > > >
> > > > > dataRight.addItem( rightTiles.selectedItem );
> > > > >
> > > > > }
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > and:
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >  > > > >
> > > > > url="buttonData.xml"
> > > > >
> > > > > useProxy="false"
> > > > >
> > > > > result="handleQueryResult(event)"
> > > > >
> > > > > showBusyCursor="true"
> > > > >
> > > > > resultFormat="object"/>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > -TH
> > > > >
> > > > >
> > > > >
> > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01"
s_hernandez01@
> > > > > wrote:
> > > > > >
> > > > > > I am having trouble understanding the addItem method in AS3
with
> > > > Flex.
> > > > > I'm trying to simply add the item renderer with all it's data
from
> > > > > tilelist to tilelist.  I'm using two arraycollections to do
the
> > > > transfer
> > > > > and the data is being populated through an xml file.  I know
it's just
> > > > > maybe 2 or 3 lines of code that I probably need, but can
someone help
> > > > > me, please?  Thanks
> > > > > >
> > > > > >
> > > > > > // SAMPLE XML FILE
> > > > > >
> > > > > > 
> > > > > > 
> > > > > > btnSkins/action_btn.png
> > > > > > 10
> > > > > > 
> > > > > > 
> > > > > > btnSkins/awards_btn.png
> > > > > >  15
> > > > > > 
> > > > > > 
> > > > > > btnSkins/beer_btn.png
> > > > > >  20
> > > > > > 
> > > > > > 
> > > > > > btnSkins/blog_btn.png
> > > > > >  25
> > > > > > 
> > > > > > 
> > > > > >
> > > > > >
> > > > > > // MAIN FILE
> > > > > >
> > > > > > 
> > > > > > http://www.adobe.com/2006/mxml";
> > > > > layout="horizontal" creationComplete="btnSrv.send()">
> > > > > >
> > > > > >  
> > > > > >   
> > > > > >  
> > > > > >
> > > > > >   > > > > >   result="handleQueryResult(event)" showBusyCursor="true"/>
> > > > > >
> > > > > >   > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb"
columnWidth="94"
> > > > > rowHeight="80"
> > > > > >   doubleClickEnabled="true" doubleClick="addButton()"/>
> > > > > >
> > > > > >   > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb"
columnWidth="94"
> > > > > rowHeight="80"/>
> > > > > > 
> > > > > >
> > > > > >
> > > > > > // ITEM RENDERER
> > > > > >
> > > > > > 
> > > > > > http://www.adobe.com/2006/mxml";
width="108"
> > > > > height="83">
> > > > > >
> > > > > >   > > > > horizontalAlign="center" right="5" bottom="0" left="5"
top="0"/>
> > > > > >
> > > > > > 
> > > > > >
> > > > >
> > > >
> > >
> >
>



[flexcoders] Re: addItem Trouble with TileList

2009-12-22 Thread turbo_vb
Because guys like Gordon are here, I'll also say that Instantiate is the 
correct word; instead of initialize. :)

-TH

--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
> Man, I always forget at least one thing.   You also need to initialize
> the second ArrayCollection().
> 
> 
> [Bindable] public var dataRight:ArrayCollection= new ArrayCollection();
> 
> 
> 
> 
> Might want to give the itemRenderer a background, so that the double
> clicks will be triggered on the entire area.
> 
> 
> 
> 
> 
> -TH
> 
> 
> 
> --- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
> >
> >
> > Hey Sal,
> > minor tweaks:
> >
> > public function addButton():void
> >
> > {
> >
> > dataRight.addItem( rightTiles.selectedItem );
> >
> > }
> >
> >
> >
> >
> > and:
> >
> >
> >
> >
> >
> >
> >  >
> > url="buttonData.xml"
> >
> > useProxy="false"
> >
> > result="handleQueryResult(event)"
> >
> > showBusyCursor="true"
> >
> > resultFormat="object"/>
> >
> >
> >
> >
> > -TH
> >
> >
> >
> > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@
> > wrote:
> > >
> > > I am having trouble understanding the addItem method in AS3 with
> Flex.
> > I'm trying to simply add the item renderer with all it's data from
> > tilelist to tilelist.  I'm using two arraycollections to do the
> transfer
> > and the data is being populated through an xml file.  I know it's just
> > maybe 2 or 3 lines of code that I probably need, but can someone help
> > me, please?  Thanks
> > >
> > >
> > > // SAMPLE XML FILE
> > >
> > > 
> > > 
> > > btnSkins/action_btn.png
> > > 10
> > > 
> > > 
> > > btnSkins/awards_btn.png
> > >  15
> > > 
> > > 
> > > btnSkins/beer_btn.png
> > >  20
> > > 
> > > 
> > > btnSkins/blog_btn.png
> > >  25
> > > 
> > > 
> > >
> > >
> > > // MAIN FILE
> > >
> > > 
> > > http://www.adobe.com/2006/mxml";
> > layout="horizontal" creationComplete="btnSrv.send()">
> > >
> > >  
> > >   
> > >  
> > >
> > >   > >   result="handleQueryResult(event)" showBusyCursor="true"/>
> > >
> > >   > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94"
> > rowHeight="80"
> > >   doubleClickEnabled="true" doubleClick="addButton()"/>
> > >
> > >   > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94"
> > rowHeight="80"/>
> > > 
> > >
> > >
> > > // ITEM RENDERER
> > >
> > > 
> > > http://www.adobe.com/2006/mxml"; width="108"
> > height="83">
> > >
> > >   > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/>
> > >
> > > 
> > >
> >
>




[flexcoders] Re: addItem Trouble with TileList

2009-12-22 Thread turbo_vb
Man, I always forget at least one thing.   You also need to initialize
the second ArrayCollection().


[Bindable] public var dataRight:ArrayCollection= new ArrayCollection();




Might want to give the itemRenderer a background, so that the double
clicks will be triggered on the entire area.





-TH



--- In flexcoders@yahoogroups.com, "turbo_vb"  wrote:
>
>
> Hey Sal,
> minor tweaks:
>
> public function addButton():void
>
> {
>
> dataRight.addItem( rightTiles.selectedItem );
>
> }
>
>
>
>
> and:
>
>
>
>
>
>
> 
> url="buttonData.xml"
>
> useProxy="false"
>
> result="handleQueryResult(event)"
>
> showBusyCursor="true"
>
> resultFormat="object"/>
>
>
>
>
> -TH
>
>
>
> --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@
> wrote:
> >
> > I am having trouble understanding the addItem method in AS3 with
Flex.
> I'm trying to simply add the item renderer with all it's data from
> tilelist to tilelist.  I'm using two arraycollections to do the
transfer
> and the data is being populated through an xml file.  I know it's just
> maybe 2 or 3 lines of code that I probably need, but can someone help
> me, please?  Thanks
> >
> >
> > // SAMPLE XML FILE
> >
> > 
> > 
> > btnSkins/action_btn.png
> > 10
> > 
> > 
> > btnSkins/awards_btn.png
> >  15
> > 
> > 
> > btnSkins/beer_btn.png
> >  20
> > 
> > 
> > btnSkins/blog_btn.png
> >  25
> > 
> > 
> >
> >
> > // MAIN FILE
> >
> > 
> > http://www.adobe.com/2006/mxml";
> layout="horizontal" creationComplete="btnSrv.send()">
> >
> >  
> >   
> >  
> >
> >   >   result="handleQueryResult(event)" showBusyCursor="true"/>
> >
> >   dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94"
> rowHeight="80"
> >   doubleClickEnabled="true" doubleClick="addButton()"/>
> >
> >   dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94"
> rowHeight="80"/>
> > 
> >
> >
> > // ITEM RENDERER
> >
> > 
> > http://www.adobe.com/2006/mxml"; width="108"
> height="83">
> >
> >   horizontalAlign="center" right="5" bottom="0" left="5" top="0"/>
> >
> > 
> >
>



[flexcoders] Re: addItem Trouble with TileList

2009-12-22 Thread turbo_vb

Hey Sal,
minor tweaks:

public function addButton():void

{

dataRight.addItem( rightTiles.selectedItem );

}




and:











-TH



--- In flexcoders@yahoogroups.com, "s_hernandez01" 
wrote:
>
> I am having trouble understanding the addItem method in AS3 with Flex.
I'm trying to simply add the item renderer with all it's data from
tilelist to tilelist.  I'm using two arraycollections to do the transfer
and the data is being populated through an xml file.  I know it's just
maybe 2 or 3 lines of code that I probably need, but can someone help
me, please?  Thanks
>
>
> // SAMPLE XML FILE
>
> 
> 
> btnSkins/action_btn.png
> 10
> 
> 
> btnSkins/awards_btn.png
>  15
> 
> 
> btnSkins/beer_btn.png
>  20
> 
> 
> btnSkins/blog_btn.png
>  25
> 
> 
>
>
> // MAIN FILE
>
> 
> http://www.adobe.com/2006/mxml";
layout="horizontal" creationComplete="btnSrv.send()">
>
>  
>   
>  
>
> result="handleQueryResult(event)" showBusyCursor="true"/>
>
> doubleClickEnabled="true" doubleClick="addButton()"/>
>
>  
> 
>
>
> // ITEM RENDERER
>
> 
> http://www.adobe.com/2006/mxml"; width="108"
height="83">
>
>  
>
> 
>



  1   2   >