[flexcoders] Error while select or over the menubar first time ~
I have a lot of codes in the main.mxml, so I cut most of them. And I don't use the any kinds of the css styles.The code is actually created by FlashCatalyst. The menubar dosen't have the skinclass property so I is added manually. I have attached the main.mxml. Thanks a lot ! ?xml version='1.0' encoding='UTF-8'? s:Application xmlns:ATE=http://ns.adobe.com/ate/2009; xmlns:ai=http://ns.adobe.com/ai/2009; xmlns:fc=http://ns.adobe.com/flashcatalyst/2009; xmlns:d=http://ns.adobe.com/fxg/2008/dt; xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:lib=assets.graphics.transation.* xmlns:flm=http://ns.adobe.com/flame/2008; backgroundColor=#ff height=100% preloaderBaseColor=#ff width=100% creationComplete=application1_creationCompleteHandler(event) xmlns:mx=library://ns.adobe.com/flex/halo fx:Script ![CDATA[ import mx.collections.XMLListCollection; import mx.events.FlexEvent; [Bindable] private var MenuBarDataList:XMLListCollection; private var MenuBarData:XMLList= menuitem label=Menu1 menuitem label=MenuItem 1-A data=1A/ menuitem label=MenuItem 1-B data=1B/ /menuitem menuitem label=Menu2 menuitem label=MenuItem 2-A type=check data=2A/ menuitem type=separator / menuitem label=MenuItem 2-B menuitem label=SubMenuItem 2-B-A type=radio groupName=2one data=2-B-A/ menuitem label=SubMenuItem 2-B-B type=radio groupName=2one data=2-B-B/ /menuitem /menuitem menuitem label=Menu3 menuitem label=MenuItem 3-A type=check data=3A/ menuitem type=separator / menuitem label=MenuItem 3-B menuitem label=SubMenuItem 3-B-A type=radio groupName=3one data=3-B-A/ menuitem label=SubMenuItem 3-B-B type=radio groupName=3one data=3-B-B/ /menuitem /menuitem /; protected function application1_creationCompleteHandler(event:FlexEvent):void { MenuBarDataList = new XMLListCollection(MenuBarData); } ]] /fx:Script s:Group mx:MenuBar id=topNavMenu includeIn=main x=518 y=25.95 height=22 dataProvider={MenuBarDataList} labelField=@label / /s:Group /s:Application TypeError: Error #1009: Cannot access a property or method of a null object reference. at mx.controls::Menu/updateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\controls\Menu.as:1372] at mx.controls.listClasses::ListBase/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:3969] at mx.managers::LayoutManager/validateDisplayList()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:663] at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:736] at mx.managers::LayoutManager/validateNow()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\managers\LayoutManager.as:794] at mx.controls::Menu/show()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\controls\Menu.as:1697] at mx.controls::MenuBar/showMenu()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\controls\MenuBar.as:1877] at mx.controls::MenuBar/mouseDownHandler()[E:\dev\gumbo_beta2\frameworks\projects\framework\src\mx\controls\MenuBar.as:2070]
[flexcoders] Animating items in a tilelist when filtering arraycollection
i guys i have probably asked this several times but i have never gotten anything solid. i have a tile list that is populated with an array collection of data from a database. i also have a filter function that i use to filter the array collection based on multiple criteria. i would like to have some kind of effect play as data is filtered to show data change just like in the flex store example. but apparently the itemschangeeffect in flex 3 does not work with filter functions. any way of achieving that goal?
[flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy
[flexcoders] A popupbutton without arrow?
Hi folks, I'm looking for ideas... I need to have a button(skinnned with an icon), that when clicked will show a layer with two options, pretty much like a combobox or a popupbutton. But I need the button to be, clean, without the arrow. Any Ideas on how to go about doing this? Regards, Leonardo C.
Re: [flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Hello, I think your create function is not in class instance scope (because inline) : should be static or from an instance of Dohickey to work, I think. thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net sip%3awebattit...@ekiga.net téléphone portable : +33601 822 056 2010/1/18 Guy Morton g...@alchemy.com.au Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy
[flexcoders] DragDrop event propagation
Hi all, I have a tree component with an xml file as dataprovider. I would like to move node from one parent to other one, previously an alert message. 1.- I drag a node 2.- Before drop this node in new parent node, i want to display an alert message. 3.- If the user click YES, i want to move the node to the new parent 4.- If the user click NO, i want to cancel the drag and drop event. Here is my source: in the tree component i have the next properties: dropEnabled=true dragEnabled=true dragMoveEnabled=true dragDrop=customDragDrop(event) allowMultipleSelection=false The customDragDrop(event) function is: import mx.events.DragEvent; import mx.managers.DragManager; private var queuedEvent:DragEvent; private function customDragDrop(event:DragEvent): void { //Get the data from the dragSource var items:Object = event.dragSource.dataForFormat(treeItems); event.stopPropagation(); queuedEvent = event as DragEvent; var messageText:String = Are you sure you want to move the node + items[...@label.touppercase() + ?; var titleText:String = Warning; var alert:Alert = Alert.show(messageText, titleText, Alert.NO | Alert.YES, this, customDragDropHandler,alertIcon); } private function customDragDropHandler(event:CloseEvent):void{ if (event.detail == Alert.NO){ queuedEvent.preventDefault(); queuedEvent.target.hideDropFeedback(queuedEvent); DragManager.showFeedback(DragManager.NONE); } else { dispatchEvent(queuedEvent); } } I don´t know why i can not get my solution, please i need your help. Thanks in advance.
Re: [flexcoders] flex vertial button?
Here is code for a MultiLine Button. You put a line break (\n) where you want it to break. I use it to get a vertical label by putting a line break between each letter. Hope this helps! Warren package myClassLibrary{ // from http://blogs.adobe.com/aharui/2007/04/multiline_buttons.html and adapted slightly for Flex3 import mx.controls.Button; import mx.core.UITextField; import mx.core.IUITextField; import flash.display.DisplayObject; import flash.text.TextLineMetrics; import mx.core.IFlexDisplayObject; import mx.core.mx_internal; use namespace mx_internal; public class Button_MultiLine extends Button{ public function Button_MultiLine(){ super(); } public function forceUpdate():void{ this.updateDisplayList(this.width,this.height); } override protected function createChildren():void{ if (!textField){ textField = IUITextField(createInFontContext(UITextField_NoTruncate)); textField.styleName = this; addChild(DisplayObject(textField)); } super.createChildren(); textField.wordWrap = true; textField.multiline = true; } override protected function measure():void{ if (!isNaN(explicitWidth)){ var tempIcon:IFlexDisplayObject = getCurrentIcon(); var w:Number = explicitWidth; if (tempIcon) w -= tempIcon.width + getStyle(horizontalGap) + getStyle(paddingLeft) + getStyle(paddingRight); textField.width = w; } super.measure(); } override public function measureText(s:String):TextLineMetrics{ textField.text = s; var lineMetrics:TextLineMetrics = textField.getLineMetrics(0); lineMetrics.width = textField.textWidth + 4; lineMetrics.height = textField.textHeight + 4; return lineMetrics; } } } import mx.core.UITextField; internal class UITextField_NoTruncate extends UITextField { public function UITextField_NoTruncate() { super(); } override public function truncateToFit(s:String = null):Boolean { return false; } } - Original Message - From: markflex2007 To: flexcoders@yahoogroups.com Sent: Saturday, January 16, 2010 4:02 PM Subject: [flexcoders] flex vertial button? I try to vertical button like.but I can not see label in button. mx:HBox width=100% rotation=90 x=100 y=100 clipContent=true mx:Button id=myButton label=CLICK ME height=30 rotation=90 / /mx:HBox Do you have other ways.Thanks Mark
Re: [flexcoders] question about inheritance and events and overriding methods
I am having trouble with an override, getting Method marked override must override another method. No problem at all doing this: in the BASE CLASS: protected function foo(): void{} in the SUBCLASS override protected function foo(): void{} But the error given above occurs here: in the BASE CLASS protected function onResult(e:ResultEvent, token:Object=null):void {} in the SUBCLASS override protected function onResult(e:ResultEvent, token:Object=null):void {} I don't see why it's not working. All of the requirements set out here seem to be satisfied: http://livedocs.adobe.com/flex/3/html/help.html?content=04_OO_Programming_11.html I've included the class implementations below. Is the cause of the error evident? Thanks again for the help, it's appreciated doubly because I'm stumped by this. Tim === BASE CLASS == package TESTREST { import mx.rpc.http.HTTPService; import mx.rpc.AsyncResponder; import mx.rpc.AsyncToken; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import OEREST.events.*; import OEUTIL.BindableArrayCollection; import json.*; import OEUTIL.SearchConstants; public class MYHTTPSERVICEBASE extends HTTPService { private var _params: Object; private function get Params(): Object {return _params;} public function MYHTTPSERVICEBASE(destination: String, params:Object = null) { var _params: Object=params; var baseURL: String; if ( SearchConstants.DEBUGMODE) { baseURL = SearchConstants.DEBUG_BASEURL ; }else{ baseURL= SearchConstants.RELEASE_BASEURL ; } super(baseURL, destination); } public function execute(): void { var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken; if ( this.Params == null) { this.method=GET; token = this.send(); } else { this.method=POST; token = this.send(Params); } token.addResponder(myResponder); } protected function foo(): void {} protected function onResult(e:ResultEvent, token:Object=null):void {} protected function onFault(evt:FaultEvent, token: Object=null):void {} } } == SUBCLASS package TESTREST { public class TestService extends TESTREST.MYHTTPSERVICEBASE { import mx.rpc.events.ResultEvent; protected const DEBUGMODE:Boolean = CONFIG::debug; protected const DEBUG_BASEURL:String = http://localhost/OESharpDeploy/; protected const RELEASE_BASEURL:String = ; import TESTREST.events.*; import json.JParser; public function TestService() { var dest: String =getServiceURL(); var selTitles : Array =new Array(1,2,3,4,5,6,7,8,9,10,11,12); var ss:String = JParser.encode(selTitles); var params:Object = {selectedTitles: ss}; super( dest, params); } private function getServiceURL(): String { if (DEBUGMODE) { return DEBUG_BASEURL + /SSQ.ashx ; }else{ return RELEASE_BASEURL + /SSQ.ashx ; } } override protected function foo(): void{} override protected function onResult(e:ResultEvent, token:Object=null):void {} } } On 1/17/2010 10:49 PM, Aaron Hardy wrote: I'm not sure I understand your question clearly but if I assume correctly I think the answer will be yes, there is no need for each descendant to instantiate its own responder. Aaron On Sun, Jan 17, 2010 at 6:37 PM, Tim Romano tim_rom...@yahoo.com mailto:tim_rom...@yahoo.com wrote: Thank you, Aaron, for the helpful answers. My intention would be to have each of the descendants of MYHTTPSERVICEBASE point to a different destination and raise an event specific to that destination, and to have a separate listeners for each kind of event. If I've understood you correctly, there is no need for each of the descendants to instantiate their own Responder and no requirement for them to override the base execute() method too. Tim /* this method is in the descendant class and overrides the base method */ private overrides function onResult(e:ResultEvent, token:Object=null):void { // raise a specific event } /* these two methods are in the base class */ publicfunction execute() : void { myResponder = new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken =
RE: [SPAM] [flexcoders] Animating items in a tilelist when filtering arraycollection
Try filtering a separate ArrayCollection then re-assignng the dataProvider. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of ZIONIST Sent: Monday, January 18, 2010 4:11 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] Animating items in a tilelist when filtering arraycollection i guys i have probably asked this several times but i have never gotten anything solid. i have a tile list that is populated with an array collection of data from a database. i also have a filter function that i use to filter the array collection based on multiple criteria. i would like to have some kind of effect play as data is filtered to show data change just like in the flex store example. but apparently the itemschangeeffect in flex 3 does not work with filter functions. any way of achieving that goal?
[flexcoders] Combobox arrow width workaround
I'd like to be able to set the width of the ComboBox arrow. There is a style for it (arrowButtonWidth) but it doesn't work. It's a known issue/bug with the ComboBox. Does anyone have a workaround for this lack of functionality that would work in Flex3? Thanks! Warren
[flexcoders] how to get bounding rectangle of display object
Hi, I'm trying to get the bounding rectangle for a TextArea widget. e.g. = mx:TextArea id=textArea/ In AS = var r:Rectangle = textArea.getVisibleRect(); specifically, I am interested in consistently getting the top-left point of the the rectangle: var p:Point = r.topLeft; Most of the time this works as expected, but every now and again, depending on browser re-size, the topLeft point is actually calculated/returned as the topRight point. I need to anchor a tool tip at this point, and if it returns the top right coordinates, the tool tip is off the screen and unreadable. This seems like a fairly simple task, but the API isn't very clear to me here. For example, if I hover over the getVisibleRect( ) function it tells me it comes from mx.core.UIComponent, but I don't even see that listed on asdoc: http://livedocs.adobe.com/flex/3/langref/mx/core/UIComponent.html Is there a consistent way to calculate this? Thanks in advance, Davis
[flexcoders] not legal to override a function with an optional parameter, e.g. foo(s: String=null) ?
I've been asking general questions about inheritance and am splitting this question off as a separate one because it's very specific. It appears that you cannot override a function with optional parameters? protected function foo(a:String, s:String=null): void {} Isn't the signature considered the same if you do this? override protected function foo(a:String, s:String=null): void{} Thanks Tim
[flexcoders] Re: Displaying additional child nodes in Datatip
Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + o.item.session[index].bookrate + \n ; s += bStatus:/b + o.item.session[index].status + \n ; } return s; } --- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: Assuming that you have assigned an id to each series (baseline,2009-8), you could use something like this: private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == baseline ) ? 0 : 1; var s:String = bBook rate:/b + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Tim, Your recommendation sounds so simple and logical but I am not getting it to work. My problem is parsing the XML and returning the correct info for the datapoints. Following, is a sample of my XML file: items week name=1 session sessionnameBaseline/sessionname books0/books bookrate2/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate6/bookrate statusred/status /session /week week name=2 session sessionnameBaseline/sessionname books0/books bookrate3/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate1/bookrate statusred/status /session /week /items What are your thoughts? Thanks. Monette --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Yeah, you're very close. Now it's just a matter of xml. I'd start by tracing o. If the children are still in o, then drill down. Otherwise, you'll have to go and find the nodes; like you're trying below. Some things that you can start with: trace( o.toXMLString() ); var myXMLChildren:XMLList = o.children(); o.child(myProperty)[0].valueOf(); -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Below is my DataTipFunction. The commented part on top works fine. However, there is additional information that I need to include from the XML file into the data tip. When I mouse over the datapoint I would like to retrieve from the XML file the additional child nodes that correspond with that datapoint. I feel that I am very close and missing one piece. How can I accomplish this dynamically by displaying the correct data for the series? Note, I can have more than 1 series in the XML data file. private function DTPFunction(o:HitData):String { //WORKS for data that is used on the chart x and y values //var s:String; //s = b + LineSeries(o.element).displayName + /b \n; //s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + series. o.item.session.bookrate + \n ; //s += bStatus:/b + o.item.session.status + \n ; //END WORKS var s:String; var a:int=0; var fNode:XML = chart.dataProvider[0]; if ((LineSeries(o.element).displayName) == fNode.child('sessionname')) { s = b + o.item.session.sessionname[a] + /b \n; s += bBooks:/b + o.item.session.books[a] + \n + bBook rate:/b + o.item.session.bookrate[a] + \n ; s += bStatus:/b + o.item.session.status[a] + /size\n ; a++ } return s; } Thanks. Monette --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: If the dataTipFunction doesn't give you enough flexibility, you could try a dataTipRenderer. In either case, you can drill down to the child
[flexcoders] Re: how to get bounding rectangle of display object
Scratch this...figured it out. Problem was unrelated -- Rectangle.topLeft was giving me consistent results. On Mon, Jan 18, 2010 at 10:06 AM, Davis Ford davisf...@zenoconsulting.bizwrote:
[flexcoders] Question about setStyle/getStyle
Am I missing something? var h1:HBox = new HBox(); h1.setStyle(backgroundColor,0xFF); trace(GetStyle of backgroundColor-- + h1.getStyle(backgroundColor)); .trace output... GetStyle of backgroundColor-- undefined Isn't the getStyle suppose to return 0XFF? Thanks! Tino
[flexcoders] Re: Datagrid itemrenderer for adding multiple linkbuttons in same gridcolumn
Here is a quick and dirty example using the hyperlink component from jabbypanda (http://jabbypanda.com/labs/hyperLink/srcview/index.html): ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; layout=absolute width=700 mx:Script ![CDATA[ import mx.collections.ArrayCollection; [Bindable] public var initDG:ArrayCollection = new ArrayCollection([ {Company: 'Apple Computer', WebSites: 'www.apple.com,store.apple.com,developer.apple.com'}, {Company: 'Google', WebSites: 'www.google.com,code.google.com,mail.google.com'} ]); ]] /mx:Script mx:DataGrid id=myGrid dataProvider={initDG} rowCount={initDG.length} mx:columns mx:DataGridColumn width=120 dataField=Company editable=false/ mx:DataGridColumn width=500 dataField=WebSites itemRenderer=Renderers.LinksRenderer/ /mx:columns /mx:DataGrid /mx:Application LinksRenderer.as: package Renderers { import flash.net.*; import htmltext.controls.HyperLink; import htmltext.controls.events.HyperlinkEvent; import mx.containers.HBox; public class LinksRenderer extends HBox { private var link1:HyperLink = new HyperLink(); private var link2:HyperLink = new HyperLink(); private var link3:HyperLink = new HyperLink(); public function LinksRenderer() { super(); } override public function set data(value:Object):void { super.data = value; if(value != null) { var linksArray:Array = data.WebSites.split(,); link1.linkText = linksArray[0]; link1.addEventListener(HyperlinkEvent.HYPERLINK_CLICK, hyperLinkClicked); link2.linkText = linksArray[1]; link2.addEventListener(HyperlinkEvent.HYPERLINK_CLICK, hyperLinkClicked); link3.linkText = linksArray[2]; link3.addEventListener(HyperlinkEvent.HYPERLINK_CLICK, hyperLinkClicked); addChild(link1); addChild(link2); addChild(link3); } } private function hyperLinkClicked(event:HyperlinkEvent):void { navigateToURL(new URLRequest(http://; + event.target.linkText), '_blank'); } } } --- In flexcoders@yahoogroups.com, Tino Dai obe...@... wrote: Have you looked at the class LinkBar? I think that would be a good way to return a multiple buttons in a cell of a datagrid. http://livedocs.adobe.com/flex/3/langref/mx/controls/LinkBar.html -Tino On Wed, Jan 13, 2010 at 10:11 AM, aramsdell2000 aramsdell2...@...wrote: OK, that's the problem. I don't know how to add multiple link buttons through action script. And here goes my feeble attempt at explaining what I did so that it makes sense: This is how I am now populating the column with multiple hyperlinks, using the itemrenderer approach from Alex's Flex Closet HTML in an Item Renderer on this website: http://blogs.adobe.com/aharui/item_renderers/ var params:Array = (data[column.dataField]).split(, ); var urls:String = ; for (var i:Number=0; i params.length; i++) { ... urls += a href='http://webaddress?charname=; + params[i] + amp;someid= + station + amp;anotherid= + org + ' target='_blank' + params[i] + /a, ; } ... cdataTag = urls; . htmlText = cdataTag; but only a right click works to open a new window. I would like it to work with just clicking on the text like a normal HTML href. So what I wanted to do was have each string be a link button (except i don't really like the fact that it looks like a button). I have been experimenting with using a single linkbutton in a datagridcolumn for something similar: else if (column.dataField == details){ var linkItemRendererFactory:ClassFactory = new ClassFactory(LinkButton); var someid:String = data[someid]; var anotherid:String = data[anotherid]; var queryExpr:String = SomeParameterId= + someid + AnotherParameterId= + anotherid + restofurl; //this line isn't quite working either but I hope you get the idea.. //linkItemRendererFactory.properties = {label:data[column.dataField],click:callGetDetailsWebService( + queryExpr + );}; linkItemRendererFactory.properties = {label:data[column.dataField]}; column.itemRenderer = linkItemRendererFactory; I am not sure how to expand the above code to add multiple buttons. Instead of using an inline? renderer, do I have to make a new link button class and extend it or can I somehow write it into the custom CustomDataGridItemRenderer class I have now that extends DataGridItemRenderer. Hopefully that makes sense! Thanks! Amy --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Tino Dai oberoc@ wrote: Some code
[flexcoders] Re: IGraphicElement and LayoutBase
From the docs for IGraphicElement: Group organizes its IGraphicElement children in sequences that share and draw to the same DisplayObject. The DisplayObject is created by the first element in the sequence. That means that there is a single DisplayObject added to the display list upon which the graphic primitives are drawn. I am sure this DisplayObject is subject to the behaviors of the layout of the Group, as in BasicLayout vs. VerticalLayout, just like any other child of the Group. --- In flexcoders@yahoogroups.com, Florian florian.saliho...@... wrote: Ah, thanx. that clearifies a lot. But i don't understand why. I thought the IGraphicElements would be a util class to draw complex shapes into the owners graphic property. Which also means to me that the constraints should applied to be bounds of the component... What am i missing? Best regards! --- In flexcoders@yahoogroups.com, Ariel J arieljake@ wrote: You can. It's just that the constraint based sizing of the inner rect doesn't work when you use a vertical layout. Change them to height and width values of 100% and you'll see. --- In flexcoders@yahoogroups.com, Florian florian.salihovic@ wrote: Why is it not possible to draw an IGraphicElement into a Group which has a LayoutBase instance applied to it? ?xml version=1.0 encoding=utf-8? s:Application xmlns:fx=http://ns.adobe.com/mxml/2009; xmlns:s=library://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/halo minWidth=1024 minHeight=768 fx:Script ![CDATA[ import mx.graphics.SolidColor; import spark.layouts.VerticalLayout; protected function button1_clickHandler(event:MouseEvent):void { base.layout = new VerticalLayout(); } ]] /fx:Script fx:Declarations !-- Place non-visual elements (e.g., services, value objects) here -- /fx:Declarations s:controlBarContent s:Button click=button1_clickHandler(event) / /s:controlBarContent s:Group id=base bottom=100 left=100 right=100 top=100 s:Rect bottom=0 fill={new SolidColor(0, .5)} left=0 right=0 top=0 / /s:Group /s:Application
[flexcoders] Re: The grammar of Embed to define Class/Function in CSS?
.myStyle { rendererClass: ClassReference(com.mycompany.myClass); } --- In flexcoders@yahoogroups.com, xiaoming_w...@... xiaoming_w...@... wrote: Hi gurus, I have a component with style definitions like the following: [Style(name=rendererClass,type=Class,inherit=yes)] [Style(name=rendererFunction,type=Function,inherit=yes)] How to define the vlaue of these 2 styles in a CSS file if the class name and function name are known? I guess Embed works but no idea about how. background-image:Embed(/style_undefined/assets/general/bg.png); Thanks in advance.
[flexcoders] Re: Binding and Spark Skins
You are not tackling this right. The component does not create the title bar as a child. The skin will do that. Check this out: (1) Do the component in ActionScript. Declare the expected elements that the skin will define as variables. Define their behaviors and properties in the partAdded function. package com.mycompany { [SkinState(normal)] public class HostComponent extends SkinnableContainer { [SkinPart(required=false)] public var titleBar:IReportTitleBar override protected function partAdded(partName:String,instance:Object):void { if (instance == titleBar) { titleBar.label = My Label; // or use Binding: BindingUtils.bindPropert(titleBar,label,this,titleBarLabel); } } } // don't forget the partRemoved function, too } (2) Then, the skin only defines the titleBar using convenient MXML. s:SparkSkin fx:Metadata [HostComponent(com.mycompany.HostComponent)] /fx:Metadata s:states s:State name=normal/ /s:states controls:DCDocTitleBar id=titleBar / /s:SparkSkin --- In flexcoders@yahoogroups.com, amiller.demandlending amil...@... wrote: Hi Everyone, I have a sub-component which uses a String binding on a Label. The bindings works fine if I do not use a skinClass on the host component. If I do use a SparkSkin, my bindings do not execute on the sub-component. Instead, I get the value which I initialized it to. Am I doing something wrong, or is this expected behavior? If this is expected behavior, then what is the purpose of a SparkSkin if I have to explicitly redeclare all my control code in the skin? I could just be misunderstanding the intended usage, but from what I understood in the docs it seems like a very powerful new feature. Would anyone be able to enlighten me on the topic a bit more? Here is the trimmed code for my host/sub Host Component s:SkinnableContainer skinClass=demand.skins.DSDoc fx:Metadata [SkinState(normal)] /fx:Metadata fx:Script ![CDATA[ [SkinPart(required=false)] public var titleBar:IReportTitleBar override protected function createChildren():void { if (!_titleBar) { _titleBar = new DCDocTitleBar(); this.addElementAt(IVisualElement(_titleBar), 0); } super.createChildren(); } ]] /fx:Script /s:SkinnableContainer --- The title bar sub-component s:SkinnableContainer fx:Script ![CDATA[ [Bindable] public var label:String=Incorrect Label; ]] /fx:Script s:Label text={this.label}/ /s:SkinnableContainer The host component skin s:SparkSkin fx:Metadata [HostComponent(demand.reports.DRDoc)] /fx:Metadata s:states s:State name=normal/ /s:states controls:DCDocTitleBar id=titleBar / /s:SparkSkin Thanks in advance! ~Aaron
[flexcoders] Flex, SOAP and Process Flow
I've run into an odd problem that I haven't been able to find a solution to. In other programming languages (Perl, PHP, for example), if I want to do X, Y and Z in order, all with remote calls, it's very easy and straight forward. With Flex, I'm pretty confused on how to do something this simple. Here's the problem and why I'm confused ... I'm using Flex and SOAP to talk to a web interface. In order to get to step Y, I have to first do step X. I can not skip to step Y without step X being complete. But setting up the flow to be two subroutine calls, X first, then Y, doesn't mean that X finishes first (and lately means Y actually finishes first). callX(var1,var2); callY(var3,var4); Since Flex uses listeners, and not return() how do you pass data around to know that X is complete? callX(var1,var2); {wait for callX to be finished, before continuing} callY(var3,var4); How do you pass data around successfully to do that check? Does my problem description make any sense or is my brain fried? ;) Treffy.
[flexcoders] Re: Flex, SOAP and Process Flow
Basically you wait for the resultevent of the first call and put the second call in that function. --- In flexcoders@yahoogroups.com, trefalgar trefal...@... wrote: I've run into an odd problem that I haven't been able to find a solution to. In other programming languages (Perl, PHP, for example), if I want to do X, Y and Z in order, all with remote calls, it's very easy and straight forward. With Flex, I'm pretty confused on how to do something this simple. Here's the problem and why I'm confused ... I'm using Flex and SOAP to talk to a web interface. In order to get to step Y, I have to first do step X. I can not skip to step Y without step X being complete. But setting up the flow to be two subroutine calls, X first, then Y, doesn't mean that X finishes first (and lately means Y actually finishes first). callX(var1,var2); callY(var3,var4); Since Flex uses listeners, and not return() how do you pass data around to know that X is complete? callX(var1,var2); {wait for callX to be finished, before continuing} callY(var3,var4); How do you pass data around successfully to do that check? Does my problem description make any sense or is my brain fried? ;) Treffy.
[flexcoders] Re: Flex, SOAP and Process Flow
That makes sense if you can control the data that is sent back to you from the first resultevent (but I can't). 1) Web call - Does the user 'Trefalgar' exist? 2) Web reply - No. (no additional data) 3) Web call - Create user 'Trefalgar' Flex doesnt appear to be linear. That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Is there a solution for this problem in Flex/AS? I don't think putting the secondary calls in the resultevent would work, when critical information needed for future calls isn't available in the resultevent. Tref --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: Basically you wait for the resultevent of the first call and put the second call in that function. --- In flexcoders@yahoogroups.com, trefalgar trefalgar@ wrote: I've run into an odd problem that I haven't been able to find a solution to. In other programming languages (Perl, PHP, for example), if I want to do X, Y and Z in order, all with remote calls, it's very easy and straight forward. With Flex, I'm pretty confused on how to do something this simple. Here's the problem and why I'm confused ... I'm using Flex and SOAP to talk to a web interface. In order to get to step Y, I have to first do step X. I can not skip to step Y without step X being complete. But setting up the flow to be two subroutine calls, X first, then Y, doesn't mean that X finishes first (and lately means Y actually finishes first). callX(var1,var2); callY(var3,var4); Since Flex uses listeners, and not return() how do you pass data around to know that X is complete? callX(var1,var2); {wait for callX to be finished, before continuing} callY(var3,var4); How do you pass data around successfully to do that check? Does my problem description make any sense or is my brain fried? ;) Treffy.
Re: [flexcoders] Re: Flex, SOAP and Process Flow
That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org)
[flexcoders] Re: Flex, SOAP and Process Flow
That's interesting. It seems that the WSDL Importer uses AsyncTokens all over the place, but I never see any of them in the variables during a debug session. I'm now questioning if the importer actually made everything more complex than it needed to be ;) Thanks for the tip, João. I'm going to see if I can figure it out. Tref --- In flexcoders@yahoogroups.com, João Fernandes joaopedromartinsfernan...@... wrote: Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org)
[flexcoders] Re: Displaying additional child nodes in Datatip
Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monett...@... wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + o.item.session[index].bookrate + \n ; s += bStatus:/b + o.item.session[index].status + \n ; } return s; } --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Assuming that you have assigned an id to each series (baseline,2009-8), you could use something like this: private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == baseline ) ? 0 : 1; var s:String = bBook rate:/b + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Tim, Your recommendation sounds so simple and logical but I am not getting it to work. My problem is parsing the XML and returning the correct info for the datapoints. Following, is a sample of my XML file: items week name=1 session sessionnameBaseline/sessionname books0/books bookrate2/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate6/bookrate statusred/status /session /week week name=2 session sessionnameBaseline/sessionname books0/books bookrate3/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate1/bookrate statusred/status /session /week /items What are your thoughts? Thanks. Monette --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Yeah, you're very close. Now it's just a matter of xml. I'd start by tracing o. If the children are still in o, then drill down. Otherwise, you'll have to go and find the nodes; like you're trying below. Some things that you can start with: trace( o.toXMLString() ); var myXMLChildren:XMLList = o.children(); o.child(myProperty)[0].valueOf(); -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Below is my DataTipFunction. The commented part on top works fine. However, there is additional information that I need to include from the XML file into the data tip. When I mouse over the datapoint I would like to retrieve from the XML file the additional child nodes that correspond with that datapoint. I feel that I am very close and
[flexcoders] Re: Flex, SOAP and Process Flow
For those wanting to follow this suggestion, there's a good example here: http://livedocs.adobe.com/flex/3/html/help.html?content=data_4.html. It's towards the bottom, Using a return token. Unfortunately, this example doesn't appear to work for me. It uses the Flex-built SOAP code and an AsyncToken to keep track of things. I don't have a FaultEvent.FAULT or ResultEvent.RESULT option when adding an event listener to my AsyncToken. Back to the drawing board I go. Jacob --- In flexcoders@yahoogroups.com, João Fernandes joaopedromartinsfernan...@... wrote: That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org)
Re: [flexcoders] DragDrop event propagation
I don’t think there is a way to refuse the drop when the dragDrop event occurs. And especially if you want to pause for input. On 1/18/10 4:19 AM, txakin txa...@yahoo.com wrote: Hi all, I have a tree component with an xml file as dataprovider. I would like to move node from one parent to other one, previously an alert message. 1.- I drag a node 2.- Before drop this node in new parent node, i want to display an alert message. 3.- If the user click YES, i want to move the node to the new parent 4.- If the user click NO, i want to cancel the drag and drop event. Here is my source: in the tree component i have the next properties: dropEnabled=true dragEnabled=true dragMoveEnabled=true dragDrop=customDragDrop(event) allowMultipleSelection=false The customDragDrop(event) function is: import mx.events.DragEvent; import mx.managers.DragManager; private var queuedEvent:DragEvent; private function customDragDrop(event:DragEvent): void { //Get the data from the dragSource var items:Object = event.dragSource.dataForFormat(treeItems); event.stopPropagation(); queuedEvent = event as DragEvent; var messageText:String = Are you sure you want to move the node + items[...@label.touppercase() + ?; var titleText:String = Warning; var alert:Alert = Alert.show(messageText, titleText, Alert.NO | Alert.YES, this, customDragDropHandler,alertIcon); } private function customDragDropHandler(event:CloseEvent):void{ if (event.detail == Alert.NO){ queuedEvent.preventDefault(); queuedEvent.target.hideDropFeedback(queuedEvent); DragManager.showFeedback(DragManager.NONE); } else { dispatchEvent(queuedEvent); } } I don´t know why i can not get my solution, please i need your help. Thanks in advance. -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Re: How long does it take to learn Flex and get a job?
One thing to consider is 1 year of experience or 1 month of experience repeated for 12 months. Big difference. What I mean is that learning the syntax and usage of Flex is one thing. Creating Flex apps to handle real world problems is another thing entirely. Most tutorials that have you building photo browsers don't go very far in terms of business needs such as dealing with databases, user authentication, version control, blah blah blah. Also, are you looking to specialize in a specific area? Websites vs. UI interfaces to large enterprise SOA deployments, etc. I suggest learning other programming basics to go along with your Flex learning. Java or C#.net would be good and both are pretty similar. JavaScript, XML, and (X)HTML are good skills to have as well. Another suggestion is to look through the help wanted ads in your area and see what skills people are looking for. Around here Flash developers with strong AS3 skills are in high demand. Most of the jobs requiring Flex I've seen require MVC skills and strong Java skills with Spring/Hibernate/etc. The other types of jobs requiring Flex usually also require strong AJAX/JavaScript/jQuery skills. Best of luck! --- In flexcoders@yahoogroups.com, fred44455 fred44...@... wrote: I am new to Flex and started learning Flex 3 months ago. I have no programming background. I wonder how long does it take to learn Flex and how long will take me before I can apply for an entry level position? I gave myself 1 year but I wonder if it is a realistic time frame? Thanks for your time. Fred.
Re: [flexcoders] Re: Flex, SOAP and Process Flow
You can add a responder to your AsyncToken which will carry your fault and result handlers. 2010/1/18 trefalgar trefal...@yahoo.com For those wanting to follow this suggestion, there's a good example here: http://livedocs.adobe.com/flex/3/html/help.html?content=data_4.html. It's towards the bottom, Using a return token. Unfortunately, this example doesn't appear to work for me. It uses the Flex-built SOAP code and an AsyncToken to keep track of things. I don't have a FaultEvent.FAULT or ResultEvent.RESULT option when adding an event listener to my AsyncToken. Back to the drawing board I go. Jacob --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, João Fernandes joaopedromartinsfernan...@... wrote: That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org) -- João Fernandes
[flexcoders] Re: Flex, SOAP and Process Flow
Yeap, looking at that now and having little luck as well. http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_23313753.html, for example, shows someone with a similar problem with a similar solution. Here's what I've got ... var myService:Statistics = new Statistics(null,endPoint); var token:AsyncToken = myService.disableStatistics(user,pass,email,tArray); token.email = email; token.addResponder(new AsyncResponder(myResults,myFaults,token)); myResults and myFaults are never hit. If I use addEventListener against myService instead, I get the resulting data, but nothing from the token:AsyncToken. I'm not comfortable that I have the AsyncToken set up properly, since it doesnt make sense to make the call to myService before 'email' or 'addResponder' is issued, which is what I'm playing with right now. Treffy --- In flexcoders@yahoogroups.com, João Fernandes joaopedromartinsfernan...@... wrote: You can add a responder to your AsyncToken which will carry your fault and result handlers. 2010/1/18 trefalgar trefal...@... For those wanting to follow this suggestion, there's a good example here: http://livedocs.adobe.com/flex/3/html/help.html?content=data_4.html. It's towards the bottom, Using a return token. Unfortunately, this example doesn't appear to work for me. It uses the Flex-built SOAP code and an AsyncToken to keep track of things. I don't have a FaultEvent.FAULT or ResultEvent.RESULT option when adding an event listener to my AsyncToken. Back to the drawing board I go. Jacob --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, João Fernandes joaopedromartinsfernandes@ wrote: That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org) -- João Fernandes
[flexcoders] Using PlotSeries icon in a seperate control
I need to create an instance of a PlotSeries icon. It's easy enough to discover the PlotSeries item renderer: var renderer:ClassFactory = plotSeries.getStyle(itemRenderer); However, if I have not figured out how to create an instance of the renderer so I can add it to the display list. Here is a short test program, consisting of two files. The first file is a VBox whose icon property should be set to the item renderer instance. // TestBox.mxml ?xml version=1.0 encoding=utf-8? mx:VBox xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.controls.*; import mx.charts.series.PlotSeries; public var plotSeries:PlotSeries; public var generator:Class; override protected function createChildren():void { super.createChildren(); if (false) { // this works (icon is shown) icon = generator; } else { // does not work (no icon) var renderer:ClassFactory = plotSeries.getStyle(itemRenderer); icon = renderer.generator; /* var x:* = renderer.newInstance(); trace(x); */ } } ]] /mx:Script /mx:VBox // index.mxml /* This is the application; it contains two embedded images that can be used to set the TestBox's icon property. That works. onPlotChartComplete() sets the icon. */ ?xml version=1.0 encoding=utf-8? mx:Application xmlns:local=* xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.collections.ArrayCollection; import mx.charts.series.PlotSeries; [Bindable] private var expensesAC:ArrayCollection = new ArrayCollection( [ { Month: Jan, Profit: 2000, Expenses: 1500, Amount: 450 }, { Month: Feb, Profit: 1000, Expenses: 200, Amount: 600 }, { Month: Mar, Profit: 1500, Expenses: 500, Amount: 300 } ]); [Embed(source=warning.png)] private static var WarningClass:Class; [Embed(source=error.png)] private static var ErrorClass:Class; private function onPlotChartComplete():void { var testBox1:TestBox = new TestBox(); testBox1.plotSeries = plotSeries1; testBox1.generator = ErrorClass; testBox1.label = Error; tab.addChild(testBox1); var testBox2:TestBox = new TestBox(); testBox2.plotSeries = plotSeries2; testBox2.generator = WarningClass; testBox2.label = Warning; tab.addChild(testBox2); } ]] /mx:Script mx:PlotChart creationComplete=onPlotChartComplete() dataProvider={expensesAC} height=50% width=100% mx:series mx:PlotSeries id=plotSeries1 xField=Expenses yField=Profit displayName=Plot 1 / mx:PlotSeries id=plotSeries2 xField=Amount yField=Expenses displayName=Plot 2 / /mx:series /mx:PlotChart mx:TabNavigator height=50% id=tab width=100% / /mx:Application Suggestions? Mike
Re: [flexcoders] Building to FP10 breaks code that works if I build to FP9...why?
Yes, it looked like a scoping problem to me as well. Just curious as to why it works in 9 but not 10. I couldn't find any documentation that said there was a change in this area. On 18/01/2010, at 10:37 PM, thomas parquier wrote: Hello, I think your create function is not in class instance scope (because inline) : should be static or from an instance of Dohickey to work, I think. thomas parquier --- http://www.web-attitude.fr/realisations/ msn : thomas.parqu...@web-attitude.fr softphone : sip:webattit...@ekiga.net téléphone portable : +33601 822 056 2010/1/18 Guy Morton g...@alchemy.com.au Hello people, I hope someone here can point me in the right direction here. I have a class in my codebase that defines objects that contain functions eg (pseudocode): package com.my.package { import flash.events.EventDispatcher; public class Dohickey extends EventDispatcher { public var thingy:Whatsit; public function init():void { doThings.create(); } public var doThings:Object = { create: function():void { if ( ! thingy ) { thingy = new Whatsit(); } } }; } } Now, if I build to Flash Player 9, I can call init() on the above code and doThings.create() will run and create a new Whatsit into the thingy variable. If I build it to Flash Player 10, I get an error saying ReferenceError: Error #1069: Property com.my.package:Dohickey::thingy not found on Object and there is no default value. at anonymous()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:19] at com.my.package::Dohickey/create()[/Users/guy/Documents/Flex Builder 3/../Dohickey.as:11] Can someone explain why? Please? :-) Guy
[flexcoders] Re: Flex, SOAP and Process Flow
I use the Operation classes from the MVCS architecture from Joe Berkowitz to group the series of external calls, for each user in your case. --- In flexcoders@yahoogroups.com, trefalgar trefal...@... wrote: I've run into an odd problem that I haven't been able to find a solution to. In other programming languages (Perl, PHP, for example), if I want to do X, Y and Z in order, all with remote calls, it's very easy and straight forward. With Flex, I'm pretty confused on how to do something this simple. Here's the problem and why I'm confused ... I'm using Flex and SOAP to talk to a web interface. In order to get to step Y, I have to first do step X. I can not skip to step Y without step X being complete. But setting up the flow to be two subroutine calls, X first, then Y, doesn't mean that X finishes first (and lately means Y actually finishes first). callX(var1,var2); callY(var3,var4); Since Flex uses listeners, and not return() how do you pass data around to know that X is complete? callX(var1,var2); {wait for callX to be finished, before continuing} callY(var3,var4); How do you pass data around successfully to do that check? Does my problem description make any sense or is my brain fried? ;) Treffy.
[flexcoders] Re: Flex, SOAP and Process Flow
I've given up for now. AsyncTokens appear to be the way to go, but by the documentation I've seen it *should* work, but the result/fault handlers are never hit. I decided to try using 'closure' instead - I'm not even sure if the variables will remain stateful, but it's at least in a forward direction for now. I think this is another case of the documentation being abysmally lacking. Tref --- In flexcoders@yahoogroups.com, trefalgar trefal...@... wrote: Yeap, looking at that now and having little luck as well. http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/Flex/Q_23313753.html, for example, shows someone with a similar problem with a similar solution. Here's what I've got ... var myService:Statistics = new Statistics(null,endPoint); var token:AsyncToken = myService.disableStatistics(user,pass,email,tArray); token.email = email; token.addResponder(new AsyncResponder(myResults,myFaults,token)); myResults and myFaults are never hit. If I use addEventListener against myService instead, I get the resulting data, but nothing from the token:AsyncToken. I'm not comfortable that I have the AsyncToken set up properly, since it doesnt make sense to make the call to myService before 'email' or 'addResponder' is issued, which is what I'm playing with right now. Treffy --- In flexcoders@yahoogroups.com, João Fernandes joaopedromartinsfernandes@ wrote: You can add a responder to your AsyncToken which will carry your fault and result handlers. 2010/1/18 trefalgar trefalgar@ For those wanting to follow this suggestion, there's a good example here: http://livedocs.adobe.com/flex/3/html/help.html?content=data_4.html. It's towards the bottom, Using a return token. Unfortunately, this example doesn't appear to work for me. It uses the Flex-built SOAP code and an AsyncToken to keep track of things. I don't have a FaultEvent.FAULT or ResultEvent.RESULT option when adding an event listener to my AsyncToken. Back to the drawing board I go. Jacob --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, João Fernandes joaopedromartinsfernandes@ wrote: That said, since #2 doesn't tell me what user it's replying no to, if I do this in a loop with 100 users, it could be replying back with 20 nos and I can't tell how I'd match the replies up with the requests. Yes you can, try using the asyncToken generated by service.invokeWs(user) and store your user in some property (eg. currentUser) , once you get the resultEvent, that AsyncToken will have the corresponding user stored (event.token.currentUser). -- João Fernandes Adobe Certified Expert Adobe Community Expert http://www.twitter.com/joaofernandes http://www.riapt.org Portugal Adobe User Group (http://aug.riapt.org) -- João Fernandes
[flexcoders] if (foo)
Other than style, are there reasons reasons to prefer using if (foo != null) rather than if (foo) Thanks.
[flexcoders] Re: if (foo)
I once ran some tests to test this. What I found is that checking against null is much faster. Sorry I do not have the test code around anymore but it would be very simple to build again. My guess as to why is that if (foo) is implicit and the conditional could be met by a couple things. if foo was a boolean it being null or false would cause the conditional to fail. If the object was a number it being null or = 0 would cause the condition to fail. So on and so forth. When checking if (foo != null) you are explicitly checking if that object is null not if that object is null or false, or 0, ect so this check is much faster. I also think if (foo != null) is better syntax to look at because I can tell exactly what you are checking for, that is you are intersted in if foo is null not that it is == false or = 0 or anything like that. I feel that if (foo) is lazy. So in the interest of speed and clean code you should always check for exactly what you want. --- In flexcoders@yahoogroups.com, mitchgrrt mitch_g...@... wrote: Other than style, are there reasons reasons to prefer using if (foo != null) rather than if (foo) Thanks.
Re: [SPAM] [flexcoders] e4x to Datagrid not removing the tags when rendered
Thank you for taking the time to answer my question and explaining the datagrid dataprovider. I think what what problem is the way the xml I am importing is formatted. The root node is the name of the xml, then I have the repeating node. Within the repeating node I have data that needs to go in the datagrid. Problem is the tag names within the repeating node. Please see my example: root repeat feature/feature value/value feature/feature value/value /repeat repeat feature/feature value/value feature/feature value/value /repeat /root What I need to do is to put the feature data in repeat[0].feature into a datagrid. But because feature is in repeat[0] twice(20 in the real app) it will not load it properly. Any idea how to accomplish this? I have been trying for several weeks now with no luck.Ha! Thanks in advance. --- In flexcoders@yahoogroups.com, Tracy Spratt tr...@... wrote: First, the DataGrid dataProvider itself must be some kind of list. It can be an ArrayCollection, an XMLListCollection, an Array or XMLList(avoid these if you plan to programmatically update the dataProvider) There are two ways to get an HTTPService result into a dataProvider. One is to bind to lastResult.avoid this. Instead, use a resultHandler to assign the appropriate list type to a variable, and bind to that. If you dataProvider is valid, you might have just forgotten to specify the dataField for the columns. If you are setting that property, then you need to know that dataField can only handle a string, not an expression, and the property specified must be a top-level property of the dataProvider item. If the dataProvider items are XML nodes, the datafield must specify a first-level childNode(data in the text node of that node) or an attribute. If it is an attribute then you need to use the @ symbol. Example: dataField=@myAttribute. Hope this helps. Tracy Spratt, Lariat Services, development services available _ From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Quintjer Sent: Sunday, January 17, 2010 10:49 AM To: flexcoders@yahoogroups.com Subject: [SPAM] [flexcoders] e4x to Datagrid not removing the tags when rendered Hello all, I am importing an xml file in air to a datagrid but the data in the grid is still showing the tags. I have tried everying that I can think of. Earlier I tried imporing the file using HTTP server as an object and then got the data to display properly at that point but this has be be imported as xml. AnyIdeas are greatly appreciated.
[flexcoders] Re: Binding and Spark Skins
Ah.. So the component is strictly data/control code, and the skin is strictly visual code and layout. Very sweet. Thanks for the insight. Cheers! ~Aaron --- In flexcoders@yahoogroups.com, Ariel J arielj...@... wrote: You are not tackling this right. The component does not create the title bar as a child. The skin will do that. Check this out: (1) Do the component in ActionScript. Declare the expected elements that the skin will define as variables. Define their behaviors and properties in the partAdded function. package com.mycompany { [SkinState(normal)] public class HostComponent extends SkinnableContainer { [SkinPart(required=false)] public var titleBar:IReportTitleBar override protected function partAdded(partName:String,instance:Object):void { if (instance == titleBar) { titleBar.label = My Label; // or use Binding: BindingUtils.bindPropert(titleBar,label,this,titleBarLabel); } } } // don't forget the partRemoved function, too } (2) Then, the skin only defines the titleBar using convenient MXML. s:SparkSkin fx:Metadata [HostComponent(com.mycompany.HostComponent)] /fx:Metadata s:states s:State name=normal/ /s:states controls:DCDocTitleBar id=titleBar / /s:SparkSkin --- In flexcoders@yahoogroups.com, amiller.demandlending amiller@ wrote: Hi Everyone, I have a sub-component which uses a String binding on a Label. The bindings works fine if I do not use a skinClass on the host component. If I do use a SparkSkin, my bindings do not execute on the sub-component. Instead, I get the value which I initialized it to. Am I doing something wrong, or is this expected behavior? If this is expected behavior, then what is the purpose of a SparkSkin if I have to explicitly redeclare all my control code in the skin? I could just be misunderstanding the intended usage, but from what I understood in the docs it seems like a very powerful new feature. Would anyone be able to enlighten me on the topic a bit more? Here is the trimmed code for my host/sub Host Component s:SkinnableContainer skinClass=demand.skins.DSDoc fx:Metadata [SkinState(normal)] /fx:Metadata fx:Script ![CDATA[ [SkinPart(required=false)] public var titleBar:IReportTitleBar override protected function createChildren():void { if (!_titleBar) { _titleBar = new DCDocTitleBar(); this.addElementAt(IVisualElement(_titleBar), 0); } super.createChildren(); } ]] /fx:Script /s:SkinnableContainer --- The title bar sub-component s:SkinnableContainer fx:Script ![CDATA[ [Bindable] public var label:String=Incorrect Label; ]] /fx:Script s:Label text={this.label}/ /s:SkinnableContainer The host component skin s:SparkSkin fx:Metadata [HostComponent(demand.reports.DRDoc)] /fx:Metadata s:states s:State name=normal/ /s:states controls:DCDocTitleBar id=titleBar / /s:SparkSkin Thanks in advance! ~Aaron
[flexcoders] Bounding Box Problem (Again)
This time it is in the dynamic code... pageContent is a VBox on a TitleWindow. var box:Box=new Box(); box.percentWidth=100; box.setStyle(horizontalAlign,center); var image:Image = new Image(); image.percentWidth = psize; image.source = med2file; box.addChild(image); pageContent.addChild(box); How do I stop the bounding box from rocketting off the bottom of the VBox. I've even got scroll bars to show for it. How do I tightly close my bounding box around the scaled image? - Stephen
[flexcoders] Re: Displaying additional child nodes in Datatip
This will work. However, the series count is not limited to just 3 series, it's count is dynamic depending on the amount of data collected. So the code needs to check how many series exists and then generate the datatip for the different series data points. It is easy for me to accomplish this in VB.NET or vbscript but I am just having problems accomplishing what I need in AS. --- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + o.item.session[index].bookrate + \n ; s += bStatus:/b + o.item.session[index].status + \n ; } return s; } --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Assuming that you have assigned an id to each series (baseline,2009-8), you could use something like this: private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == baseline ) ? 0 : 1; var s:String = bBook rate:/b + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Tim, Your recommendation sounds so simple and logical but I am not getting it to work. My problem is parsing the XML and returning the correct info for the datapoints. Following, is a sample of my XML file: items week name=1 session sessionnameBaseline/sessionname books0/books bookrate2/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate6/bookrate statusred/status /session /week week name=2 session sessionnameBaseline/sessionname books0/books bookrate3/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate1/bookrate statusred/status /session /week /items What are your thoughts? Thanks. Monette --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Yeah, you're very close. Now it's just a matter of xml. I'd start by tracing o. If the children are still in o, then drill down. Otherwise, you'll have to go and find the nodes; like you're trying below. Some things that you can start with: trace( o.toXMLString() ); var
[flexcoders] Re: Displaying additional child nodes in Datatip
Easy enough, create a dictionary (id or name) when the series's are created; with the index. And/Or you can get the count from myChart.series.length. -TH --- In flexcoders@yahoogroups.com, Monette monett...@... wrote: This will work. However, the series count is not limited to just 3 series, it's count is dynamic depending on the amount of data collected. So the code needs to check how many series exists and then generate the datatip for the different series data points. It is easy for me to accomplish this in VB.NET or vbscript but I am just having problems accomplishing what I need in AS. --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + o.item.session[index].bookrate + \n ; s += bStatus:/b + o.item.session[index].status + \n ; } return s; } --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Assuming that you have assigned an id to each series (baseline,2009-8), you could use something like this: private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == baseline ) ? 0 : 1; var s:String = bBook rate:/b + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Tim, Your recommendation sounds so simple and logical but I am not getting it to work. My problem is parsing the XML and returning the correct info for the datapoints. Following, is a sample of my XML file: items week name=1 session sessionnameBaseline/sessionname books0/books bookrate2/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate6/bookrate statusred/status /session /week week name=2 session sessionnameBaseline/sessionname books0/books bookrate3/bookrate statusred/status /session session sessionname2009-8/sessionname books0/books bookrate1/bookrate statusred/status /session /week /items What are your thoughts? Thanks. Monette --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote:
[flexcoders] Re: Displaying additional child nodes in Datatip
So, maybe something like this: private function dtFunction( o:HitData ):String { var series:LineSeries = LineSeries( o.element ) as LineSeries; var seriesIndex:int; for ( var a:int = 0; a myChart.series.length; a++ ) { var lineSeries:LineSeries = myChart.series[ a ] as LineSeries; if ( lineSeries.displayName == series.displayName ) { seriesIndex = a; break; } } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; return s; } -TH --- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: Easy enough, create a dictionary (id or name) when the series's are created; with the index. And/Or you can get the count from myChart.series.length. -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: This will work. However, the series count is not limited to just 3 series, it's count is dynamic depending on the amount of data collected. So the code needs to check how many series exists and then generate the datatip for the different series data points. It is easy for me to accomplish this in VB.NET or vbscript but I am just having problems accomplishing what I need in AS. --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s += bBooks:/b + LineSeriesItem(o.chartItem).yValue + \n + bBook rate:/b + o.item.session[index].bookrate + \n ; s += bStatus:/b + o.item.session[index].status + \n ; } return s; } --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Assuming that you have assigned an id to each series (baseline,2009-8), you could use something like this: private function dtFunction( o:HitData ):String { var index:int = ( LineSeries( o.element ).id == baseline ) ? 0 : 1; var s:String = bBook rate:/b + o.item.session[ index ].bookrate; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Tim, Your recommendation sounds so simple and logical but I am not getting it to work. My problem is parsing the XML and returning the correct info for the datapoints. Following, is a sample of my XML file: items week name=1 session
[flexcoders] Re: Displaying additional child nodes in Datatip
Cleaner: private function dtFunction( o:HitData ):String { var series:LineSeries = LineSeries( o.element ) as LineSeries; var seriesIndex:int; for ( seriesIndex = 0; seriesIndex myChart.series.length; seriesIndex++ ) { var lineSeries:LineSeries = myChart.series[ seriesIndex ] as LineSeries; if ( lineSeries.displayName == series.displayName ) { break; } } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; return s; } -TH --- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: So, maybe something like this: private function dtFunction( o:HitData ):String { var series:LineSeries = LineSeries( o.element ) as LineSeries; var seriesIndex:int; for ( var a:int = 0; a myChart.series.length; a++ ) { var lineSeries:LineSeries = myChart.series[ a ] as LineSeries; if ( lineSeries.displayName == series.displayName ) { seriesIndex = a; break; } } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; return s; } -TH --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Easy enough, create a dictionary (id or name) when the series's are created; with the index. And/Or you can get the count from myChart.series.length. -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: This will work. However, the series count is not limited to just 3 series, it's count is dynamic depending on the amount of data collected. So the code needs to check how many series exists and then generate the datatip for the different series data points. It is easy for me to accomplish this in VB.NET or vbscript but I am just having problems accomplishing what I need in AS. --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while loop working? Thanks so much for your help Tim! Monette private function dtFunction( o:HitData ):String var s:String; for (var a:int=0; a 3; a++) { var index:int = (LineSeries(o.element).id == s + a)? 0 : 1; s = b + LineSeries(o.element).displayName + /b \n; s +=
[flexcoders] Re: Displaying additional child nodes in Datatip
Three time's a charm: var series:LineSeries = LineSeries( o.element ); var seriesIndex:int; for ( seriesIndex = 0; seriesIndex myChart.series.length; seriesIndex++ ) { var lineSeries:LineSeries = myChart.series[ seriesIndex ] as LineSeries; if ( lineSeries == series ) { break; } } -TH --- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote: Cleaner: private function dtFunction( o:HitData ):String { var series:LineSeries = LineSeries( o.element ) as LineSeries; var seriesIndex:int; for ( seriesIndex = 0; seriesIndex myChart.series.length; seriesIndex++ ) { var lineSeries:LineSeries = myChart.series[ seriesIndex ] as LineSeries; if ( lineSeries.displayName == series.displayName ) { break; } } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; return s; } -TH --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: So, maybe something like this: private function dtFunction( o:HitData ):String { var series:LineSeries = LineSeries( o.element ) as LineSeries; var seriesIndex:int; for ( var a:int = 0; a myChart.series.length; a++ ) { var lineSeries:LineSeries = myChart.series[ a ] as LineSeries; if ( lineSeries.displayName == series.displayName ) { seriesIndex = a; break; } } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; return s; } -TH --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Easy enough, create a dictionary (id or name) when the series's are created; with the index. And/Or you can get the count from myChart.series.length. -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: This will work. However, the series count is not limited to just 3 series, it's count is dynamic depending on the amount of data collected. So the code needs to check how many series exists and then generate the datatip for the different series data points. It is easy for me to accomplish this in VB.NET or vbscript but I am just having problems accomplishing what I need in AS. --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote: Ok, good. Not sure exactly what you're trying to do, but it's basically the same type of thing as the data function. It's all about getting to right data for the series. Here's some code for getting individual values and for calculating totals for the week private function dtFunction( o:HitData ):String { var seriesId:String = LineSeries( o.element ).id; var seriesIndex:int; switch ( seriesId ) { case s0: seriesIndex = 0; break; case s1: seriesIndex = 1; break; case s2: seriesIndex = 2; break; default: break; } var totalBooksForWeek:int = 0; for ( var a:int = 0; a 3; a++ ) { var sessionBooks:int = o.item.session[ a ].books; totalBooksForWeek += sessionBooks; } var s:String = b + LineSeries( o.element ).displayName + /b\n; s += bBooks:/b + LineSeriesItem( o.chartItem ).yValue + \n; s += bBook rate:/b + o.item.session[ seriesIndex ].bookrate + \n; s += bStatus:/b + o.item.session[ seriesIndex ].status + \n; s += bTotal Books for All Sessions:/b + totalBooksForWeek + \n; return s; } -TH --- In flexcoders@yahoogroups.com, Monette monettemm@ wrote: Almost there! I assigned an id to each series - s1, s2, s3 etc. Below I am trying to loop for the total amount of series. The values show up for bookrate and status but they are the incorrect values for some of the datapoints. If I define a as 0, 1 or 3 without the loop the values are correct for just that particular series. Why isn't the for loop or while
[flexcoders] Re: The grammar of Embed to define Class/Function in CSS?
Thank you so much. Is it possible to set Function as a style property? --- In flexcoders@yahoogroups.com, Ariel J arielj...@... wrote: .myStyle { rendererClass: ClassReference(com.mycompany.myClass); } --- In flexcoders@yahoogroups.com, xiaoming_wang@ xiaoming_wang@ wrote: Hi gurus, I have a component with style definitions like the following: [Style(name=rendererClass,type=Class,inherit=yes)] [Style(name=rendererFunction,type=Function,inherit=yes)] How to define the vlaue of these 2 styles in a CSS file if the class name and function name are known? I guess Embed works but no idea about how. background-image:Embed(/style_undefined/assets/general/bg.png); Thanks in advance.
[flexcoders] How do I get an array of Images
var imgArray:Array = new Array(); imgArray.push(new Image()); imgArray[imgArray.length].percentWidth=50; imgArray[imgArray.length].source=/media/Image.png; imgArray[imgArray.length].addEventListener(Event.COMPLETE, AdjustImageDimensions); etc. I just dont get it, can someone elusidate me on how its done!
Re: [flexcoders] How do I get an array of Images
criptopus wrote: var imgArray:Array = new Array(); imgArray.push(new Image()); imgArray[imgArray.length].percentWidth=50; imgArray[imgArray.length].source=/media/Image.png; imgArray[imgArray.length].addEventListener(Event.COMPLETE, AdjustImageDimensions); etc. I just dont get it, can someone elusidate me on how its done! Just to get you started, Arrays start from 0 not 1..
Re: [flexcoders] question about inheritance and events and overriding methods
I just tried it on my machine and it compiled without any problems after I took out the dependencies I didn't have access to. I never got the error you mentioned. Maybe it's referring to something else? Cut everything out of your project (maybe make a new one) except the onResult function you believe may be the cause and see if you still get the error. I suspect you won't. Good luck! Aaron On Mon, Jan 18, 2010 at 7:29 AM, Tim Romano tim_rom...@yahoo.com wrote: I am having trouble with an override, getting Method marked override must override another method. No problem at all doing this: in the BASE CLASS: protected function foo(): void{} in the SUBCLASS override protected function foo(): void{} But the error given above occurs here: in the BASE CLASS protected function onResult(e:ResultEvent, token:Object=null):void {} in the SUBCLASS override protected function onResult(e:ResultEvent, token:Object=null):void {} I don't see why it's not working. All of the requirements set out here seem to be satisfied: http://livedocs.adobe.com/flex/3/html/help.html?content=04_OO_Programming_11.html I've included the class implementations below. Is the cause of the error evident? Thanks again for the help, it's appreciated doubly because I'm stumped by this. Tim === BASE CLASS == package TESTREST { import mx.rpc.http.HTTPService; import mx.rpc.AsyncResponder; import mx.rpc.AsyncToken; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; import OEREST.events.*; import OEUTIL.BindableArrayCollection; import json.*; import OEUTIL.SearchConstants; public class MYHTTPSERVICEBASE extends HTTPService { private var _params: Object; private function get Params(): Object {return _params;} public function MYHTTPSERVICEBASE(destination: String, params:Object = null) { var _params: Object=params; var baseURL: String; if ( SearchConstants.DEBUGMODE) { baseURL = SearchConstants.DEBUG_BASEURL ; }else{ baseURL= SearchConstants.RELEASE_BASEURL ; } super(baseURL, destination); } public function execute(): void { var myResponder : AsyncResponder= new AsyncResponder(onResult, onFault); this.resultFormat= HTTPService.RESULT_FORMAT_TEXT; var token: AsyncToken; if ( this.Params == null) { this.method=GET; token = this.send(); } else { this.method=POST; token = this.send(Params); } token.addResponder(myResponder); } protected function foo(): void {} protected function onResult(e:ResultEvent, token:Object=null):void {} protected function onFault(evt:FaultEvent, token: Object=null):void {} } } == SUBCLASS package TESTREST { public class TestService extends TESTREST.MYHTTPSERVICEBASE { import mx.rpc.events.ResultEvent; protected const DEBUGMODE:Boolean = CONFIG::debug; protected const DEBUG_BASEURL:String = http://localhost/OESharpDeploy/; http://localhost/OESharpDeploy/ protected const RELEASE_BASEURL:String = ; import TESTREST.events.*; import json.JParser; public function TestService() { var dest: String =getServiceURL(); var selTitles : Array =new Array(1,2,3,4,5,6,7,8,9,10,11,12); var ss:String = JParser.encode(selTitles); var params:Object = {selectedTitles: ss}; super( dest, params); } private function getServiceURL(): String { if (DEBUGMODE) { return DEBUG_BASEURL + /SSQ.ashx ; }else{ return RELEASE_BASEURL + /SSQ.ashx ; } } override protected function foo(): void{} override protected function onResult(e:ResultEvent, token:Object=null):void {} } } On 1/17/2010 10:49 PM, Aaron Hardy wrote: I'm not sure I understand your question clearly but if I assume correctly I think the answer will be yes, there is no need for each descendant to instantiate its own responder. Aaron On Sun, Jan 17, 2010 at 6:37 PM, Tim Romano tim_rom...@yahoo.com wrote: Thank you, Aaron, for the helpful answers. My intention would be to have each of the descendants of MYHTTPSERVICEBASE point to a different destination and raise an event specific to that destination, and to have a separate listeners for each kind of event. If I've understood you correctly, there is no need for each of the descendants to instantiate their own Responder and no requirement for
[flexcoders] flash builder beta 2 sn?
I try to use Flex Builder 3 sn,but it can not be accept. Thanks
Re: [flexcoders] flash builder beta 2 sn?
Why? On Tue, Jan 19, 2010 at 10:11 AM, markflex2007 markflex2...@yahoo.comwrote: I try to use Flex Builder 3 sn,but it can not be accept. Thanks -- With Regards Shabir Ahmad Gilkar Srinagar Kashmir JK Voice: +91 9419942501 email: shabirgil...@gmail.com URL: http://shabirgilkar.wordpress.com Skype: shabirgilkar
Re: [flexcoders] flash builder beta 2 sn?
From http://labs.adobe.com/technologies/flashbuilder4/?tabID=details#tabTop How long can I use Flash Builder 4 beta 2? The beta 2 release of Flash Builder 4 will run for 60 days from installation before timing out. You may continue your use of beta 2 after the first 60 days by entering a valid Flash Builder 4 extension serial number. All current Flex Builder 3 customers will be emailed an extension serial number. If you own a copy of Flex Builder 3 and did not receive an email with an extension serial number, you may request one online by entering your valid Flex Builder 3 serial number. Please visit http://www.adobe.com/go/flashbuilderextension to request an extension serial number. If you don’t yet own Flex Builder 3 and want to continue using the beta you will need to purchase a Flex Builder 3 license. By adding a 12 month maintenance plan with your purchase, you will receive a free-of-charge copy of Flash Builder 4 when it ships. 2010/1/19 markflex2007 markflex2...@yahoo.com: I try to use Flex Builder 3 sn,but it can not be accept. Thanks -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: flexcoders-dig...@yahoogroups.com flexcoders-fullfeatu...@yahoogroups.com * To unsubscribe from this group, send an email to: flexcoders-unsubscr...@yahoogroups.com * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/