[flexcoders] Question about FXP file type
Hey all, I am still using 3.5 with FlashBuilder and I have a question for you all. Can I take a FXP image file and embed it in Flex like a jpeg or png file? Thanks, timgerr
[flexcoders] Flex 3 Eclipse and Java
Hello all, I have over the last few years been using PHP for my back end in order to communiate to Flex. I now want to use Java and Blazeds. The problem is that I need to get a version of Eclipse that will be able to install Java and the Flex 3 SDK. I have been working for hrs to get Eclipse to mimic my developing environment, OS X at home and Windows at work. In order to get Flex 3 sdk to install into Eclipse I will have to find an old version of Eclipse. As people that user this (Java and Flex + other things) combonation of development items within Eclipse, what do / did you do to create the eniorment, and also what should I do. Thank you, Timgerr
[flexcoders] Refresh Advanced DataGrid with HierarchicalData
Hello all, I have a arraycollection that I use for a HierarchicalData data provider. If I add/change data contained within the arraycollection, how do I refresh the Advanced DataGrid? Thank you, timgerr
[flexcoders] Question/Problems extending RichTextEditor, Learning
Hello all, I want to extend the RichTextEitor and I have a problem(s) with doing so. So I wrote A action script class trying to extend the Rich Text Editor. I wanted to just add a text box to the toolbar but am getting errors, here is my code: ackage com.DaNaTiRTE { import mx.controls.RichTextEditor; import mx.controls.TextInput; public class DRTE extends RichTextEditor { public function DRTE() { //TODO: implement function super(); } private var _width:int; private var _height:int; public function SetItems():void { var t:TextInput = new TextInput(); t.width = 40; this.toolbar.addChild(t); } } } I wanted to do somthing like this when I call the code var a:DRTE = new DRTE(); a.SetItems(); addChild(a); When I do the (a.SetItems) I get an error "Error #1009: Cannot access a property or method of a null object reference.". Can someone tell me what I am doing wrong, and if so what I need to be doing correctly? I want to not just build this code but understand how to extend components. Thanks for the help and read. timgerr
[flexcoders] Build UICompenent Widgets, add drag and drop, keep widgets within Panel
Hello all, I have this panel that I have a button in. I add the ability for the button to be dragged around the panel, but I don't want the button to be dragged out of the panel? Here is my code: http://www.adobe.com/2006/mxml"; > I have done drag and drop before adding items from something to another, but not sure how to keep it in the same panel. Thank for the help, timgerr
[flexcoders] Best Java addon for Flex
Hello all, I have been coding with Flex for a few years using PHP as my back end. I am looking to learn Java, and I have a few questions. I understand the Java language from all the other programming languages that I know. If I want to interface Flex with Java, should I lean Spring or what? I am asking the group, what/how do you use Java with Flex? Thank you, Tim Gallagher
[flexcoders] Question about MouseOver and getting the UIComponent ClassName
Hello all, I am having a problem. I am using drag and drop and want to add an event listener on objects that a mouse is over. So I have this panel and then I add a label and maybe a button to the panel. I then attach to the panel, label and button an event listener mouse over to get the class name to what the mouse is hovering over. If I then hover over the label, I get the class name "Label" then "Panel", here is my simple test code: So when I hover anything that is contained within the panel I get that objects class name and the panels class name. How can I just get the class name of what I am hovering over? If I hover the panel and only the panel (lets say in the title bar) then I want to return className = Panel but if I hover anything else I want that class name. Can this be done? Thanks for the help, timgerr
[flexcoders] Re: Question about getting the type of item / component with drag and drop
What is the best way to check if it is a panel? timgerr --- In flexcoders@yahoogroups.com, Gordon Smith wrote: > > 1. if (dragEvent.currentTarget is Panel) > > 2. currentTarget is generically typed as Object, which doesn't have an > addChild() method. But if you have already checked that the dropTarget is a > Panel, it's safe to do a cast: > > Panel(dragEvent.currentTarget).addChild(...); > > Gordon Smith > Adobe Flex SDK Team > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Wednesday, December 09, 2009 12:01 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Question about getting the type of item / component > with drag and drop > > > > Hello all, > I have been tasked with creating a menu that gets build with drag and drop > components. I have followed this tutorial > (http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop) and have learned > a lot. > > I have a few questions to get to the next stage so I will ask a few questions. > > 1. When I drop (or drag over) an item like a panel, how can I tell what that > UIComponent is, how can I tell that is a panel? > > 2. How can I get that panel as an object so I can do something like > panelid.addChild(new dropped item)? > > Thanks for the read, > timgerr > > Here is the code that I have from the tutorial. > > > http://www.adobe.com/2006/mxml"; layout="absolute" > name="Drag and Drop tutorial" creationComplete="Init()"> > > > > > > > > > > >
[flexcoders] Question about getting the type of item / component with drag and drop
Hello all, I have been tasked with creating a menu that gets build with drag and drop components. I have followed this tutorial (http://www.flexafterdark.com/tutorials/Flex-Drag-and-Drop) and have learned a lot. I have a few questions to get to the next stage so I will ask a few questions. 1. When I drop (or drag over) an item like a panel, how can I tell what that UIComponent is, how can I tell that is a panel? 2. How can I get that panel as an object so I can do something like panelid.addChild(new dropped item)? Thanks for the read, timgerr Here is the code that I have from the tutorial. http://www.adobe.com/2006/mxml"; layout="absolute" name="Drag and Drop tutorial" creationComplete="Init()">
[flexcoders] How to remove object from nested arraycollection
Hello all, I have a problem, I need to remove an object from a nested array. Lets say I have this arraycollection private var people:ArrayCollection = new ArrayCollection([ new Person("Grandma Susan", new ArrayCollection([ new Person("John", new ArrayCollection([ new Person("Timmy"), new Person("Sammy"), new Person("Alan") ])), new Person("Tiffany", new ArrayCollection([ new Person("Billy"), new Person("Adam"), new Person("Graham"), new Person("Vennesa") ])), new Person("Michael", new ArrayCollection([ new Person("Jannette"), new Person("Alan", new ArrayCollection([ new Person("Alice"), new Person("Jane") ])) ])), new Person("Peter"), new Person("Cindy", new ArrayCollection([ new Person("Paul"), new Person("David"), new Person("Joseph"), new Person("Cameron"), new Person("Debra"), new Person("Polly") ])) ])) ]); How can I remove peter? Thanks, timgerr
[flexcoders] Re: Trees are killing me
Max, that was a big help. Thanks all for helping me out, this group rocks. timgerr --- In flexcoders@yahoogroups.com, "max.nachlinger" wrote: > > > > > > > Here's a bit of code that might help. > > Silly test app: - > > > http://www.adobe.com/2006/mxml"; layout="absolute" > creationComplete="_onLoad()" xmlns:local="*"> > > <![CDATA[ > import mx.events.*; > import mx.collections.ArrayCollection; > [Bindable] private var _data:ArrayCollection; > > private function _onLoad():void > { > var a:Array = []; > var o:Object = {}; > var o1:Object = {}; > var o2:Object = {}; > var o3:Object = {}; > > var c:int, d:int, e:int; > for( var i:int = 0; i < 100; i++ ) > { > c = _randIntRange(2,20); > o = {name:'Great Grand-Parent '+(i+1), children:[]}; > > for( var j:int = 0; j < c; j++ ) > { > o1 = {name:'Grand Parent '+(j+1), children:[]}; > > d = _randIntRange(1,5); > for( var k:int = 0; k < d; k++ ) > { > o2 = {name:'Parent '+(k+1), children:[]}; > > e = _randIntRange(1,2); > for( var l:int = 0; l < e; l++ ) > { > o3 = {name:'Child '+(l+1)}; > o2.children.push(o3); > } > > o1.children.push(o2); > } > > o.children.push(o1); > } > > a.push(o); > } > _data = new ArrayCollection(a); > } > private function _randIntRange( start:Number, end:Number ):int > { > return int(Math.floor(start +(Math.random() * (end - start; > } > ]]> > > labelField="name" > dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"/> > > > Silly test tree: - > > > http://www.adobe.com/2006/mxml";> > > <![CDATA[ > import mx.events.*; > import mx.controls.listClasses.*; > > private var _currentRenderer:IListItemRenderer; > private var _draggedItem:Object; > > override protected function mouseOverHandler(event:MouseEvent):void > { > super.mouseOverHandler(event); > var item:IListItemRenderer = mouseEventToItemRenderer(event); > if ( item != null && _currentRenderer != item ) > { > _currentRenderer = item; > trace(className + '::mouseMoveHandler(): ' + > _currentRenderer.data['name'] ); > } > } > > override protected function dragOverHandler(event:DragEvent):void > { > _draggedItem = event.dragSource.dataForFormat('treeItems')[0]; > trace(className + '::dragOverHandler(): dragging (' + > _draggedItem['name'] + ') over (' + _currentRenderer.data['name'] + ')' ); > } > ]]> > > > > Hope that helps a bit. > > --Max >
[flexcoders] Re: Trees are killing me
I have no idea how to use this, I have been googleing it but can only find references when people extend classes. Anyone know how to use mouseEventToItemRenderer??? Really thanks for the help, this problem has been a thorn in my side for a long time. timgerr --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > Should be mouseEventToItemRenderer(dragEvent).data > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Friday, October 09, 2009 7:03 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Trees are killing me > > > > OK, I am now hanging my hat in hand. I need help with a method to get the > object of the folder that I am over, I have no idea how to do this. PLEASE > HELP! > > Thanks, maybe I can get my dignity back. > > timgerr
[flexcoders] Re: Trees are killing me
OK, I am now hanging my hat in hand. I need help with a method to get the object of the folder that I am over, I have no idea how to do this. PLEASE HELP! Thanks, maybe I can get my dignity back. timgerr --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > You should be getting DRAG_OVER events. The dragSource contains the object > being dragged. You can use mouseEventToItemRenderer to get the renderer you > are currently over. > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Tuesday, October 06, 2009 8:54 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Trees are killing me > > > > Thanks for the response, I have a question for ya. I am dragging with in a > tree, how can I get the object that I am dragging and when I drag over > something how can I get that object. I am using an arraycollection. > > Thanks again for the help. > timgerr > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex > Harui wrote: > > > > I see. You don't want to allow dropping at the top-level. > > > > I think you can get the DRAG_OVER event, look at where the mouse is, and > > call event.preventDefault() > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc.<http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On > > Behalf Of timgerr > > Sent: Monday, October 05, 2009 2:18 PM > > To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Re: Trees are killing me > > > > > > > > I am creating an app that folders are groups and leafs are users. I want > > users in groups (folders) only. > > > > Tim > > > > --- In > > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>, > > Alex Harui wrote: > > > > > > You have folders mixed with non-folders and you only want to allow > > > dropping on the folder rows? Why not allow dropping on the leaf rows? > > > > > > Alex Harui > > > Flex SDK Developer > > > Adobe Systems Inc.<http://www.adobe.com/> > > > Blog: http://blogs.adobe.com/aharui > > > > > > From: > > > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com> > > > > > > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com>] > > > On Behalf Of timgerr > > > Sent: Monday, October 05, 2009 10:28 AM > > > To: > > > flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com><mailto:flexcoders%40yahoogroups.com> > > > Subject: [flexcoders] Trees are killing me > > > > > > > > > > > > Hello all, > > > I was wondering if someone could help me. I have a tree with 3 folders, > > > how can I make sure nodes get dropped into the folders? > > > > > > Thank for the look, > > > timgerr > > > > > >
[flexcoders] Re: Trees are killing me
Thanks for the response, I have a question for ya. I am dragging with in a tree, how can I get the object that I am dragging and when I drag over something how can I get that object. I am using an arraycollection. Thanks again for the help. timgerr --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > I see. You don't want to allow dropping at the top-level. > > I think you can get the DRAG_OVER event, look at where the mouse is, and call > event.preventDefault() > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Monday, October 05, 2009 2:18 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Trees are killing me > > > > I am creating an app that folders are groups and leafs are users. I want > users in groups (folders) only. > > Tim > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex > Harui wrote: > > > > You have folders mixed with non-folders and you only want to allow dropping > > on the folder rows? Why not allow dropping on the leaf rows? > > > > Alex Harui > > Flex SDK Developer > > Adobe Systems Inc.<http://www.adobe.com/> > > Blog: http://blogs.adobe.com/aharui > > > > From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On > > Behalf Of timgerr > > Sent: Monday, October 05, 2009 10:28 AM > > To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Trees are killing me > > > > > > > > Hello all, > > I was wondering if someone could help me. I have a tree with 3 folders, how > > can I make sure nodes get dropped into the folders? > > > > Thank for the look, > > timgerr > > >
[flexcoders] Re: Trees are killing me
I am creating an app that folders are groups and leafs are users. I want users in groups (folders) only. Tim --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > You have folders mixed with non-folders and you only want to allow dropping > on the folder rows? Why not allow dropping on the leaf rows? > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Monday, October 05, 2009 10:28 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Trees are killing me > > > > Hello all, > I was wondering if someone could help me. I have a tree with 3 folders, how > can I make sure nodes get dropped into the folders? > > Thank for the look, > timgerr >
[flexcoders] Trees are killing me
Hello all, I was wondering if someone could help me. I have a tree with 3 folders, how can I make sure nodes get dropped into the folders? Thank for the look, timgerr
[flexcoders] Re: Drag and drop into Advanced Datagrid
I have this advanced datagrid and I want to make sure that anything dropped into the grid can only go into a folder, can this happen? Thanks timgerr --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > I was wondering if there are any examples of Drag and Drop into an advanced > datagrid with an array collection as the data provider? > > Thanks for the help. > timgerr >
[flexcoders] Drag and drop into Advanced Datagrid
I was wondering if there are any examples of Drag and Drop into an advanced datagrid with an array collection as the data provider? Thanks for the help. timgerr
[flexcoders] Embed image source with a url?
Hello all, I am in need of a way to store a picture for using in my application. I will be using this picture as an avatar so I dont want to have to call it from a url every time I need it. I would like to do somting like this: [Embed(source="http://mydomain/somepics.jpeg";)] [Bindable] public var Logo:Class; How can I store an image into a class, or how can I reuse an image?? Thanks timgerr
[flexcoders] Re: String validators and turning off the red
Thank you, that worked well timgerr --- In flexcoders@yahoogroups.com, "Tim Hoff" wrote: > > > Here's a simple way: > > > http://www.adobe.com/2006/mxml"; > layout="absolute"> > > > > > > > > > > > > property="text" enabled="true"/> > > > > -TH >
[flexcoders] Re: Problem with Flex tree and arraycollection
That was the problem, I had an entry in each object of the arrayobject called uid. I changed this and I was good to go. Thanks for the help, I would have killed myself trying to get this one timgerr --- In flexcoders@yahoogroups.com, Alex Harui wrote: > > If there are duplicate items (items with the same UID) it may not work > correctly > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Wednesday, July 22, 2009 2:03 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Problem with Flex tree and arraycollection > > > > Hello all, > I have troubles with my trees when I use an array collection. What happens is > the highlighting doesn't work, I can highlight some things nodes but not > others. Anyone have this happen? > > Thanks, > timgerr >
[flexcoders] Problem with Flex tree and arraycollection
Hello all, I have troubles with my trees when I use an array collection. What happens is the highlighting doesn't work, I can highlight some things nodes but not others. Anyone have this happen? Thanks, timgerr
[flexcoders] String validators and turning off the red
Hello all, I have a question for ya. I have a text input that I attach a string validator so the text input is required. So I put my mouse in the box then take it out, not the box is red. I then hit a button to turn the string validator off, but the box remains red. How can I tell a text input to not be red anymore. Here is some code: http://www.adobe.com/2006/mxml"; layout="absolute"> Thanks, Timgerr
[flexcoders] Anyone Using Kap Lab Datagrammer, I have a question about getting child nodes
Hey all, If you use Kap Lab Diagrammer, if you delete a node, how do you delete all the child nodes? Is there a place (array or arraycollection) that holds all the created/showing elements If you have any information, please help a brother out :) Thanks, timgerr
[flexcoders] Re: Getting an error when using a tree as a component
OK, Here is what I did. I wanted to know if there was a problem with my code or was it the tree stuff. I went to Adobe Live Docs to get a tree example (http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&file=dragdrop_081_06.html). I took this code and created a Canvas Component from it. I then created an app and called the code from it. I then called the app and when I click on any of the items in the tree I get this error: ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display::DisplayObjectContainer/getChildIndex() at mx.managers::SystemManager/getChildIndex()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:1652] at mx.managers::SystemManager/mouseDownHandler()[C:\autobuild\3.2.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:3439] Here is the code that I used for the component CallTree.mxml: [CODE] http://www.adobe.com/2006/mxml"; width="700" height="250" borderStyle="solid"> [/CODE] Here is the application that is calling CallTree.mxml [CODE] http://www.adobe.com/2006/mxml"; width="700" height="250" borderStyle="solid" creationComplete="CallMeNow()"> [/CODE] I am not sure what to do here. Thanks for the read, timgerr
[flexcoders] Re: Getting an error when using a tree as a component
OK, Here is some code, this is my tree Component: [START] http://www.adobe.com/2006/mxml"; layout="absolute" creationComplete="Init();"> [/START] Here is my code calling the tree component: [START] http://www.adobe.com/2006/mxml"; layout="absolute" creationComplete="Init();"> [/START]
[flexcoders] Getting an error when using a tree as a component
Hello all, I was wondering if this error makes sense? I have this tree that I made into a component. When I run the script, I see the tree but when I try and click on one of the folders I get this error "The supplied DisplayObject must be a child of the caller." Anyone know what this means Thanks, timgerr
[flexcoders] Re: Add items to an array list as a child
That did it, now how do you get the text to change color in your code here in the Groups??? thanks, timgerr --- In flexcoders@yahoogroups.com, Charles Parcell wrote: > > Going out on a limb here but try changing the one line of code that injects > an child object to... > > Object(myCollection[0]).children= obj; > > Charles P. > > >
[flexcoders] Re: Add items to an array list as a child
Thanks for the response, I have a question about arraycollection and trees. If I do this: var myCollection:ArrayCollection = new ArrayCollection([{first: 'Matt', last:'Matthews'}, {first: 'Tom', last: 'Jones'}]); var obj:Object = new Object(); obj.first = 'lisa'; obj.last = 'griffen'; Object(myCollection[0]).obj = obj; then create a tree: I only see the first 2 names, Matt and Tom. How do I have the new object show as a child of the Matt? Thanks, timgerr PS, how did you do he color in your code --- In flexcoders@yahoogroups.com, "Tim Hoff" wrote: > > > Ah, ok. The first item in the arrayCollection is an Object. So, you > would have to do something like this: > > var myCollection:ArrayCollection = new ArrayCollection([{first: 'Matt', > last:'Matthews'}, {first: 'Tom', last: 'Jones'}]); > > var obj:Object = new Object(); > obj.first = 'lisa'; > obj.last = 'griffen'; > > Object(myCollection[0]).obj = obj; > > -TH > > --- In flexcoders@yahoogroups.com, "timgerr" tgallagher@ wrote: > > > > I want to add it as a child to the first item in the arraycollection > (myCollection[0]). Can this be done??? > > > > Thanks, > > timgerr > > > > --- In flexcoders@yahoogroups.com, "Tim Hoff" TimHoff@ wrote: > > > > > > > > > Have you tried myCollection.addItemAt(obj,0);? > > > > > > -TH > > > > > > --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > > > > > > > I want to add items to an arraycollection as a child > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "timgerr" tgallagher@ wrote: > > > > > > > > > > Hello all, > > > > > I have a question for you all. I was wondering how I can add a > child > > > to an object within a arraycollection. Here is what I mean: > > > > > var myCollection:ArrayCollection = new ArrayCollection([{first: > > > 'Matt', last: 'Matthews'}, {first: 'Tom', last: 'Jones'}]); > > > > > > > > > > var obj:Object = new Object(); > > > > > obj.first = 'lisa'; > > > > > obj.last = 'griffen'; > > > > > > > > > > I would like to add the new object to be a child of the first > item > > > in the array list. Can this be done?? > > > > > > > > > > Thanks, > > > > > timgerr > > > > > > > > > > > > > > >
[flexcoders] Re: Add items to an array list as a child
I want to add it as a child to the first item in the arraycollection (myCollection[0]). Can this be done??? Thanks, timgerr --- In flexcoders@yahoogroups.com, "Tim Hoff" wrote: > > > Have you tried myCollection.addItemAt(obj,0);? > > -TH > > --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > > > I want to add items to an arraycollection as a child > > > > > > --- In flexcoders@yahoogroups.com, "timgerr" tgallagher@ wrote: > > > > > > Hello all, > > > I have a question for you all. I was wondering how I can add a child > to an object within a arraycollection. Here is what I mean: > > > var myCollection:ArrayCollection = new ArrayCollection([{first: > 'Matt', last: 'Matthews'}, {first: 'Tom', last: 'Jones'}]); > > > > > > var obj:Object = new Object(); > > > obj.first = 'lisa'; > > > obj.last = 'griffen'; > > > > > > I would like to add the new object to be a child of the first item > in the array list. Can this be done?? > > > > > > Thanks, > > > timgerr > > > > > >
[flexcoders] Re: Add items to an array list as a child
I want to add items to an arraycollection as a child --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > Hello all, > I have a question for you all. I was wondering how I can add a child to an > object within a arraycollection. Here is what I mean: > var myCollection:ArrayCollection = new ArrayCollection([{first: 'Matt', last: > 'Matthews'}, {first: 'Tom', last: 'Jones'}]); > > var obj:Object = new Object(); > obj.first = 'lisa'; > obj.last = 'griffen'; > > I would like to add the new object to be a child of the first item in the > array list. Can this be done?? > > Thanks, > timgerr >
[flexcoders] Add items to an array list as a child
Hello all, I have a question for you all. I was wondering how I can add a child to an object within a arraycollection. Here is what I mean: var myCollection:ArrayCollection = new ArrayCollection([{first: 'Matt', last: 'Matthews'}, {first: 'Tom', last: 'Jones'}]); var obj:Object = new Object(); obj.first = 'lisa'; obj.last = 'griffen'; I would like to add the new object to be a child of the first item in the array list. Can this be done?? Thanks, timgerr
[flexcoders] How to do a function/method in a Tree for the label
Hello all, I am having some troubles with the tree control and an array collection. I have this tree and the data provider is pointing to an array collection. This is working great, I now have to create a label function for the labelField. So this is what I did: public function TreeNodeLabel(obj:Object):String { return obj.name; } Here is my MXML code: What am I supposed to use as the argument in the mxml code for the this.TreeNodeLabel() ? Thanks, timgerr
[flexcoders] Question about ASDocs
When I run ASDocs on a project that works fine, I get some errors that somthing was not found at compile time. Is there a way to turn off errors and just write the documentation??? Thanks, timgerr
[flexcoders] Datagrid Goofy Problem cannot select rows
Hello all, I am creating a message board forum and I am using the datagrid to show message topics. I add a new topic, via flex text input box, it gets sent to a PHP Weborb back end and the datagrid will then be updated. So lets say I do not have any topics, I will add the first one, I can then take my mouse and select that row. When my mouse hovers over the item, the row is highlighted (this is done by default, a feature of the datagrid). If I create another topic, I am unable to highlight any other row except for the latest one that was updated. I am not sure what to look for here. Here is my mxml datagrid : Any Ideas??? thanks, timgerr
[flexcoders] Re: Has anyone done a file upload and download, store data into database
Sorry for not being clear. I want to transfer a file (image or document) to my back end PHP using flex. I then want PHP to convert the file to binary and store the data into a database. I think I know how to do that. I then want to be able to retrieve that data from a query to the back end via flex and then have the user download the file (in the correct file format). Can the 2nd part be done with flex, retrieving the file??? Thanks, timgerr --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > Can you be more clear on what you want? "Download" typically means to take > a physical file from a remote file system and save it in a local filesystem. > There is no "conversion" involved. > > > > Perhaps you do not mean "download"? What kinds of file formats are you > talking about, and what do you want to do with the data in the Flex client? > > > > Tracy Spratt, > > Lariat Services, development services available > > _
[flexcoders] Re: Has anyone done a file upload and download, store data into database
I have seen many for uploading something then storing the item in a directory. I think I can figure the upload out, but the download part I am not sure how to do. I don't know how to take binary data and convert it to a picture or document. If you know of a link that shows this being done, can you please post it??? Thanks, timgerr --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > Yes, it is not difficult. The examples in the docs are nearly usable as > they are. > > > > Tracy Spratt, > > Lariat Services, development services available > > _ > > From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On > Behalf Of timgerr > Sent: Wednesday, April 01, 2009 2:38 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Has anyone done a file upload and download, store data > into database > > > > I am in need of a flex app that will upload a file and that file will go > into a database using PHP backed. I know what most of this has to do with > PHP, I am not sure how to take the data out of flex and hand it back to the > user via flex. Has anyone done something like this? > > Thank you, > timgerr >
[flexcoders] Has anyone done a file upload and download, store data into database
I am in need of a flex app that will upload a file and that file will go into a database using PHP backed. I know what most of this has to do with PHP, I am not sure how to take the data out of flex and hand it back to the user via flex. Has anyone done something like this? Thank you, timgerr
[flexcoders] Re: Question an how to create dynamic content with Flex
Never mind, I am a goof. timgerr --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > Hello all, > I am creating an application that is a windowed system, I mean that I have > windows that will launch and you can move them around. I have ad to create > all my content dynamically in Action Script because when my windows close I > remove the object. > > Here is my question for y'all, can I create flex code dynamically, if so how > can I do it? Meaning that if I remove the Flex code widget object can I > create it again? > > Thanks for the information. > > timgerr >
[flexcoders] Question an how to create dynamic content with Flex
Hello all, I am creating an application that is a windowed system, I mean that I have windows that will launch and you can move them around. I have ad to create all my content dynamically in Action Script because when my windows close I remove the object. Here is my question for y'all, can I create flex code dynamically, if so how can I do it? Meaning that if I remove the Flex code widget object can I create it again? Thanks for the information. timgerr
[flexcoders] Re: Dynamic Accordion
Thanks all for the response, I am not sure what I am doing wrong. I tried the example from valdhor and I get errors when I run it. I decided to create a small example and run it. When I do, the single vbox that I created is repeated until I close my browser. Can someone tell me what I am doing wrong??? Thanks for the help all: http://www.adobe.com/2006/mxml"; layout="vertical" creationComplete="Testing()"> Tim --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > You may be making this hard. I do dynamic Accordions using repeater, works > great. If you really are insistent on AS only, then use addChild(). > Accordion is just a navigation container. > > > > Tracy Spratt, > > Lariat Services, development services available > >
[flexcoders] Re: Dynamic Accordion
So I have been reading actionscript on how to do this and I am running into some troubles, I seem to have to use createSegment but I dont see it in flex, here is what I mean: var a:Accordion = new Accordion(); a.createSegment("Some Parameters"); I dont get a.createSegment in my list of things I can add to a. What am I doing wrong? Thanks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > Can some one point me to an example of an accordion done in actionscript? I > want to create a menu with an accordion in it in actionscript but cannot find > any examples on how to do the accordion. > > Thanks, > > timgerr >
[flexcoders] Dynamic Accordion
Can some one point me to an example of an accordion done in actionscript? I want to create a menu with an accordion in it in actionscript but cannot find any examples on how to do the accordion. Thanks, timgerr
[flexcoders] Getting Error when trying to destroy a tooltip
Hello all, I am creating my own tooltip and I am getting an error, this code comes from adobe examples. Here is the code: http://www.adobe.com/2006/mxml";> Panel { paddingLeft: 5; paddingRight: 5; paddingTop: 5; paddingBottom: 5; } I get this error: Implicit coercion of a value of type ToolTip to an unrelated type mx.core:IToolTip. At this piece of code: ToolTipManager.destroyToolTip(myTip); Can someone tell me what I am doing wrong? Thank you, Tim Gallagher
[flexcoders] Find the middel of the screen
I have to use layout="absolute" in my flex app, is there a way to find the x and y values of the middle of the screen? Thanks, timgerr
[flexcoders] Need help gettig weborb and my flex project working after compuer reimage...
Hello all, I need some help. I am pulling my hair out. I have been working on a flex project for about a year now and I had some problems with my computer. I put in a new hard drive (Got all the data off the old one) and set xampp, weborb up all the same. When I debug my project my Flex app runs, and on start A weborb request is done and fails with this error in Flex coming from the FaultEvent. The error is "Server reported an error - Send failed". My debug path is C:\xampp\htdocs\weborb\pjhome-debug. Here is the return error from Charles: http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en"> Object not found! mailto:ad...@localhost"; /> <!--/*--> <![CDATA[/*><!--*/ body { color: #00; background-color: #FF; } a:link { color: #CC; } p, address {margin-left: 3em;} span {font-size: smaller;} /*]]>*/--> Object not found! The requested URL was not found on this server. The link on the http://localhost/weborb/pjhome/pjhome.swf";> referring page seems to be wrong or outdated. Please inform the author of http://localhost/weborb/pjhome/pjhome.swf";> that page about the error. If you think this is a server error, please contact the mailto:ad...@localhost";> webmaster . Error 404 localhost 03/07/09 00:21:40 Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 Since my build path is C:\xampp\htdocs\weborb\pjhome-debug, and the page comes up. Why is weborb sending a response request to http://localhost/weborb/pjhome/pjhome.swf ?? I am pulling my hair out on this one, Please help. Thanks for the read, timgerr
[flexcoders] mysqli, Weborb, and getting username and password from include or method
Hello all, I have started using stored procedures for my MySql queries so to call the stored procedures I use mysqli. The problem is that I have a class and one of my public methods calls private methods to do the work. Here is what I mean. Class Tree{ var $mysqli; var $finalArry; var $collectArry; var $dUName; var $dPWord; var $dHost; var $dDB; public function Tree() { $this->finalArry = array(); $this->collectArry = array(); } public function MasterCall(SB $obj) { switch($obj->call){ case "BuildTreeStructure": $called = $this->BuildTreeStructure($obj); break; case "AddNewNode": $called = $this->AddNewNode($obj); break; } return $called; } private function AddNewNode($obj) { /* Calling the SQL stored procedure AddNodeSP */ $mysqli = new mysqli('localhost', 'root', '', 'MeDatabase'); if (mysqli_connect_errno( )) { printf("Connect failed: %s\n", mysqli_connect_error( )); exit ( ); } else { // printf("Connect succeeded\n"); } $sql = "CALL AddNodeSP('$obj->parentCBSid','$obj->rootCBSid','$obj->newNode')"; $mysqli->query($sql); if ($mysqli->errno) { die("Execution failed: ".$mysqli->errno.": ".$mysqli->error); } $getTree = $this->BuildTreeStructure($obj); return $getTree; } } Class SB { var $parentCBSid; var $rootCBSid; var $newNode; var $call; var $user; var $pass; var $host; var $db; } so in my AddNewNode method I have a mysqli connection : $mysqli = new mysqli('localhost', 'root', '', 'MeDatabase'); I dont want to have to add this line everytime I do this because if I have to change my password. SO I created a password file and did an include: In the AddNewNode method I do this require_once('PasswordFile.php'); $mysqli = new mysqli('localhost',$user,$pass,$db); When I run this script from a webpage (remember I am using this as a service from Webord) It works fine. When I run my flex app, I get an error in charles : Warning: mysqli::mysqli() [function.mysqli-mysqli]: (28000/1045): Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\weborb\Services\com\ArrayTree\Tree.php on line 100 Connect failed: Access denied for user 'ODBC'@'localhost' (using password: NO) Anyone know how I can use a password file with Weborb, mysqli, and Flex? Thanks for the read, timgerr
[flexcoders] Change Color of panel from a function
Hello all, I am having troubles finding information on how to change the border color of a panel from a function, here is my code: private function EditMe():void { Not sure what to put here } I don't see the ability to change the color when I do editPanel. . Thanks for the help, timgerr
[flexcoders] Weborb to return XML data
I have been working with weborb and I think it is great. I am working on a graph that needs XML data that I have generated via php and mysql. I was wondering of Weborb can return XML and if you have any examples of this. Thanks for the, timgerr
[flexcoders] SpringGraph and ArrayCollection
Has anyone used an arraycollection with a springgraph? thanks for the help, timgerr
[flexcoders] Re: Flex nested tree get data from mysql and php
So I took a few days to figure out how to create a parent child array using left, right keys and parent child relationship. You can use this code how ever you want. You have to have a table that holds left, right and parent information. parentString; $this->tempArry = array(); $this->collectArry = array(); $this->parentArry = array(); } public function BuildTree($name) { /* setting up the database */ if(!$dbconnect = mysql_connect('localhost', 'root')) { echo "Connection failed to the host 'localhost'."; exit; } if (!mysql_select_db('UrDataBase')) { echo "Cannot connect to database 'test'"; exit; } $table_id = 'dnt_cbs_table'; // Table name $query = "SELECT node.name, node.CBSid, node.PARid FROM $table_id AS node, $table_id AS parent WHERE node.L BETWEEN parent.L AND parent.R AND parent.name = '$name' ORDER BY node.L"; $result = mysql_query($query); while($row=mysql_fetch_object($result)){ $this->parentArry[] = $row->PARid; $this->collectArry[] = $row; } $this->CleanParentString(); return $this->tempArry[0][0]; } /** * CleanParentString() * This will break the $this->parentString into an array, remove duplicate numbers * then reassemble the array into a string ($this->parentString) ordered from lowest * to highest */ public function CleanParentString() { $temp = array_unique($this->parentArry); $this->parentArry = array_reverse($temp); $this->GroupCommonChildObjects(); } /** * GroupCommonChildObjects() * This will first get the last digit in the $this->parentString and then loop through * the array ($this->collectArry[]->parent) to make matches. If there is a match then * the object ($this->collectArray[]) is grouped in a temporary array. This temporary * array is then added to $this->tempArry; */ public function GroupCommonChildObjects() { for($e=0;$eparentArry);$e++){ $arr = array(); for($i=0;$icollectArry);$i++){ if($this->collectArry[$i]->PARid == $this->parentArry[$e]){ $arr[] = ($this->collectArry[$i]); } } $this->tempArry[] = ($arr); } $this->DoTheWork(); } public function FindParent($num,$childArry) { for($i=0;$itempArry);$i++){ for($x=0;$xtempArry[$i]);$x++){ if($this->tempArry[$i][$x]->CBSid == $num){ $this->tempArry[$i][$x]->children = $childArry; } } } } public function DoTheWork() { while(count($this->tempArry)>1){ $this->FindParent($this->tempArry[0][0]->PARid, $this->tempArry[0]); array_shift($this->tempArry); } } } --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello all, > I am working with nested arrayobjects and I cannot construct the > needed data from my php/mysql backend. > > I am using nested sets > (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), > with left and right keys. I need to construct the data (in php) and > pass it to flex (using a remote call). I need/want to get the data to > flex and put it into an arraycollection. Has any one done this? If > so, can you post some code? I have been banging my head on this for a > long time and cannot get the data into the right format for an array > collection. > > Thanks for the help, > timgerr >
[flexcoders] Re: Flex nested tree get data from mysql and php
So I am trying to build a MPTT (nested tree) object in php, I have a few questions for this group because I am not sure how the data should be returned. I have been using static data and have a few questions on what is contained within the data. Here is my arraycollection: private var myDataProvider:ArrayCollection = new ArrayCollection([ Region:"Southwest",ID:"1",Territory_Rep:"Tom Jones", children: [ {Region:"Arizona",ID:"2", children: [ {Territory_Rep:"Barbara Jennings", ID:"3"}, {Territory_Rep:"Dana Binn",ID:"4"}]}, {Region:"Central California",ID:"5", children: [ {Territory_Rep:"Joe Smith", ID:"6"}]}, {Region:"Nevada", ID:"7", children: [ {Territory_Rep:"Bethany Pittman",ID:"8"}]}, {Region:"Northern California", ID:"9", children: [ {Territory_Rep:"Lauren Ipsum",ID:"10"}, {Territory_Rep:"T.R. Smith",ID:"11"}]}, {Region:"Southern California",ID:'12', children: [ {Territory_Rep:"Alice Treu", ID:'13'}, {Territory_Rep:"Jane Grove",ID:"14"}]} ]} ]); I am in need of some guidance, so bear with me :). I think that this is an object {Territory_Rep:"Joe Smith", ID:"6"}, is this an array with an object {Region:"Central California",ID:"5", children: [ {Territory_Rep:"Joe Smith", ID:"6"}]} ? Here is my problem, I am creating some php data returns to flex with arrays, object, assoc arrays. I am not sure what a flex arraycollection is so I am running some tests. Here are some tests that I have done, Example #1 PHP CODE $o1->name = 'Tom'; $o1->status = 'Dad'; $o2->name = 'Wendy'; $o2->status = 'Daughter'; $b[] = $o2; $o1->child = $b; $arr[] = $o1; return $arr; Charles Proxy Sees This: com.mptt.MPTT.GetTree Parameters Results [0] name status child [0] name status Example #2 $o1->name = 'Tom'; $o1->status = 'Dad'; $o2->name = 'Wendy'; $o2->status = 'Daughter'; $o1->child = $o2; $arr[] = $o1; return $arr; com.mptt.MPTT.GetTree Parameters Results [0] name status child name status Example #3 $o1->name = 'Tom'; $o1->status = 'Dad'; $o2->name = 'Wendy'; $o2->status = 'Daughter'; $o1->child = $o2; return $o1; com.mptt.MPTT.GetTree Parameters Results name status child name status So when I return the 3 examples int an arraycollection: var ac:ArrayCollection = new ArrayCollection(result.result as Array); and use that array collection as a dataprovider for a combobox Only example 1 and 2 return anything and that is only the first name, none of the child names propagate the Combobox. So my question with all of this, how (what format) should I return my data from php to flex so I can add it (the data) to an arraycollection. Thanks for all the help, this group rocks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello all, > I am working with nested arrayobjects and I cannot construct the > needed data from my php/mysql backend. > > I am using nested sets > (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), > with left and right keys. I need to construct the data (in php) and > pass it to flex (using a remote call). I need/want to get the data to > flex and put it into an arraycollection. Has any one done this? If > so, can you post some code? I have been banging my head on this for a > long time and cannot get the data into the right format for an array > collection. > > Thanks for the help, > timgerr >
[flexcoders] Re: Flex nested tree get data from mysql and php
Amy, as always, you rock, that url was a good read. My problem is I am not sure how many children I will have or what the structure will look like. I am doing a tree so I can have n number of nodes or children, and I am not sure how to build the return object/array. Thanks for the read. timgerr --- In flexcoders@yahoogroups.com, "Amy" <[EMAIL PROTECTED]> wrote: > > --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > > > Hello all, > > I am working with nested arrayobjects and I cannot construct the > > needed data from my php/mysql backend. > > > > I am using nested sets > > (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), > > with left and right keys. I need to construct the data (in php) and > > pass it to flex (using a remote call). I need/want to get the data to > > flex and put it into an arraycollection. Has any one done this? If > > so, can you post some code? I have been banging my head on this for a > > long time and cannot get the data into the right format for an array > > collection. > > My client felt it wasn't appropriate to send all the data at once, so > the way I work it is to have a manager class that tells each child node > to load all of its children one at a time, using an event model that > allows for interruptions when the user selects something so that then > it concentrates on the children of the selected node. > > But you might find this article a good start to the way you want to do > it: > http://www.insideria.com/2008/04/amf3-php-server-objects-to-fle.html >
[flexcoders] Flex nested tree get data from mysql and php
Hello all, I am working with nested arrayobjects and I cannot construct the needed data from my php/mysql backend. I am using nested sets (http://dev.mysql.com/tech-resources/articles/hierarchical-data.html), with left and right keys. I need to construct the data (in php) and pass it to flex (using a remote call). I need/want to get the data to flex and put it into an arraycollection. Has any one done this? If so, can you post some code? I have been banging my head on this for a long time and cannot get the data into the right format for an array collection. Thanks for the help, timgerr
[flexcoders] Get parent object in an array collection
Hello all, I am using an array collection as a dataprovider for the Kap Lab (http://lab.kapit.fr/display/visualizer/Visualizer) which is like a spring graph. So when I click on an end node, I get the id of the node. If I have an id to an object, how can find the parent object and get access to it? Has anyone done this before? Here is my ArrayCollection: private var myDataProvider:ArrayCollection = new ArrayCollection([ {Region:"Southwest",ID:"1", children: [ {Region:"Arizona",ID:"2", children: [ {Territory_Rep:"Barbara Jennings", ID:"3"}, {Territory_Rep:"Dana Binn",ID:"4"}]}, {Region:"Central California",ID:"5", children: [ {Territory_Rep:"Joe Smith", ID:"6"}]}, {Region:"Nevada", ID:"7", children: [ {Territory_Rep:"Bethany Pittman",ID:"8"}]}, {Region:"Northern California", ID:"9", children: [ {Territory_Rep:"Lauren Ipsum",ID:"10"}, {Territory_Rep:"T.R. Smith",ID:"11"}]}, {Region:"Southern California",ID:'12', children: [ {Territory_Rep:"Alice Treu", ID:'13'}, {Territory_Rep:"Jane Grove",ID:"14"}]} ]} ]); Thanks for the read, happy TGiving , timgerr
[flexcoders] Re: Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid
I have the dateField in an exitable Flex component within a DataGrid. The field is empty and when I hit the dateField I get the error. timgerr --- In flexcoders@yahoogroups.com, "Fotis Chatzinikos" <[EMAIL PROTECTED]> wrote: > > are you passing an empty string as a date? > > >> cannot convert "" to Date > > On Thu, Nov 20, 2008 at 5:32 PM, timgerr <[EMAIL PROTECTED]> wrote: > > > TypeError: Error #1034: Type Coercion failed: cannot convert "" to Date. > > at mx.controls::DateField/set > > > > data()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DateField.as:735] > > at > > > > mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:4755] > > at flash.events::EventDispatcher/dispatchEventFunction() > > at flash.events::EventDispatcher/dispatchEvent() > > at > > > > mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9051] > > at > > > > mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:3676] > > at > > > > mx.controls::DataGrid/updateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:1498] > > at > > > > mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3281] > > at > > > > mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] > > at > > > > mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:675] > > at Function/http://adobe.com/AS3/2006/builtin::apply() > > at > > > > mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] > > at > > > > mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] > > at flash.utils::Timer/_timerDispatch() > > at flash.utils::Timer/tick() > > > > > > --- In flexcoders@yahoogroups.com , Alex > > Harui wrote: > > > > > > Please use a debug build and post the complete stacktrace. > > > > > > From: flexcoders@yahoogroups.com [mailto: > > flexcoders@yahoogroups.com ] > > On Behalf Of timgerr > > > Sent: Wednesday, November 19, 2008 8:46 AM > > > To: flexcoders@yahoogroups.com > > > Subject: [flexcoders] Re: Error #1034: Type Coercion failed: cannot > > convert "" to Date w/ Datagrid > > > > > > > > > Alex thanks for the reply, I am still getting the same error. > > > > > > timgerr > > > > > > --- In > > flexcoders@yahoogroups.com > flexcoders%40yahoogroups.com >, Alex > > Harui wrote: > > > > > > > > editorDataField="selectedDate" > > > > > > > > From: > > flexcoders@yahoogroups.com > flexcoders%40yahoogroups.com > > > [mailto:flexcoders@yahoogroups.com > flexcoders%40yahoogroups.com >] > > > On Behalf Of timgerr > > > > Sent: Tuesday, November 18, 2008 9:32 PM > > > > To: flexcoders@yahoogroups.com > flexcoders%40yahoogroups.com > > > > > Subject: [flexcoders] Error #1034: Type Coercion failed: cannot > > > convert "" to Date w/ Datagrid > > > > > > > > > > > > Hello all, > > > > I am trying to add a datefield to a datagrid using a itemEditor. I > > > > have seen that people are having this problem but I canot find a > > > > solution (That I understand). Has anyone ever had this problem and > > > > what did you do to solve it. Here is my code: > > > > > > > > > > > > > > > > > > > > > > > > > > > dataField="date_achieved" editorDataField="text"> > > > > > > > > > > > > > > > yearNavigationEnabled="true" toolTip="Format:DD-MM-YY"/> > > > > > > > > > > > > > > > > > > > > > > > > Thanks for the read, > > > > timgerr > > > > > > > > > > > > > > > > > -- > Fotis Chatzinikos, Ph.D. > Founder, > Phinnovation > [EMAIL PROTECTED], >
[flexcoders] Question about a component Kap Lab Diagrammer
Has anyone used this component? It does not have any community support for it? Thanks for the read, timgerr
[flexcoders] Re: Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid
TypeError: Error #1034: Type Coercion failed: cannot convert "" to Date. at mx.controls::DateField/set data()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DateField.as:735] at mx.controls::DataGrid/itemEditorItemEditBeginHandler()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:4755] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.core::UIComponent/dispatchEvent()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:9051] at mx.controls::DataGrid/commitEditedItemPosition()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:3676] at mx.controls::DataGrid/updateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\DataGrid.as:1498] at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3281] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:602] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:675] at Function/http://adobe.com/AS3/2006/builtin::apply() at mx.core::UIComponent/callLaterDispatcher2()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8460] at mx.core::UIComponent/callLaterDispatcher()[E:\dev\3.0.x\frameworks\projects\framework\src\mx\core\UIComponent.as:8403] at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick() --- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote: > > Please use a debug build and post the complete stacktrace. > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr > Sent: Wednesday, November 19, 2008 8:46 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Re: Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid > > > Alex thanks for the reply, I am still getting the same error. > > timgerr > > --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex Harui wrote: > > > > editorDataField="selectedDate" > > > > From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] > On Behalf Of timgerr > > Sent: Tuesday, November 18, 2008 9:32 PM > > To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > > Subject: [flexcoders] Error #1034: Type Coercion failed: cannot > convert "" to Date w/ Datagrid > > > > > > Hello all, > > I am trying to add a datefield to a datagrid using a itemEditor. I > > have seen that people are having this problem but I canot find a > > solution (That I understand). Has anyone ever had this problem and > > what did you do to solve it. Here is my code: > > > > > > > > > > > > > dataField="date_achieved" editorDataField="text"> > > > > > > > yearNavigationEnabled="true" toolTip="Format:DD-MM-YY"/> > > > > > > > > > > > > Thanks for the read, > > timgerr > > >
[flexcoders] Re: Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid
Alex thanks for the reply, I am still getting the same error. timgerr --- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote: > > editorDataField="selectedDate" > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr > Sent: Tuesday, November 18, 2008 9:32 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid > > > Hello all, > I am trying to add a datefield to a datagrid using a itemEditor. I > have seen that people are having this problem but I canot find a > solution (That I understand). Has anyone ever had this problem and > what did you do to solve it. Here is my code: > > > > > > dataField="date_achieved" editorDataField="text"> > > > yearNavigationEnabled="true" toolTip="Format:DD-MM-YY"/> > > > > > > Thanks for the read, > timgerr >
[flexcoders] Error #1034: Type Coercion failed: cannot convert "" to Date w/ Datagrid
Hello all, I am trying to add a datefield to a datagrid using a itemEditor. I have seen that people are having this problem but I canot find a solution (That I understand). Has anyone ever had this problem and what did you do to solve it. Here is my code: Thanks for the read, timgerr
[flexcoders] Re: DataGridColumn add a button and have the btn label = the returned dataField info
OK, I did this to the button: but now I get warnings when I run the app: warning: unable to bind to property 'ability' on class 'Object' (class is not an IEventDispatcher) What is this and what should I be doing to get the label? Thanks again, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello all, > I was wondering how to do somtgin that I think is complicated. I want > to have a button in a DataGridColumn, I would like to have the button > label be set to the data returned in that fataField. Here is what I mean: > > > > > dataField="manufacturer"/> > > > > > > > > > > > > > > How can I set the button: > > > to equal the data contained in: > > > Thanks for the help, > timgerr >
[flexcoders] DataGridColumn add a button and have the btn label = the returned dataField info
Hello all, I was wondering how to do somtgin that I think is complicated. I want to have a button in a DataGridColumn, I would like to have the button label be set to the data returned in that fataField. Here is what I mean: How can I set the button: to equal the data contained in: Thanks for the help, timgerr
[flexcoders] Re: Traverse through a TabNavigator
Thanks for the comment, if creationPolicy is bad, what do other people do and why is it bad? Thanks, timgerr --- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote: > > > Hi Tim, > > The problem is that only the first child of a TabNavigator is > instantiated initially. Not best practice, but you can set > creationPolicy="All" for the TabNavigator; in order to reference the > other children on init. > > -TH > > --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > > > Hello all, I have a TabNavigator that contains 2 forms: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > and I wrote this script to traverse a Form: > > public function Frm(f:Form):void > > { > > var a:Array = f.getChildren(); > > for(var i:int = 0; i < a.length; i++){ > > this.FrmI(a[i]); > > } > > } > > > > public function FrmI(f:FormItem):void > > { > > var a:Array = f.getChildren(); > > for(var i:int = 0; i < a.length; i++){ > > trace(a[i].id); > > } > > } > > > > so the script will take a form object, then see how many childreen it > > has then it will send the formitems to FrmI. Frmi will get me the name > > of the child objects and that is all. So the problem is when I run > init() > > public function init():void > > { > > Frm(FormOne); > > Frm(FormTwo); > > } > > I get this in return: > > fname > > lname > > > > If I just run the 2nd form like this: > > public function init():void > > { > > Frm(FormTwo); > > } > > > > Nothing is displayed. I think this has to do with TabNavigator. It > > looks to only get information from the tab that is on the top. Is > > that correct, and what do I have to do in order to get all the > > information ? > > > > Thanks, > > timgerr > > >
[flexcoders] Traverse through a TabNavigator
Hello all, I have a TabNavigator that contains 2 forms: and I wrote this script to traverse a Form: public function Frm(f:Form):void { var a:Array = f.getChildren(); for(var i:int = 0; i < a.length; i++){ this.FrmI(a[i]); } } public function FrmI(f:FormItem):void { var a:Array = f.getChildren(); for(var i:int = 0; i < a.length; i++){ trace(a[i].id); } } so the script will take a form object, then see how many childreen it has then it will send the formitems to FrmI. Frmi will get me the name of the child objects and that is all. So the problem is when I run init() public function init():void { Frm(FormOne); Frm(FormTwo); } I get this in return: fname lname If I just run the 2nd form like this: public function init():void { Frm(FormTwo); } Nothing is displayed. I think this has to do with TabNavigator. It looks to only get information from the tab that is on the top. Is that correct, and what do I have to do in order to get all the information ? Thanks, timgerr
[flexcoders] Question on how to find out what something is.
So I have this form so I have this function init():void { trace(One.getChildren().length) } My question is what is One, what kind of component or object is it. This is what I mean; I take the same form and add a creationcomplete to it: In the above example I pass something into init (init(something), what is that something? I am not sure how to declare it? init(this:NotSureWhatItIs) { trace ??? } If I do an object I do not have access to getChildren(). What do I do? Thanks for the help timgerr
[flexcoders] Adding objects to arraycollections
Hello all, I was wondering how to add objects to arraycollections arrycoll:ArrayCollection = new ArrayCollection(); obj1:Object = new Object(); obj2:Object = new Object(); obj1.id = 'Hi'; obj.2.id = 'Bye'; how do I add obj1 and obj2 to an array collection? Thanks, timgerr
[flexcoders] Re: Get id of dynamic validator
No I am again lost. Sorry for the confusion, but I might need a code example, globalValidators["validatorID_" + formItem[0].id] = validateString ; What is an example of validateString . Thanks for the help, I am trying to learn a more advanced way to doing things. Thanks again, timgerr --- In flexcoders@yahoogroups.com, "Fotis Chatzinikos" <[EMAIL PROTECTED]> wrote: > > Hi timgerr, > > try the following: > > var globalValidators:Object = new Object() ; > > inside the dynamically validators function do the following: > > globalValidators["validatorID_" + formItem[0].id] = validateString ; > > now when you need the validator (and you know the component (and its id) you > can get the validator: > > StringValidator sv = globalValidators["validatorID_" + knownFormItem.id] as > StringValidator > > > On Thu, Nov 6, 2008 at 6:38 AM, timgerr <[EMAIL PROTECTED]> wrote: > > > Not sure how to do that. If the validators are created dynamically: > > > > var c:UIComponent = formItem[0]; > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > var validateString:StringValidator = new > > StringValidator(); > > validateString.source = c; > > validateString.property = "text"; > > validateString.required = formItem[0].parent.required; > > validateString.maxLength = formItem[0].maxChars - 10; > > > > How do I make an an associative array? Not sure what the id of the > > validator is. > > > > Thanks for the help, > > timgerr > > > > FYI, c is a UIComponent > > > > > > --- In flexcoders@yahoogroups.com , "Tracy > > Spratt" wrote: > > > > > > Perhaps create an associative array of references to the validators? > > > > > > Tracy > > > > > > > > > > > > > > > > > > From: flexcoders@yahoogroups.com [mailto: > > flexcoders@yahoogroups.com ] On > > > Behalf Of timgerr > > > Sent: Wednesday, November 05, 2008 7:12 PM > > > To: flexcoders@yahoogroups.com > > > Subject: [flexcoders] Get id of dynamic validator > > > > > > > > > > > > Hello, I have this form and I am createin dynamic validators for each > > > textinput. I cannot see how to get the validators id when I try and > > > validate the textinput boxes, here is my code: > > > > > > > > id="fname_25_string"> > > > > > maxChars="35" text="James"/> > > > > > > > > > > > maxChars="35"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > So I do a creationcomplete to run a function to get a list of all the > > > textboxes: > > > private function GetChild(item:Object):void > > > { > > > var formItems:Array = item.getChildren(); > > > // loop items and add values > > > for (var i:int = 0; i < formItems.length; i++) > > > { > > > // formItem > > > var formItem:Array = formItems[i].getChildren(); > > > var c:UIComponent = formItem[0]; > > > if(c.className.toString() == 'TextInput'){ > > > var rtnID:String = c.id; > > > formItem[0].text = _performaReturnUsersData[rtnID]; > > > /* adding an eventlistener (focuseEvent) to all textinput > > > */ > > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > > var validateString:StringValidator = new > > > StringValidator(); > > > validateString.source = c; > > > validateString.property = "text"; > > > validateString.required = formItem[0].parent.required; > > > validateString.maxLength = formItem[0].maxChars - 10; > > > } > > > } > > > } > > > > > > This function will go through an find textinput boxes then assign a > > > validator to them. So all is working but the problem is I have no > > > idea how to validate the data without knowing the id of the individual > > > instance of the validator. > > > > > > I have added a listener to the instances of the textinput called > > > UpdateItem, so here is the code: > > > > > > function UpdateItem(f:FocuseOut):void > > > { > > > trace(f.target.id); > > > // Not sure what to do here becuase I dont know the id of the > > > validator attached to the textinput > > > } > > > > > > How can I see if the textinput passes the validators? > > > > > > Thanks for the help, > > > timgerr > > > > > > > > > > > > > -- > Fotis Chatzinikos, Ph.D. > Founder, > Phinnovation > [EMAIL PROTECTED], >
[flexcoders] Re: Get id of dynamic validator
OK I get it now, I think. Thanks all. --- In flexcoders@yahoogroups.com, "Fotis Chatzinikos" <[EMAIL PROTECTED]> wrote: > > Hi timgerr, > > try the following: > > var globalValidators:Object = new Object() ; > > inside the dynamically validators function do the following: > > globalValidators["validatorID_" + formItem[0].id] = validateString ; > > now when you need the validator (and you know the component (and its id) you > can get the validator: > > StringValidator sv = globalValidators["validatorID_" + knownFormItem.id] as > StringValidator > > > On Thu, Nov 6, 2008 at 6:38 AM, timgerr <[EMAIL PROTECTED]> wrote: > > > Not sure how to do that. If the validators are created dynamically: > > > > var c:UIComponent = formItem[0]; > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > var validateString:StringValidator = new > > StringValidator(); > > validateString.source = c; > > validateString.property = "text"; > > validateString.required = formItem[0].parent.required; > > validateString.maxLength = formItem[0].maxChars - 10; > > > > How do I make an an associative array? Not sure what the id of the > > validator is. > > > > Thanks for the help, > > timgerr > > > > FYI, c is a UIComponent > > > > > > --- In flexcoders@yahoogroups.com , "Tracy > > Spratt" wrote: > > > > > > Perhaps create an associative array of references to the validators? > > > > > > Tracy > > > > > > > > > > > > > > > > > > From: flexcoders@yahoogroups.com [mailto: > > flexcoders@yahoogroups.com ] On > > > Behalf Of timgerr > > > Sent: Wednesday, November 05, 2008 7:12 PM > > > To: flexcoders@yahoogroups.com > > > Subject: [flexcoders] Get id of dynamic validator > > > > > > > > > > > > Hello, I have this form and I am createin dynamic validators for each > > > textinput. I cannot see how to get the validators id when I try and > > > validate the textinput boxes, here is my code: > > > > > > > > id="fname_25_string"> > > > > > maxChars="35" text="James"/> > > > > > > > > > > > maxChars="35"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > So I do a creationcomplete to run a function to get a list of all the > > > textboxes: > > > private function GetChild(item:Object):void > > > { > > > var formItems:Array = item.getChildren(); > > > // loop items and add values > > > for (var i:int = 0; i < formItems.length; i++) > > > { > > > // formItem > > > var formItem:Array = formItems[i].getChildren(); > > > var c:UIComponent = formItem[0]; > > > if(c.className.toString() == 'TextInput'){ > > > var rtnID:String = c.id; > > > formItem[0].text = _performaReturnUsersData[rtnID]; > > > /* adding an eventlistener (focuseEvent) to all textinput > > > */ > > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > > var validateString:StringValidator = new > > > StringValidator(); > > > validateString.source = c; > > > validateString.property = "text"; > > > validateString.required = formItem[0].parent.required; > > > validateString.maxLength = formItem[0].maxChars - 10; > > > } > > > } > > > } > > > > > > This function will go through an find textinput boxes then assign a > > > validator to them. So all is working but the problem is I have no > > > idea how to validate the data without knowing the id of the individual > > > instance of the validator. > > > > > > I have added a listener to the instances of the textinput called > > > UpdateItem, so here is the code: > > > > > > function UpdateItem(f:FocuseOut):void > > > { > > > trace(f.target.id); > > > // Not sure what to do here becuase I dont know the id of the > > > validator attached to the textinput > > > } > > > > > > How can I see if the textinput passes the validators? > > > > > > Thanks for the help, > > > timgerr > > > > > > > > > > > > > -- > Fotis Chatzinikos, Ph.D. > Founder, > Phinnovation > [EMAIL PROTECTED], >
[flexcoders] Re: Get id of dynamic validator
Thanks all for the help, I now have a following question: 1. In this line of code globalValidators["validatorID_" + formItem[0].id] = validateString what is validateString? Thanks again, timgerr --- In flexcoders@yahoogroups.com, "Fotis Chatzinikos" <[EMAIL PROTECTED]> wrote: > > Hi timgerr, > > try the following: > > var globalValidators:Object = new Object() ; > > inside the dynamically validators function do the following: > > globalValidators["validatorID_" + formItem[0].id] = validateString ; > > now when you need the validator (and you know the component (and its id) you > can get the validator: > > StringValidator sv = globalValidators["validatorID_" + knownFormItem.id] as > StringValidator > > > On Thu, Nov 6, 2008 at 6:38 AM, timgerr <[EMAIL PROTECTED]> wrote: > > > Not sure how to do that. If the validators are created dynamically: > > > > var c:UIComponent = formItem[0]; > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > var validateString:StringValidator = new > > StringValidator(); > > validateString.source = c; > > validateString.property = "text"; > > validateString.required = formItem[0].parent.required; > > validateString.maxLength = formItem[0].maxChars - 10; > > > > How do I make an an associative array? Not sure what the id of the > > validator is. > > > > Thanks for the help, > > timgerr > > > > FYI, c is a UIComponent > > > > > > --- In flexcoders@yahoogroups.com , "Tracy > > Spratt" wrote: > > > > > > Perhaps create an associative array of references to the validators? > > > > > > Tracy > > > > > > > > > > > > > > > > > > From: flexcoders@yahoogroups.com [mailto: > > flexcoders@yahoogroups.com ] On > > > Behalf Of timgerr > > > Sent: Wednesday, November 05, 2008 7:12 PM > > > To: flexcoders@yahoogroups.com > > > Subject: [flexcoders] Get id of dynamic validator > > > > > > > > > > > > Hello, I have this form and I am createin dynamic validators for each > > > textinput. I cannot see how to get the validators id when I try and > > > validate the textinput boxes, here is my code: > > > > > > > > id="fname_25_string"> > > > > > maxChars="35" text="James"/> > > > > > > > > > > > maxChars="35"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > So I do a creationcomplete to run a function to get a list of all the > > > textboxes: > > > private function GetChild(item:Object):void > > > { > > > var formItems:Array = item.getChildren(); > > > // loop items and add values > > > for (var i:int = 0; i < formItems.length; i++) > > > { > > > // formItem > > > var formItem:Array = formItems[i].getChildren(); > > > var c:UIComponent = formItem[0]; > > > if(c.className.toString() == 'TextInput'){ > > > var rtnID:String = c.id; > > > formItem[0].text = _performaReturnUsersData[rtnID]; > > > /* adding an eventlistener (focuseEvent) to all textinput > > > */ > > > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > > > var validateString:StringValidator = new > > > StringValidator(); > > > validateString.source = c; > > > validateString.property = "text"; > > > validateString.required = formItem[0].parent.required; > > > validateString.maxLength = formItem[0].maxChars - 10; > > > } > > > } > > > } > > > > > > This function will go through an find textinput boxes then assign a > > > validator to them. So all is working but the problem is I have no > > > idea how to validate the data without knowing the id of the individual > > > instance of the validator. > > > > > > I have added a listener to the instances of the textinput called > > > UpdateItem, so here is the code: > > > > > > function UpdateItem(f:FocuseOut):void > > > { > > > trace(f.target.id); > > > // Not sure what to do here becuase I dont know the id of the > > > validator attached to the textinput > > > } > > > > > > How can I see if the textinput passes the validators? > > > > > > Thanks for the help, > > > timgerr > > > > > > > > > > > > > -- > Fotis Chatzinikos, Ph.D. > Founder, > Phinnovation > [EMAIL PROTECTED], >
[flexcoders] Re: Get id of dynamic validator
Not sure how to do that. If the validators are created dynamically: var c:UIComponent = formItem[0]; c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); var validateString:StringValidator = new StringValidator(); validateString.source = c; validateString.property = "text"; validateString.required = formItem[0].parent.required; validateString.maxLength = formItem[0].maxChars - 10; How do I make an an associative array? Not sure what the id of the validator is. Thanks for the help, timgerr FYI, c is a UIComponent --- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > Perhaps create an associative array of references to the validators? > > Tracy > > > > > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of timgerr > Sent: Wednesday, November 05, 2008 7:12 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Get id of dynamic validator > > > > Hello, I have this form and I am createin dynamic validators for each > textinput. I cannot see how to get the validators id when I try and > validate the textinput boxes, here is my code: > > id="fname_25_string"> > maxChars="35" text="James"/> > > > maxChars="35"/> > > > > > > > > > > So I do a creationcomplete to run a function to get a list of all the > textboxes: > private function GetChild(item:Object):void > { > var formItems:Array = item.getChildren(); > // loop items and add values > for (var i:int = 0; i < formItems.length; i++) > { > // formItem > var formItem:Array = formItems[i].getChildren(); > var c:UIComponent = formItem[0]; > if(c.className.toString() == 'TextInput'){ > var rtnID:String = c.id; > formItem[0].text = _performaReturnUsersData[rtnID]; > /* adding an eventlistener (focuseEvent) to all textinput > */ > c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); > var validateString:StringValidator = new > StringValidator(); > validateString.source = c; > validateString.property = "text"; > validateString.required = formItem[0].parent.required; > validateString.maxLength = formItem[0].maxChars - 10; > } > } > } > > This function will go through an find textinput boxes then assign a > validator to them. So all is working but the problem is I have no > idea how to validate the data without knowing the id of the individual > instance of the validator. > > I have added a listener to the instances of the textinput called > UpdateItem, so here is the code: > > function UpdateItem(f:FocuseOut):void > { > trace(f.target.id); > // Not sure what to do here becuase I dont know the id of the > validator attached to the textinput > } > > How can I see if the textinput passes the validators? > > Thanks for the help, > timgerr >
[flexcoders] Get id of dynamic validator
Hello, I have this form and I am createin dynamic validators for each textinput. I cannot see how to get the validators id when I try and validate the textinput boxes, here is my code: So I do a creationcomplete to run a function to get a list of all the textboxes: private function GetChild(item:Object):void { var formItems:Array = item.getChildren(); // loop items and add values for (var i:int = 0; i < formItems.length; i++) { // formItem var formItem:Array = formItems[i].getChildren(); var c:UIComponent = formItem[0]; if(c.className.toString() == 'TextInput'){ var rtnID:String = c.id; formItem[0].text = _performaReturnUsersData[rtnID]; /* adding an eventlistener (focuseEvent) to all textinput */ c.addEventListener(FocusEvent.FOCUS_OUT,UpdateItem); var validateString:StringValidator = new StringValidator(); validateString.source = c; validateString.property = "text"; validateString.required = formItem[0].parent.required; validateString.maxLength = formItem[0].maxChars - 10; } } } This function will go through an find textinput boxes then assign a validator to them. So all is working but the problem is I have no idea how to validate the data without knowing the id of the individual instance of the validator. I have added a listener to the instances of the textinput called UpdateItem, so here is the code: function UpdateItem(f:FocuseOut):void { trace(f.target.id); // Not sure what to do here becuase I dont know the id of the validator attached to the textinput } How can I see if the textinput passes the validators? Thanks for the help, timgerr
[flexcoders] Re: Recursively get all the childreen
I am trying to do something like this: public function PerformaGetChild(ui:Object):void { if(ui.childDescriptors.length > 0){ for (var i:int = 0; i < ui.childDescriptors.length; i++) { var c:ComponentDescriptor = ui.childDescriptors[i]; var d:Object = c.properties; PerformaGetChild(d.id); } } else { trace(ui.id); } } PerformaGetChild(TileTop); But it does not work, any ideas? Thanks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > How can I get a list of all the childreen? > > > > > > > > > > > > > > > > > Thanks, > Timgerr >
[flexcoders] Recursively get all the childreen
How can I get a list of all the childreen? Thanks, Timgerr
[flexcoders] Re: How to test for object and do other things
Thnaks for the help, here is the problem that I am getting. I will show you my code: http://www.adobe.com/2006/mxml"; layout="absolute" > I get an error "ReferenceError: Error #1069: Property myInput6 not found on Objects and there is no default value." Not sure whey myInput6 is being seen since I am doing the if statement. Any ideas? Thanks for the help timgerr --- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote: > > if(this[prop].text) { > trace('found'); > this[prop].text = obj[prop]; > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr > Sent: Monday, November 03, 2008 11:36 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] How to test for object and do other things > > > Hello all, > I have a question for ya, have an object and I want to test for a flex > ui component with that name. Here is what I am trying to do. > > I have these flex UI items: > > > > > > I have an object: > obj.myInput1 = 'Odd'; > obj.myInput2 = 'Even'; > obj.myInput3 = 'Odd'; > obj.myInput4 = 'Even'; > obj.myInput5 = 'Odd'; > obj.myInput6 = 'Even'; > obj.myInput7 = 'Odd'; > > so I can do this to see what is in the object: > for (var prop:String in obj) > { > trace(prop, ' is ' + obj[prop]); > } > > and I will get: > myInput1 is Odd > myInput2 is Even > myInput3 is Odd > myInput4 is Even > myInput5 is Odd > myInput6 is Even > myInput7 is Odd > > Now I want to test to see if we have the textinput items for each > return of obj > > I want to do something like this: > for (var prop:String in obj) > { > trace(prop, ' is ' + obj[prop]); > if(prop.text) { > trace('found'); > prop.text = obj[prop]; > } > This should find > myInput1 > myInput3 > myInput5 > myInput7 > > and add the information in the object to the textinput items. > > but the problem is that the above code dosnt work, how can I do this? > Thanks for the help, > timgerr >
[flexcoders] How to test for object and do other things
Hello all, I have a question for ya, have an object and I want to test for a flex ui component with that name. Here is what I am trying to do. I have these flex UI items: I have an object: obj.myInput1 = 'Odd'; obj.myInput2 = 'Even'; obj.myInput3 = 'Odd'; obj.myInput4 = 'Even'; obj.myInput5 = 'Odd'; obj.myInput6 = 'Even'; obj.myInput7 = 'Odd'; so I can do this to see what is in the object: for (var prop:String in obj) { trace(prop, ' is ' + obj[prop]); } and I will get: myInput1 is Odd myInput2 is Even myInput3 is Odd myInput4 is Even myInput5 is Odd myInput6 is Even myInput7 is Odd Now I want to test to see if we have the textinput items for each return of obj I want to do something like this: for (var prop:String in obj) { trace(prop, ' is ' + obj[prop]); if(prop.text) { trace('found'); prop.text = obj[prop]; } This should find myInput1 myInput3 myInput5 myInput7 and add the information in the object to the textinput items. but the problem is that the above code dosnt work, how can I do this? Thanks for the help, timgerr
[flexcoders] Re: Call to a member function on a non-object Weborb or PHP
Does anyone know if this is a weborb or a php problem? Thanks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello all, I am using weborb and getting this error but I am not sure > it is a weborb problem. I have a class CleanQueryClass.php > class CleanData { > public function CleanObject($obj) { > > $n = new stdClass; > foreach($obj as $var => $value) { > // Stripslashes > if (get_magic_quotes_gpc()) > { > $value = stripslashes($value); > } > // Quote if not integer > if (!is_numeric($value) || $value[0] == '0') > { > $value = > mysql_real_escape_string($value); > } > $n->$var = $value; > } > return $n; > } > > } > > I call this class from another class UserAuthenicate.php: > class UserAuthenicate { > public function HandShake(SB $info) > { > require_once('CleanQueryClass.php'); > $cln = new CleanData; > return $clean->CleanObject($info); > } > } > class SB{ > var $userName; > var $password; > var $status; > > } > > > When I communicate to UserAuthenicate.php with a weborb remote object > I get an error in flex, server didnt respond (somthing like that) I > look in charles and I see this: > Fatal error: Call to a member function CleanObject() on a > non-object in > C:\xampp\htdocs\weborb\Services\dnt\Authenicate\UserAuthenicate.php > on line 12 > > Can someone tell me what I am doing wrong? I am passong an object to > the class method. > > Thanks, > timgerr >
[flexcoders] Call to a member function on a non-object
Hello all, I am using weborb and getting this error but I am not sure it is a weborb problem. I have a class CleanQueryClass.php class CleanData { public function CleanObject($obj) { $n = new stdClass; foreach($obj as $var => $value) { // Stripslashes if (get_magic_quotes_gpc()) { $value = stripslashes($value); } // Quote if not integer if (!is_numeric($value) || $value[0] == '0') { $value = mysql_real_escape_string($value); } $n->$var = $value; } return $n; } } I call this class from another class UserAuthenicate.php: class UserAuthenicate { public function HandShake(SB $info) { require_once('CleanQueryClass.php'); $cln = new CleanData; return $clean->CleanObject($info); } } class SB{ var $userName; var $password; var $status; } When I communicate to UserAuthenicate.php with a weborb remote object I get an error in flex, server didnt respond (somthing like that) I look in charles and I see this: Fatal error: Call to a member function CleanObject() on a non-object in C:\xampp\htdocs\weborb\Services\dnt\Authenicate\UserAuthenicate.php on line 12 Can someone tell me what I am doing wrong? I am passong an object to the class method. Thanks, timgerr
[flexcoders] Re: More questions on weborb, creating my own services
OK, I did everything that was given and when I run the app I get this error: warning: Failed to load policy file from http://127.0.0.1/crossdomain.xml *** Security Sandbox Violation *** Connection to http://127.0.0.1/weborb/weborb.php halted - not permitted from http://localhost/weborb/WebORBExample-debug/WebORBExample.swf Error: Request for resource at http://127.0.0.1/weborb/weborb.php by requestor from http://localhost/weborb/WebORBExample-debug/WebORBExample.swf is denied due to lack of policy file permissions. Not sure what to do here. Thanks for the help, timgerr --- In flexcoders@yahoogroups.com, "valdhor" <[EMAIL PROTECTED]> wrote: > > This seems to be a convoluted way to do this. > > I have created a simple example to show you how I use WebOrb. > > On my server I have the WebORB directory at the root level. In the > Services directory I have a MyServices directory and in this directory I > have a ValueObjects directory. For this example I have two files: > > = > TestNamesInVO.php: > class TestNamesInVO > { > public $FirstName; > public $LastName; > > public function __construct($FirstName, $LastName) > { > $this->FirstName = $FirstName; > $this->LastName = $LastName; > } > } > ?> > = > TestNamesOutVO.php: > class TestNamesOutVO > { > public $FullName; > > public function __construct($FullName) > { > $this->FullName = $FullName; > } > } > ?> > = > > The constructors are there just to make it easier to create a new > object. They are optional. > > In the MyServices directory I have a TestService.php file. This contains > all the functions available with this service. > > = > TestService.php: > class TestService > { > function ShowMe() > { > return "Tom Jones"; > } > > function ShowName($name) > { > return 'Hello ' . $name; > } > > function ShowNames(TestNamesInVO $namesIn) > { > require_once("ValueObjects/TestNamesInVO.php"); > require_once("ValueObjects/TestNamesOutVO.php"); > > $fullName = new TestNamesOutVO($namesIn->FirstName . " " . > $namesIn->LastName); > > return $fullName; > } > } > ?> > = > > In flex I also have a ValueObjects folder underneath my src folder. This > folder contains the corresponding ActionScript files for the value > objects on the server: > > = > TestNamesInVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesInVO")] > [Bindable] > public class TestNamesInVO > { > //instance variables > private var _FirstName:String; > private var _LastName:String; > > //accessor methods > public function get FirstName():String {return _FirstName;} > public function get LastName():String {return _LastName;} > > //mutator methods > public function set FirstName(FirstName:String):void {_FirstName > = FirstName;} > public function set LastName(LastName:String):void {_LastName = > LastName;} > } // end class > }//end package > = > TestNamesOutVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesOutVO")] > [Bindable] > public class TestNamesOutVO > { > //instance variables > private var _FullName:String; > > //accessor methods > public function get FullName():String {return _FullName;} > > //mutator methods > public function set FullName(FullName:String):void {_FullName = > FullName;} > } // end class > }//end package > = > > Note the RemoteClass metadata. This tells flex the location of the class > on the server that matches this class (In relation to the Services > directory). > > Finally we have the Flex application that makes calls to functions > within this service. > > ===
[flexcoders] Re: More questions on weborb, creating my own services
What are the 2 files TestNamesInVO.php and TestNamesOutVO.php for? Isn't it easier to just go to the TestService.php and get the returned information their. What is the functions of the 2 files. Thanks again, timgerr --- In flexcoders@yahoogroups.com, "valdhor" <[EMAIL PROTECTED]> wrote: > > This seems to be a convoluted way to do this. > > I have created a simple example to show you how I use WebOrb. > > On my server I have the WebORB directory at the root level. In the > Services directory I have a MyServices directory and in this directory I > have a ValueObjects directory. For this example I have two files: > > = > TestNamesInVO.php: > class TestNamesInVO > { > public $FirstName; > public $LastName; > > public function __construct($FirstName, $LastName) > { > $this->FirstName = $FirstName; > $this->LastName = $LastName; > } > } > ?> > = > TestNamesOutVO.php: > class TestNamesOutVO > { > public $FullName; > > public function __construct($FullName) > { > $this->FullName = $FullName; > } > } > ?> > = > > The constructors are there just to make it easier to create a new > object. They are optional. > > In the MyServices directory I have a TestService.php file. This contains > all the functions available with this service. > > = > TestService.php: > class TestService > { > function ShowMe() > { > return "Tom Jones"; > } > > function ShowName($name) > { > return 'Hello ' . $name; > } > > function ShowNames(TestNamesInVO $namesIn) > { > require_once("ValueObjects/TestNamesInVO.php"); > require_once("ValueObjects/TestNamesOutVO.php"); > > $fullName = new TestNamesOutVO($namesIn->FirstName . " " . > $namesIn->LastName); > > return $fullName; > } > } > ?> > = > > In flex I also have a ValueObjects folder underneath my src folder. This > folder contains the corresponding ActionScript files for the value > objects on the server: > > = > TestNamesInVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesInVO")] > [Bindable] > public class TestNamesInVO > { > //instance variables > private var _FirstName:String; > private var _LastName:String; > > //accessor methods > public function get FirstName():String {return _FirstName;} > public function get LastName():String {return _LastName;} > > //mutator methods > public function set FirstName(FirstName:String):void {_FirstName > = FirstName;} > public function set LastName(LastName:String):void {_LastName = > LastName;} > } // end class > }//end package > = > TestNamesOutVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesOutVO")] > [Bindable] > public class TestNamesOutVO > { > //instance variables > private var _FullName:String; > > //accessor methods > public function get FullName():String {return _FullName;} > > //mutator methods > public function set FullName(FullName:String):void {_FullName = > FullName;} > } // end class > }//end package > = > > Note the RemoteClass metadata. This tells flex the location of the class > on the server that matches this class (In relation to the Services > directory). > > Finally we have the Flex application that makes calls to functions > within this service. > > = > WebORBExample.mxml: > > http://www.adobe.com/2006/mxml"; > layout="absolute" > creationComplete="onCreationComplete()"> > > > > > > > > > >
[flexcoders] Re: More questions on weborb, creating my own services
Thanks for the reply, can you tell me what the RemoteClass metadata looks like, this is an entry in your weborb\Weborb\WEB-INF\flex\remoting-config.xml??? Thanks for the help, I just want to learn. timgerr Note the RemoteClass metadata. This tells flex the location of the class on the server that matches this class (In relation to the Services directory). Finally we have the Flex application that makes calls to functions within this service. --- In flexcoders@yahoogroups.com, "valdhor" <[EMAIL PROTECTED]> wrote: > > This seems to be a convoluted way to do this. > > I have created a simple example to show you how I use WebOrb. > > On my server I have the WebORB directory at the root level. In the > Services directory I have a MyServices directory and in this directory I > have a ValueObjects directory. For this example I have two files: > > = > TestNamesInVO.php: > class TestNamesInVO > { > public $FirstName; > public $LastName; > > public function __construct($FirstName, $LastName) > { > $this->FirstName = $FirstName; > $this->LastName = $LastName; > } > } > ?> > = > TestNamesOutVO.php: > class TestNamesOutVO > { > public $FullName; > > public function __construct($FullName) > { > $this->FullName = $FullName; > } > } > ?> > = > > The constructors are there just to make it easier to create a new > object. They are optional. > > In the MyServices directory I have a TestService.php file. This contains > all the functions available with this service. > > = > TestService.php: > class TestService > { > function ShowMe() > { > return "Tom Jones"; > } > > function ShowName($name) > { > return 'Hello ' . $name; > } > > function ShowNames(TestNamesInVO $namesIn) > { > require_once("ValueObjects/TestNamesInVO.php"); > require_once("ValueObjects/TestNamesOutVO.php"); > > $fullName = new TestNamesOutVO($namesIn->FirstName . " " . > $namesIn->LastName); > > return $fullName; > } > } > ?> > = > > In flex I also have a ValueObjects folder underneath my src folder. This > folder contains the corresponding ActionScript files for the value > objects on the server: > > = > TestNamesInVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesInVO")] > [Bindable] > public class TestNamesInVO > { > //instance variables > private var _FirstName:String; > private var _LastName:String; > > //accessor methods > public function get FirstName():String {return _FirstName;} > public function get LastName():String {return _LastName;} > > //mutator methods > public function set FirstName(FirstName:String):void {_FirstName > = FirstName;} > public function set LastName(LastName:String):void {_LastName = > LastName;} > } // end class > }//end package > = > TestNamesOutVO.as: > package ValueObjects > { > [RemoteClass(alias="MyServices.ValueObjects.TestNamesOutVO")] > [Bindable] > public class TestNamesOutVO > { > //instance variables > private var _FullName:String; > > //accessor methods > public function get FullName():String {return _FullName;} > > //mutator methods > public function set FullName(FullName:String):void {_FullName = > FullName;} > } // end class > }//end package > = > > Note the RemoteClass metadata. This tells flex the location of the class > on the server that matches this class (In relation to the Services > directory). > > Finally we have the Flex application that makes calls to functions > within this service. > > = > WebORBExample.mxml: > > http://www.adobe.com/2006/mxml"; > layout="absolute" >
[flexcoders] More questions on weborb, creating my own services
OK, so I have created this hello world service and then had WebOrb create the code I see in the actionscript comments This: (If using Model-View-Controller) - Modify the constructor of the class below to accept the controller object - Modify response handlers to pass return values to the controller (if not using MVC) - Modify the constructor of the class below to accept your View object - Modify response handlers to display the result directly in the View I am not useing MVC so I have to use the 2nd commented option. the problem is I am not sure what to do, someone help me? Here is my PHP code: So I have 2 methods, ShowMe and ShowName. Here is my as code: package comp.HelloWorld { import mx.rpc.remoting.RemoteObject; import mx.controls.Alert; import mx.rpc.events.ResultEvent; import mx.rpc.events.FaultEvent; import mx.rpc.AsyncToken; import mx.rpc.IResponder; import comp.HelloWorld.vo.*; public class HelloWorld { private var remoteObject:RemoteObject; private var model:HelloWorldModel; public function HelloWorld( model:HelloWorldModel = null ) { remoteObject = new RemoteObject("GenericDestination"); remoteObject.source = "comp.HelloWorld.HelloWorld"; remoteObject.ShowMe.addEventListener("result",ShowMeHandler); remoteObject.ShowName.addEventListener("result",ShowNameHandler); remoteObject.addEventListener("fault", onFault); if( model == null ) model = new HelloWorldModel(); this.model = model; } public function setCredentials( userid:String, password:String ):void { remoteObject.setCredentials( userid, password ); } public function GetModel():HelloWorldModel { return this.model; } public function ShowMe( responder:IResponder = null):void { var asyncToken:AsyncToken = remoteObject.ShowMe(); if( responder != null ) asyncToken.addResponder( responder ); } public function ShowName( name:String, responder:IResponder = null):void { var asyncToken:AsyncToken = remoteObject.ShowName( name); if( responder != null ) asyncToken.addResponder( responder ); } public virtual function ShowMeHandler(event:ResultEvent):void { var returnValue:Object = event.result as Object; model.ShowMe = event.result as Object; } public virtual function ShowNameHandler(event:ResultEvent):void { var returnValue:Object = event.result as Object; model.ShowName = event.result as Object; } public function onFault (event:FaultEvent):void { Alert.show(event.fault.faultString, "Error"); } } } I get an error on: import comp.HelloWorld.vo.* (not sure what this is or how to create it) And here is another chunck of code that I have to modify public virtual function ShowMeHandler(event:ResultEvent):void { var returnValue:Object = event.result as Object; model.ShowMe = event.result as Object; } public virtual function ShowNameHandler(event:ResultEvent):void { var returnValue:Object = event.result as Object; model.ShowName = event.result as Object; } I get an error: (Severity and Description PathResourceLocation Creation Time Id 1119: Access of possibly undefined property ShowMe through a reference with static type comp.HelloWorld:HelloWorldModel. WeborbHelloworld/src/comp/HelloWorldHelloWorld.as line 95 1222790567712 8938) On these 2 lines of code: model.ShowMe = event.result as Object; model.ShowName = event.result as Object; I just want to return that stuff, what do I have to do in order to fix the errors. Thanks, timgerr
[flexcoders] Re: Movable content
Thanks, That did it. --- In flexcoders@yahoogroups.com, "Brendan Meutzner" <[EMAIL PROTECTED]> wrote: > > verticalCenter=0 and horizontalCenter=0 > > On Tue, Sep 30, 2008 at 10:02 AM, timgerr <[EMAIL PROTECTED]> wrote: > > > I was wondering if there was a way to have flex content dynamically > > place it's self in the center of the screen no matter what the screen > > resolution is. > > > > Here is what I mean, I have a login pane that I want to be always be > > in center of the screen, can stuff dynamically move? > > > > Thanks for the information > > > > > > > > > > -- > Brendan Meutzner > http://www.meutzner.com/blog/ >
[flexcoders] Movable content
I was wondering if there was a way to have flex content dynamically place it's self in the center of the screen no matter what the screen resolution is. Here is what I mean, I have a login pane that I want to be always be in center of the screen, can stuff dynamically move? Thanks for the information
[flexcoders] Resolved Re: Have a question about Weborb
Mark I was looking for somthing like that last night at about 2am. I found somthing like that at http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_23267099.html in the guys script. Mark, I cannot tell you how much thanks I want to give you. Thank, timgerr --- In flexcoders@yahoogroups.com, "Mark Piller" <[EMAIL PROTECTED]> wrote: > > Hi Tim, > > Glad you figured it out. There's one minor change I would recommend: > when you call any of the find methods, you're always getting an > object (or a collection) back. We tried to simplify the programming > model, however the async nature of Flex's client/server integration is > always there. So even though you get back an object out of the find > calls, initially that object does not have the data. When the client > receives the data from the server, the same instance WebORB returns to > you is updated with the data. As a result, it is recommended to make > sure you actually got the data before you make any changes. Here's how > you can do it: > > _master = ActiveRecords.Test.findByIdAndName('6','tessa'); > _master.addEventListener( "loaded", gotTest ); > > public function gotTest( evt:DynamicLoadEvent ):void > { > var testObj:Test = (evt.data as ArrayCollection)[0] as Test; > testObj.Email = "tessa@"; > testObj.Name = "tessa"; > } > > Cheers, > Mark > >
[flexcoders] Resolved Re: Have a question about Weborb
I am learning, what you want to do is download Weborb and put your browser on the root of that directory. There is an example tab that you will have to crate a database (with the given SLQ file). That is how I learned. I have to do a writeup on what I have learned to a group of people I will send that out when it is finished. timgerr --- In flexcoders@yahoogroups.com, "bhaq1972" <[EMAIL PROTECTED]> wrote: > > hi Tim > > I'd like to try out you've done. Is there a tutorial anywhere you > can recomend. > > regadrs > Bod >
[flexcoders] Resolved Re: Have a question about Weborb
OK, I found out how to do this. When updating a row I have to specify the row id, I think that is all. That is how I got it to work. So if I have this _master = ActiveRecords.Test.findByIdAndName('6','tessa'); _master[0].Email = "[EMAIL PROTECTED]"; _master[0].Name = "tessa"; _master[0].Id = 6; I then create the test method (I think that is what you call it) var i:Test = new Test(); i.Name = Tess; i.Email = "[EMAIL PROTECTED]"; i.Id = 6; var asyncToken:AsyncToken = null; asyncToken = i.save(); asyncToken.addResponder(new mx.rpc.Responder (OnCreated,OnFault)); That is it, that is how I got it to work. Man this Weborb rocks. I have a few other questions that I will be posting --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Let me make this a little more clear: > I am good at looking at code so here is what I am doing. I want to > call a database row using findby and ad that information into an array > collection: > private var _master:ArrayCollection = new ArrayCollection(); > _master = ActiveRecords.Test.findByIdAndName('6','tessa'); > > so now master[0] has Id, Email, Name > so if I wanted to change the name from tessa to > tess, not sure what to do. > > Thanks for the read. > timgerr > > > --- In flexcoders@yahoogroups.com, "timgerr" wrote: > > > > Mark, Thanks for the reply, I am getting closer to learning how to do > > an update. > > > > I am good at looking at code so here is what I am doing. I want to > > call a database row using findby and ad that information into an array > > collection: > > private var _master:ArrayCollection = new ArrayCollection(); > > _master = ActiveRecords.Test.findByIdAndName('6','tessa'); > > > > so now master[0] has Id, Email, Name > > so if I wanted to change the email from tsa@ to > > tsa@, I do this? > > > > private var uDate:Test = new Test(); > > uDate.Name = 'tessa'; > > uDate.Id = '6'; > > udate.Email = 'tesa@'; > > > > var asyncToken:AsyncToken = null; > > asyncToken = uDate.save(); > > > > How does webord know the difference between an updated and new record? > > > > Thanks for the help, > > timgerr > > > > > > > > --- In flexcoders@yahoogroups.com, "Mark Piller" wrote: > > > > > > Hi Tim, > > > > > > For any instance of Active Record on the client side you can change > > > the properties and then call save() on that instance. It will update > > > the record in the database and also issue client synchronization event > > > so other clients that have the same record would be updated. Instances > > > of active record are loaded with any of the findXXX methods. > > > > > > Hope this helps. > > > > > > Mark > > > > > >
[flexcoders] Re: Have a question about Weborb
Let me make this a little more clear: I am good at looking at code so here is what I am doing. I want to call a database row using findby and ad that information into an array collection: private var _master:ArrayCollection = new ArrayCollection(); _master = ActiveRecords.Test.findByIdAndName('6','tessa'); so now master[0] has Id, Email, Name so if I wanted to change the name from tessa to tess, not sure what to do. Thanks for the read. timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Mark, Thanks for the reply, I am getting closer to learning how to do > an update. > > I am good at looking at code so here is what I am doing. I want to > call a database row using findby and ad that information into an array > collection: > private var _master:ArrayCollection = new ArrayCollection(); > _master = ActiveRecords.Test.findByIdAndName('6','tessa'); > > so now master[0] has Id, Email, Name > so if I wanted to change the email from [EMAIL PROTECTED] to > [EMAIL PROTECTED], I do this? > > private var uDate:Test = new Test(); > uDate.Name = 'tessa'; > uDate.Id = '6'; > udate.Email = '[EMAIL PROTECTED]'; > > var asyncToken:AsyncToken = null; > asyncToken = uDate.save(); > > How does webord know the difference between an updated and new record? > > Thanks for the help, > timgerr > > > > --- In flexcoders@yahoogroups.com, "Mark Piller" wrote: > > > > Hi Tim, > > > > For any instance of Active Record on the client side you can change > > the properties and then call save() on that instance. It will update > > the record in the database and also issue client synchronization event > > so other clients that have the same record would be updated. Instances > > of active record are loaded with any of the findXXX methods. > > > > Hope this helps. > > > > Mark > > >
[flexcoders] Re: Have a question about Weborb
Mark, Thanks for the reply, I am getting closer to learning how to do an update. I am good at looking at code so here is what I am doing. I want to call a database row using findby and ad that information into an array collection: private var _master:ArrayCollection = new ArrayCollection(); _master = ActiveRecords.Test.findByIdAndName('6','tessa').isLoaded; so now master[0] has Id, Email, Name so if I wanted to change the email from [EMAIL PROTECTED] to [EMAIL PROTECTED], I do this? private var uDate:Test = new Test(); uDate.Name = 'tessa'; uDate.Id = '6'; udate.Email = '[EMAIL PROTECTED]'; var asyncToken:AsyncToken = null; asyncToken = uDate.save(); How does webord know the difference between an updated and new record? Thanks for the help, timgerr --- In flexcoders@yahoogroups.com, "Mark Piller" <[EMAIL PROTECTED]> wrote: > > Hi Tim, > > For any instance of Active Record on the client side you can change > the properties and then call save() on that instance. It will update > the record in the database and also issue client synchronization event > so other clients that have the same record would be updated. Instances > of active record are loaded with any of the findXXX methods. > > Hope this helps. > > Mark >
[flexcoders] Re: Have a question about Weborb
Thanks for the help Igor. I am not sure what you mean. I see in the documentation that save is insert or update information: save() method public function save(cascade:Boolean = true, responder:Responder = null):AsyncToken Saves new or updates existing ActiveRecord. The method sends a request to the remote data source. New ActiveRecord instance is added to the data store, existing record is updated with all the new values in the record properties. Calling save() on an instance of ActiveRecord is equivalent to calling save() on the data mapper associated with this ActiveRecord. Parameters cascade:Boolean (default = true) indicates if the save operation should do deep traversal over all related records. If true, save performs deep traversal, otherwise, only direct properties of the ActiveRecord are saved in the data store. responder:Responder (default = null) a responder object to receive success/failure callbacks when the save operation is complete. Returns AsyncToken AsyncToken returned from the underlying remote invocation I am not sure how to set this up for an update. When doing a SQL update I do somting like: Update some_table set This = That where id = # How do I specify what table to update when invoking the save() method in flex? Thanks for the help, timgerr --- In flexcoders@yahoogroups.com, "Igor Costa" <[EMAIL PROTECTED]> wrote: > > I guess there's something on the code. take look at the sql instrict methods > to see if there's something like UPDATE > > Regards > Igor >
[flexcoders] Re: Have a question about Weborb
Do I have to set that or does that come from the script generated weborb? timgerr --- In flexcoders@yahoogroups.com, "Igor Costa" <[EMAIL PROTECTED]> wrote: > > You do as same as you do to add, but the only diffrent is on the server-side > instead of INSERT INTO you should do UPDATE > > > Regards > > > On Sun, Sep 28, 2008 at 11:59 PM, timgerr <[EMAIL PROTECTED]> wrote: > > > Hello all, > > I am trying to learn Weborb and need some help on how to update a > > database record. > > > > Here is my question, I have a database table named test and the > > construction of one row is: > > id = 1 > > name = Tim > > email = [EMAIL PROTECTED] > > > > Now if I wanted to return all the rows it would be > > ActiveRecord.test.findall(). > > > > If I wanted to add a record it would be: > > private var t:Test = new Test(); > > t.Name = 'bob'; > > t.Email = '[EMAIL PROTECTED] <%27bob%40bob.com>'; > > var asyncToken:AsyncToken = null; > > asyncToken = t.save(); > > > > The problem that I have is I dont understand how to update a record, > > take my row 1 > > id = 1 > > name = Tim > > email = [EMAIL PROTECTED] > > > > How can I change that row to somting like this > > id = 1 > > name = Timmy > > email = [EMAIL PROTECTED] > > > > Can some one show me the code? > > > > Thanks for the help, > > timgerr > > > > > > > > > > -- > > Igor Costa > www.igorcosta.com > www.igorcosta.org >
[flexcoders] Re: Have a question about Weborb
Can changes to the active record only be done on the datastore? Thanks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello all, > I am trying to learn Weborb and need some help on how to update a > database record. > > Here is my question, I have a database table named test and the > construction of one row is: > id = 1 > name = Tim > email = [EMAIL PROTECTED] > > Now if I wanted to return all the rows it would be > ActiveRecord.test.findall(). > > If I wanted to add a record it would be: > private var t:Test = new Test(); > t.Name = 'bob'; > t.Email = '[EMAIL PROTECTED]'; > var asyncToken:AsyncToken = null; > asyncToken = t.save(); > > The problem that I have is I dont understand how to update a record, > take my row 1 > id = 1 > name = Tim > email = [EMAIL PROTECTED] > > How can I change that row to somting like this > id = 1 > name = Timmy > email = [EMAIL PROTECTED] > > Can some one show me the code? > > Thanks for the help, > timgerr >
[flexcoders] Have a question about Weborb
Hello all, I am trying to learn Weborb and need some help on how to update a database record. Here is my question, I have a database table named test and the construction of one row is: id = 1 name = Tim email = [EMAIL PROTECTED] Now if I wanted to return all the rows it would be ActiveRecord.test.findall(). If I wanted to add a record it would be: private var t:Test = new Test(); t.Name = 'bob'; t.Email = '[EMAIL PROTECTED]'; var asyncToken:AsyncToken = null; asyncToken = t.save(); The problem that I have is I dont understand how to update a record, take my row 1 id = 1 name = Tim email = [EMAIL PROTECTED] How can I change that row to somting like this id = 1 name = Timmy email = [EMAIL PROTECTED] Can some one show me the code? Thanks for the help, timgerr
[flexcoders] Still working on learning AMFPHP
Here is a Flex question that I have, If I do this code: http://www.adobe.com/2006/mxml"; layout="absolute"> All works fine, but if a add a variable to the http://www.adobe.com/2006/mxml"; layout="absolute"> I get an error for this
[flexcoders] Re: Learning Flex and AMFPHP
Thanks for the responce, where did you get GlobalSettings.AMFPHP_GATEWAY? What do I have to import in order to use it? Thanks, timgerr --- In flexcoders@yahoogroups.com, "Aaron Miller" <[EMAIL PROTECTED]> wrote: > > It is hard to find. Here is a snippet from my code. Hope it helps! > public function loadFavorites( resultHandler:Function, > errorHandler:Function, zone:String ): void { > trace('FavoritesProxy.loadFavorites'); > var dataService:RemoteObject = new RemoteObject(); > var channel:Channel = new AMFChannel( 'amfphp', > GlobalSettings.AMFPHP_GATEWAY ); > var channelSet:ChannelSet = new ChannelSet(); > channelSet.addChannel(channel); > dataService.channelSet = channelSet; > dataService.destination = "amfphp"; > dataService.source = "FavoritesProxy"; > dataService.loadFavorites.addEventListener( ResultEvent.RESULT, > resultHandler ); > dataService.addEventListener(FaultEvent.FAULT, errorHandler); > dataService.loadFavorites( myUser.userID, myUser.userHash, zone ); > } > > This calls FavoritesProxy->loadFavorites in the amfphp services. > > Best Regards, > ~Aaron > > On Wed, Sep 24, 2008 at 9:52 PM, timgerr <[EMAIL PROTECTED]> wrote: > > > Hello all, hope you all are doing good. I have a question on how to > > build the Flex RemoteObject method in action script. I am having > > troubles doing this. Here is my RemoteObject: > > > > > showBusyCursor="true" source="tutorials.HelloWorld" destination="amfphp"> > > > > > > > > Can someone take the above code and do it in acitonscript? It is not > > that I want someone to do my work, I am having a hard time finding > > data to do this. Most examples are in Flash and for some reason they > > do not work right in Flex. > > > > Thanks for all the help, > > timgerr > > > > > > > > > > -- > Aaron Miller > Chief Technology Officer > Open Base Interactive, LLC. > [EMAIL PROTECTED] > http://www.openbaseinteractive.com >
[flexcoders] Learning Flex and AMFPHP
Hello all, hope you all are doing good. I have a question on how to build the Flex RemoteObject method in action script. I am having troubles doing this. Here is my RemoteObject: Can someone take the above code and do it in acitonscript? It is not that I want someone to do my work, I am having a hard time finding data to do this. Most examples are in Flash and for some reason they do not work right in Flex. Thanks for all the help, timgerr
[flexcoders] Re: Flex, BlazeDS, AMFPHP, LiveCycle Data Services
Anyone useing Red5 for communication with Flex? Thanks, timgerr --- In flexcoders@yahoogroups.com, "timgerr" <[EMAIL PROTECTED]> wrote: > > Hello All, > I have to pick your brains on ways to connect to my back end. Right > now I send data from flex via HTTPServices request to PHP and then PHP > will return data via JSON. The reason why I do that is becuause I > come from using Java Script and Dojo. I have been working with flex > for many months and that is the way my front end (Flex) connects to > the back end (PHP). > > I have been been reading about 3 new thing (to me that is) and have a > few questions about them. > > 1. I know that BlazeDS and LiveCycle Data Services are sort of the > same thing, what are the differences? Is anyone using them and do you > have to be a Java guru to use it? I know PHP well, but I can learn > Java if needed. > > 2. Is AMFPHP a good tool to communicate to my backed? How hard is it > to learn? What are the benefits of using it? > > 3. What is better for future Flex/Air development? I am creating a > web app that a user has to authenticate to, session information has to > be kept and that sort of stuff. > > I am asking the community what they think is the best way for Flex/Air > to talk to the back end. > > I am running Centos 5, MYSql on Apache. > > Thanks for the help, > timgerr >
[flexcoders] Flex, BlazeDS, AMFPHP, LiveCycle Data Services
Hello All, I have to pick your brains on ways to connect to my back end. Right now I send data from flex via HTTPServices request to PHP and then PHP will return data via JSON. The reason why I do that is becuause I come from using Java Script and Dojo. I have been working with flex for many months and that is the way my front end (Flex) connects to the back end (PHP). I have been been reading about 3 new thing (to me that is) and have a few questions about them. 1. I know that BlazeDS and LiveCycle Data Services are sort of the same thing, what are the differences? Is anyone using them and do you have to be a Java guru to use it? I know PHP well, but I can learn Java if needed. 2. Is AMFPHP a good tool to communicate to my backed? How hard is it to learn? What are the benefits of using it? 3. What is better for future Flex/Air development? I am creating a web app that a user has to authenticate to, session information has to be kept and that sort of stuff. I am asking the community what they think is the best way for Flex/Air to talk to the back end. I am running Centos 5, MYSql on Apache. Thanks for the help, timgerr
[flexcoders] Differences between AIR html and Flex
Hello all, I have been programming in flex for about 6 months now and A friend just showed me something cool. He was able to run an AIR app locally and within a web page. Can I create Air apps that run on both HTML web pages and locally??? Thanks for the help, Timgerr
[flexcoders] Re: Question about launching a form from a MXML component.
Thanks, I forgot, I'm a silly little boy :). Tim --- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote: > > addChild(FRM) > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of timgerr > Sent: Tuesday, September 09, 2008 9:30 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] Question about launching a form from a MXML component. > > > Hello all, > I have this MXML component called users.mxml, here is what it looks like: > http://www.adobe.com/2006/mxml"; width="366" > height="208"> > > > invalid="IsValid('username',false)" valid="IsValid('username',true)"/> > > > invalid="IsValid('fistname',false)" valid="IsValid('fistname',true)"/> > > > invalid="IsValid('lastname',false)" valid="IsValid('lastname',true)"/> > > > invalid="IsValid('email',false)" valid="IsValid('email',true)"/> > > > click="Submit()"/> > > > > I then want to add it to Master.MXML > so I do this : > > http://www.adobe.com/2006/mxml"; > layout="absolute" creationComplete="MasterInit()"> > > > > > > > Once the MasterInit() is called, what do I have to do in order to get > the form from Usersto show? > > Thanks, > Timgerr >
[flexcoders] Question about launching a form from a MXML component.
Hello all, I have this MXML component called users.mxml, here is what it looks like: http://www.adobe.com/2006/mxml"; width="366" height="208"> I then want to add it to Master.MXML so I do this : http://www.adobe.com/2006/mxml"; layout="absolute" creationComplete="MasterInit()"> Once the MasterInit() is called, what do I have to do in order to get the form from Usersto show? Thanks, Timgerr