[flexcoders] Re: DataGrids and ViewStacks
--- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote: > > Whenerver I hear "ViewStack problem", I think "deferred instantiation". > > > > But if the DG is showing rows, then that is probably not the issue. Are > you doing anything clever, like dynamically building the DG columns? > > > > If you have rows but no visible data, then the problem is probably with > the column definitions. Doesn't the datagrid create 4 rows by default?
Re: [flexcoders]How do I get the key of an Object?
If you're trying to compare one object to... the "same object", you can use the strict equality operator (===) http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary044.html "Variables, objects, arrays, and functions are compared by reference. Two variables are equal if they refer to the same object, array, or function. Two separate arrays are never considered equal, even if they have the same number of elements." On Sat, Jan 10, 2009 at 8:46 PM, dorkie dork from dorktown < dorkiedorkfromdorkt...@gmail.com> wrote: > Graduate from hogwarts. I was thinking of comparing it to another object > to see if I had a match. I suppose I could evaluate if > (this=objectiamlookingfor). The problem is the object is on the application > and the object extends EventDispatcher. If it extended DisplayObject I could > enumerate all the instances on the application and do the comparison. Since > it extends the EventDispatcher it isn't in the enumeration list of the > application. > > On Sat, Jan 10, 2009 at 2:39 AM, Paul Andrews wrote: > >> >> >> - Original Message - >> *From:* dorkie dork from dorktown >> *To:* flexcoders@yahoogroups.com >> *Sent:* Saturday, January 10, 2009 5:54 AM >> *Subject:* [flexcoders]How do I get the key of an Object? >> >> Whilst I'm debugging I see this key or id in next to each instance name: >> com.flexcapacitor.managers.LinkManager (@455ff629) >> >> How do I get that string (@455ff629)? >> >> >> What would you do with the magic number? >> >> >> >> dorkie dork from dorktown >> >> > > -- Cheers, Nate http://blog.natebeck.net
Re: [flexcoders]Need help creating a Singleton with MXML
Yay! That's the class I needed! :) To answer your question why. First I like to use MXML. Any tool can parse XML. Plus, with this class, I plan to drop it into all my future project and set properties on it. If I had more than one instance it would screw up the application. Other classes use some of its functionality so I am providing a getInstance(). The problem has been that the other classes may be declared before the MXML instance. So I updated my code to always call the getInstance() method and both problems have been solved!!! On Sat, Jan 10, 2009 at 12:38 AM, Haykel BEN JEMIA wrote: > You should probably implement the IMXMLObject interface. Override the > initialized method where you can set the class instance (to 'this'). > > The getInstance() method can create a default class instance if it's null > and return it. > > Don't save references to the class instance in the classes that need to use > it. Instead always call getInstance(). This way, until the MXML singleton is > initialized, a 'default' singleton will be used. Afterwards, the MXML > instance will be used. > > This said, why do you need the singleton to be MXML? > > Haykel Ben Jemia > > Allmas > Web & RIA Development > http://www.allmas-tn.com > > > > > > On Sat, Jan 10, 2009 at 5:47 AM, dorkie dork from dorktown < > dorkiedorkfromdorkt...@gmail.com> wrote: > >> I'm stumped. I'm trying to create a singleton class that is also an >> MXML class. >> >> creates one instance obviously. But another >> class needs to reference this class. So class 2 calls >> SingletonClass.getInstance(). It's possible that class 2 will be created >> before the MXML SingletonClass instance. >> >> It's ok for me if there is a ghost instance as long as everything works >> like it should. As long as the instance that is in the main MXML file is the >> one thats in effect. >> >> Also, when debugging this, the id is always an empty string. I'm extending >> EventDispatcher. >> >> dorkie dork from singleton-town place >> > > >
Re: [flexcoders]How do I get the key of an Object?
Graduate from hogwarts. I was thinking of comparing it to another object to see if I had a match. I suppose I could evaluate if (this=objectiamlookingfor). The problem is the object is on the application and the object extends EventDispatcher. If it extended DisplayObject I could enumerate all the instances on the application and do the comparison. Since it extends the EventDispatcher it isn't in the enumeration list of the application. On Sat, Jan 10, 2009 at 2:39 AM, Paul Andrews wrote: > > > - Original Message - > *From:* dorkie dork from dorktown > *To:* flexcoders@yahoogroups.com > *Sent:* Saturday, January 10, 2009 5:54 AM > *Subject:* [flexcoders]How do I get the key of an Object? > > Whilst I'm debugging I see this key or id in next to each instance name: > com.flexcapacitor.managers.LinkManager (@455ff629) > > How do I get that string (@455ff629)? > > > What would you do with the magic number? > > > > dorkie dork from dorktown > > >
[flexcoders] Re: Flash Remoting Options
--- In flexcoders@yahoogroups.com, Alan Klement wrote: > > What version PHP does your shared hosting have? > > I can't run AMFPHP on my shared hosting 'cause they use PHP version > 5.2.2. adn AMFPHP default needs 5.2.3. 4.something. Any options for earlier php versions? Thanks; Amy
Re: [flexcoders]How do I know if a class is on the Application?
It's a manager class that extends EventDispatcher. On Sat, Jan 10, 2009 at 12:17 AM, Haykel BEN JEMIA wrote: > What do you mean with "on the application"? > If you mean added to the stage, then you can't find this out in the > constructor. Make sure your class is a subclass of DisplayObject and listen > to the "added" or "addedToStage" events. > > > Haykel Ben Jemia > > Allmas > Web & RIA Development > http://www.allmas-tn.com > > > > > > On Sat, Jan 10, 2009 at 7:06 AM, dorkie dork from dorktown < > dorkiedorkfromdorkt...@gmail.com> wrote: > >> I have a class on the application like this: >> >> >> >> How do I find out inside that class in the constructor if that class is on >> the Application? >> >> dorkie dork from dorktown™ >> > > >
[flexcoders] Re: Make Enter work as Tab in Flex DataGrid
Any ideas, please? --- In flexcoders@yahoogroups.com, "Sergey Snovsky" wrote: > > Hello! > > I'm trying to make Enter work the same as Tab in a DataGrid - commit > changes to the edited cell and move focus to the next one to the > right, then next row, etc. > > I've tried to use something like: > > focusManager.getNextFocusManagerComponent(true).setFocus(); > > or > > focusManager.moveFocus(FocusRequestDirection.FORWARD); > > but I cannot seem to make it work in a DataGrid... > > Any help would be much appreciated! > > Thank you! > > Sergey >
[flexcoders] Re: Datagrid columns autosize
--- In flexcoders@yahoogroups.com, "Doug McCune" wrote: > > But doing some pretty simple calculations based on data type is easy. For > example, if you know a field is a date and you want to display the full date > and time string, you know how wide that needs to be. Or if a field is a > phone number, etc. Unknown strings present problems, but maybe just some > simple stuff would be better than nothing at all? You could also run a separate request to get the longest value for each field in the recordset.
Re: [flexcoders] DataGrid selectAll problem
I started with the example from your blog dated Feb 2008 (CheckBoxListAndDataGrid). To deselect the other rows, the checkbox column header renderer calls a 'selectAll()' method on the CheckBoxDataGrid with a flag of false. That method builds two arrays - one for all items in the collection and one for all indices in the collection. It then replaces mx:DataGrid.selectedItems and selectedIndices with new arrays. In the deselect case, the new arrays are empty. In the select all case then have all items/indices. Visually, selectAll true/false seems to work when it's called. But in the use-case I describe below I'm counting on the mx:DataGrid.selectItem() to be called in order to deselect rows in the case that a single row is selected. Based on trace statements, I know that mx:DataGrid.selectItem() is never called when the problem occurs Is there something about the way I'm selecting things which causes the selectItem() to not be called? I tried replacing just selectedItemds or just selectedIndicies or both. it doesn't seem. Thanks, Glenn On Fri, Jan 9, 2009 at 1:11 AM, Alex Harui wrote: >Which example did you start with? Which event do you use to deselect > the other rows, and what does that code look like? > > > > *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On > Behalf Of *Glenn Jones > *Sent:* Thursday, January 08, 2009 9:49 PM > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] DataGrid selectAll problem > > > > Hi, > > I'm using Flex 3.2 and I have a DataGrid which implements a column of > checkboxes to select rows. I started with Alex' example. > Then I added a header renderer on the checkbox column such that if check > the header, then all rows are selected. > To implement the select all behavior, I'm creating an array of indices for > [0..n] and assigning that array to mx:DataGrid.selectedIndices. > > For the most part this works fine. > > But if the DataGrid is editable, then I sometimes have a problem. The > problem is that if all rows are selected, and you click on > an editable cell, sometimes the cell becomes editable without deselecting > all of the other rows. The behavior I want is that > if you start editing a cell, then just that row becomes selected. This > happens some of time, but not all of the time. > > If the grid is non-editable, then I can't reproduce the problem. > > I overrode mx:DataGrid.selectItem() in order to clear the checkbox in the > header renderer any time a single item is selected. I've > noticed that when the problem behavior occurs, the mx:DataGrid.selectItem() > method is never called. > > It's almost like there's some race condition between selecting an item and > starting a cell edit. > > Any ideas on how I could work around this? > > Thanks, > Glenn > > >
Re: [flexcoders] Flash Remoting Options
What version PHP does your shared hosting have? I can't run AMFPHP on my shared hosting 'cause they use PHP version 5.2.2. adn AMFPHP default needs 5.2.3. Alan On Jan 10, 2009, at 2:43 PM, Amy wrote: but when I uploaded it to my web host, the Service Browser for AMFPHP wouldn't work.
[flexcoders] Re: Generating random colors, excluding others
--- In flexcoders@yahoogroups.com, "gr33neye501" wrote: > > Hi guys > > I'm trying to generate a series of random colours, but would like to > exclude certain colour and closely related shade. > > For example, i'd like create any colours except red or similar shades. > Anyone know of how I could do this. It's a really subjective thing I > know. > > Help really appreciated > ;-) > Hi, I had to do something similar recently. I used HSB color values to generate distinct colors, and then converted them to RGB. I saw you message this morning, and whipped up an example of my ColorManager class using Degrafa: http://blog.sunild.com/2009/01/generating-many-different-colors-with.html To exclude colors, you can modify the code that generates colors to omit the hues you don't want. HTH, Sunil PS: sorry if this is a repost (Yahoo's beta Rich-Text Editor broke on me)
[flexcoders] Re: Generating random colors, excluding others
--- In flexcoders@yahoogroups.com, "gr33neye501" wrote: > > Hi guys > > I'm trying to generate a series of random colours, but would like to > exclude certain colour and closely related shade. > > For example, i'd like create any colours except red or similar shades. > Anyone know of how I could do this. It's a really subjective thing I > know. > > Help really appreciated > ;-) >
[flexcoders] Flash Remoting Options
Hi, all; I built a great little example file using AMFPHP. It works great on my local installation of WampServer, but when I uploaded it to my web host, the Service Browser for AMFPHP wouldn't work. I contacted my host, and they said that was because my hosting is Windows (which I did on purpose so I could play with ASP). They use ASAPI or CGI to handle the PHP part. I don't want to change to a Linux account just over this one example file. Are there remoting options that can work on my existing hosting plan? Thanks; Amy
Re: [flexcoders] recompiling framework shared library?
oh, ha, I thought that was the original poster asking that. My bad. On Sat, Jan 10, 2009 at 10:49 AM, Doug McCune wrote: > yup, that would work just fine > > > On Sat, Jan 10, 2009 at 10:00 AM, Sam Lai wrote: > >> Could you subclass that class and make the changes there? That way you >> don't need to change the Flex class, and hence the RSL. >> >> 2009/1/10 luvfotography >> >> >: >> >> > Hi, I've made a change to mx.controls.videoClasses.VideoPlayer.as and >> > placed it in my 'src' folder under the folders 'mx', then 'controls', >> > then 'videoClasses' and it picks up the change no problem. >> > >> > If I then change my project to use 'runtime shared library' it's not >> > picking up my changes. >> > >> > What do I need to do? >> > do i need to recompile the framework_3.0.0.477.swz somehow? >> > 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 >> > >> > >> > >> > >> >> > >
Re: [flexcoders] recompiling framework shared library?
yup, that would work just fine On Sat, Jan 10, 2009 at 10:00 AM, Sam Lai wrote: > Could you subclass that class and make the changes there? That way you > don't need to change the Flex class, and hence the RSL. > > 2009/1/10 luvfotography > > >: > > > Hi, I've made a change to mx.controls.videoClasses.VideoPlayer.as and > > placed it in my 'src' folder under the folders 'mx', then 'controls', > > then 'videoClasses' and it picks up the change no problem. > > > > If I then change my project to use 'runtime shared library' it's not > > picking up my changes. > > > > What do I need to do? > > do i need to recompile the framework_3.0.0.477.swz somehow? > > 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 > > > > > > > > > >
RE: [flexcoders] Get html source code of mx.controls.HTML control (AIR)
yourHtmlComponentInstance.htmlLoader.window.document.documentElement.outerHtml (probably!) -Original Message- From: flexcoders@yahoogroups.com on behalf of thedauntless_ff Sent: Sat 10/01/2009 15:42 To: flexcoders@yahoogroups.com Subject: [flexcoders] Get html source code of mx.controls.HTML control (AIR) Hi, Situation: I've loaded a webpage into the control and it displays just fine. What I want now, is the sourcecode of the loaded document, without loading the document again. Is this possible ? I found this tutorial: http://labs.adobe.com/wiki/index.php/Apollo:Articles:Using_HTML_in_Flex-based_Apollo_Applications And it's talking about a JavaScriptObject class located in flash.html. I am however unable to find this class... The examples in this tutorial would be perfect, if only I would have suck a JavaScriptObject class... Any suggestions ? Greetings, Jeroen Beckers __ This communication is from Primal Pictures Ltd., a company registered in England and Wales with registration No. 02622298 and registered office: 4th Floor, Tennyson House, 159-165 Great Portland Street, London, W1W 5PA, UK. VAT registration No. 648874577. This e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail or by telephoning +44(0)20 7637 1010. Please then delete the e-mail and do not disclose its contents to any person. This email has been scanned for Primal Pictures by the MessageLabs Email Security System. __<>
Re: [flexcoders] recompiling framework shared library?
Could you subclass that class and make the changes there? That way you don't need to change the Flex class, and hence the RSL. 2009/1/10 luvfotography : > Hi, I've made a change to mx.controls.videoClasses.VideoPlayer.as and > placed it in my 'src' folder under the folders 'mx', then 'controls', > then 'videoClasses' and it picks up the change no problem. > > If I then change my project to use 'runtime shared library' it's not > picking up my changes. > > What do I need to do? > do i need to recompile the framework_3.0.0.477.swz somehow? > 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 > > > >
Re: [flexcoders] Custom Tree Item Renderer
Tracy you are genius! :) Are there cases like this where you just need to do this or is it bad practice? Thank You Dan Vega danv...@gmail.com http://www.danvega.org
Re: [flexcoders] Custom Tree Item Renderer
Thats exactly what I am looking for, a way to access public variables from within the custom item renederer. Thank You Dan Vega danv...@gmail.com http://www.danvega.org On Fri, Jan 9, 2009 at 5:27 PM, Tracy Spratt wrote: >I am not exactly sure what you are trying to do. Are you trying to > test the data Item to see if it is the root node of the tree? > > > > What is the dataProvider? If it is xml, you could test for parent() == > null. > > > > If it is nested collections then your connections would need to exponse a > parent poperty. > > > > Of course, within an itemRender instance, as with any instance you can > access public members through the dom properties, like parentDocument, and > Application.application > > > > Tracy Spratt > Lariat Services > > Flex development bandwidth available > -- > > *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On > Behalf Of *Dan Vega > *Sent:* Friday, January 09, 2009 3:50 PM > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] Custom Tree Item Renderer > > > > I have a custom tree item renderer that is working out great except one > little small problem. In my item renderer I have some actions for adding / > removing / renaming directories. The only time I don't want the remove or > rename context menu items is when its the home directory. I know that I can > hack it and hard code it here because the data object is passed to each > function. > > What I am trying to do though is going back to the main part of the > applicaiton (or pass in) the baseDirectory so I can account for change. Has > anyone got data in/or out of a renderer before? If it was just another class > it would be easy to put in the constructor but there is no constructor when > you add it to the tree. > > itemRenderer="com.rocketfm.CustomTreeItemRenderer" > > package com.rocketfm { > > import flash.display.DisplayObject; > import flash.events.ContextMenuEvent; > import flash.ui.ContextMenu; > import flash.ui.ContextMenuItem; > > import mx.collections.*; > import mx.controls.treeClasses.*; > import mx.core.Application; > import mx.managers.PopUpManager; > > import views.AddDirectory; > import views.DeleteDirectory; > import views.RenameDirectory; > > public class CustomTreeItemRenderer extends TreeItemRenderer { > > private var renameWin:RenameDirectory; > private var addWin:AddDirectory; > private var delWin:DeleteDirectory; > > public function CustomTreeItemRenderer(basePath) { > super(); > > var menu:ContextMenu = new ContextMenu(); > var add:ContextMenuItem = new ContextMenuItem("Add Folder"); > var remove:ContextMenuItem = new ContextMenuItem("Remove > Folder"); > var rename:ContextMenuItem = new ContextMenuItem("Rename > Folder"); > var download:ContextMenuItem = new ContextMenuItem("Download > All"); > > > add.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,addDirectory); > > remove.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,removeDirectory); > > rename.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,renameDirectory); > > > menu.hideBuiltInItems(); > menu.customItems.push(add); > menu.customItems.push(remove); > menu.customItems.push(rename); > > this.contextMenu = menu; > } > > private function addDirectory(event:ContextMenuEvent):void { > addWin = new AddDirectory(); > addWin.dirPath = data.path; > addWin.parentPath = data.parent; > addWin.item = data; > // add window > > PopUpManager.addPopUp(addWin,DisplayObject(Application.application),true); > } > > private function removeDirectory(event:ContextMenuEvent):void { > delWin = new DeleteDirectory(); > delWin.item = data; > // delete window > > PopUpManager.addPopUp(delWin,DisplayObject(Application.application),true); > } > > private function renameDirectory(event:ContextMenuEvent):void { > renameWin = new RenameDirectory(); > renameWin.item = data; > renameWin.oldDirectoryName = data.name; > renameWin.parentPath = data.parent; > // rename window > > PopUpManager.addPopUp(renameWin,DisplayObject(Application.application),true); > } > } > } > > > Thank You > Dan Vega > danv...@gmail.com > http://www.danvega.org > > >
[flexcoders] Get html source code of mx.controls.HTML control (AIR)
Hi, Situation: I've loaded a webpage into the control and it displays just fine. What I want now, is the sourcecode of the loaded document, without loading the document again. Is this possible ? I found this tutorial: http://labs.adobe.com/wiki/index.php/Apollo:Articles:Using_HTML_in_Flex-based_Apollo_Applications And it's talking about a JavaScriptObject class located in flash.html. I am however unable to find this class... The examples in this tutorial would be perfect, if only I would have suck a JavaScriptObject class... Any suggestions ? Greetings, Jeroen Beckers
[flexcoders] Error: Access of undefined property
Hello, It just kinda weird that i encounter and here is the cscenario: I create a StringUtils.as; package com.buspinoy.utils { public class StringUtils { public static function isEmpty(str:String):Boolean { return str == null || str.length == 0; } public static function isNotEmpty(str:String):Boolean { return !StringUtils.isEmpty(str); } public function StringUtils() { } } } ...this is based on org.apache.commons.lang, but when i put in a code like this: if (StringUtils.isEmpty(selectedText) ) { comboCursor.findFirst(selectedText); this.selectedItem = comboCursor.current; } ...it gives me error Access of undefined property...any idea what is happening?because i have static function working properly but not inside the "if" condition. btw, quick question, does AS will support method overloading in the future? Thanks a lot. Cheers. -- View this message in context: http://www.nabble.com/Error%3A-Access-of-undefined-property-tp21388507p21388507.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Timer Solution
i am working with video. I know the framerate of a video.My problem is, if the framerate is 15 the value have to be shown every second. That is for every second value 1 to 15 has to be displayed. How to do this. Please help me Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/
Re: [flexcoders] Cairngorm and ChangeWatcher
http://weblogs.macromedia.com/auhlmann/archives/2007/02/creating_a_popu.html#more This should give you some directions... Claudiu From: lampei To: flexcoders@yahoogroups.com Sent: Saturday, January 10, 2009 1:34:25 AM Subject: [flexcoders] Cairngorm and ChangeWatcher I have begun tinkering around with various frameworks and thought I would start with Cairngorm. I am refactoring a small application to use Cairngorm, but ran into a snag. All of the examples I found just bound an item in the view to a property of the ModelLocator, and thus automagically updated the value when the property of the ModelLocator changed. However, I had one item that is waiting for a response from a service, and needed to respond to that change (such as an error message), rather than just display the updated data that is returned. I found an example that uses the ChangeWatcher class to watch the property on the ModelLocator. This seemed to work fine, but I was wondering if this is still best practice, as the example I found was from 2006. Thanks.
Re: [flexcoders]How do I get the key of an Object?
- Original Message - From: dorkie dork from dorktown To: flexcoders@yahoogroups.com Sent: Saturday, January 10, 2009 5:54 AM Subject: [flexcoders]How do I get the key of an Object? Whilst I'm debugging I see this key or id in next to each instance name: com.flexcapacitor.managers.LinkManager (@455ff629) How do I get that string (@455ff629)? What would you do with the magic number? dorkie dork from dorktown