Re: [flexcoders] AutoComplete with multiple items

2009-04-01 Thread Mark Carter
I too, would like this? Does anyone know of such a component? -- View this message in context: http://www.nabble.com/AutoComplete-with-multiple-items-tp16840144p22840425.html Sent from the FlexCoders mailing list archive at Nabble.com.

[flexcoders] How can an SWF read its own metadata tags?

2009-01-31 Thread Mark Carter
How to read SWF metadata tags (like title, publisher etc) at runtime from within that SWF? I use ANT to build the SWF. I manually define metadata like project name etc in a build.properties file. I use these values in ANT to name the SWF and installer etc and also I can use them to set the

Re: [flexcoders] Flex Builder debugger problems

2009-01-23 Thread Mark Carter
I also experience this though it only happens about 5% of the time for me. I'm debugging my Flex app running in the standalone Flash Player 10. * Usually, my flex app takes a couple of seconds to launch once the workspace has finished building. * About 20% of the time, the flash player window

Re: [flexcoders] Stop the flicker between menu items

2008-12-17 Thread Mark Carter
danielrkrueger wrote: When I place the mouse in just the right spot between 2 menu items I can get a flicker. Does anyone know how to stop this? I also experience this. But its not just between two menu items. It happens whenever you hover the mouse over any part of the border of a

Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter
So are you saying that, in general, anonymous functions should not be used as listeners? If its anything like in Java, (once the calling method returned) the anonymous function would only be referenced by the event dispatcher and so (assuming weak references are not used) would only be garbage

RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter
For me, the question is: If I use someObj in the same way as my example above (i.e. assigning it to a local variable), when will someObj get garbage collected? Is it (potentially) when the result/fault event is dispatched or could it be earlier? Alex Harui wrote: I think Amy's point is

RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter
Alex Harui wrote: Can you repost your example? Its just the very few simple lines I posted a few posts ago in this topic. Here is the link: http://www.nabble.com/Re%3A-Best-practice-for-calling-asynchronous-functions--p20969533.html Its not a full example, but it gives the idea... --

Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-11 Thread Mark Carter
Amy-28 wrote: Right. The calling code doesn't need to do anything different. The change is inside your method. Here's an example: Thanks for that - its roughly what I had in mind - but its good for me to see an example. Amy-28 wrote: In my opinion this is neater than something

Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-11 Thread Mark Carter
Josh McDonald-4 wrote: The problem is that from the SDK's point of view, there is no request. There's no IMessage, there's nothing to wait on. However from the application's point of view, there is. I don't quite understand... Wouldn't any problems before the async token is returned, be

[flexcoders] Best practice for calling asynchronous functions?

2008-12-10 Thread Mark Carter
In my app, I make a wide variety of XML-RPC calls. Now, to avoid having to add/remove listeners all over the place, I've created a class (facade?) with functions like: function save(xml:XML, successFunc:Function, failureFunc:Function):void; function load(id:String, successFunc:Function,

Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-10 Thread Mark Carter
Thanks for all the responses. I hadn't really looked into the ASyncToken until now. However, for me it seems that using the ASyncToken would be limited to the implementation of the, for example, save(XML, Function, Function) method. The calling code doesn't need to know about it. In my opinion

[flexcoders] Custom DataDescriptor calling remote service

2008-12-01 Thread Mark Carter
I'm writing a data descriptor for a tree representing some remote filesystem hierarchy. I want the data descriptor to call a remote service every time the user opens an item. However, the data descriptor assumes synchronous retrieval of children etc. At the moment, I have to read in the entire

[flexcoders] Overriding setter function, not overriding

2008-11-28 Thread Mark Carter
I have once class Node and another SuperNode that extends Node. Node defines this setter: [Bindable] public function set modified(value:Boolean):void { _modified = value; } SuperNode overrides it: [Bindable] public override function set modified(value:Boolean):void { _modified

Re: [flexcoders] Overriding setter function, not overriding

2008-11-28 Thread Mark Carter
Problem solved by removing the Bindable tag from the overriding method. Shouldnt the compiler spot this? Mark Carter wrote: I have once class Node and another SuperNode that extends Node. Node defines this setter: [Bindable] public function set modified(value:Boolean):void

Re: [flexcoders] Best practice for databinding with MenuBar?

2008-11-23 Thread Mark Carter
Amy-28 wrote: --- In flexcoders@yahoogroups.com, Mark Carter [EMAIL PROTECTED] wrote: Doesn't that only work if you have a set isAllowed() as well? No. There is intentionally no setter function for isAllowed for the reason you outline below: Ah, yes, sorry, my mistake. I didn't read

RE: [flexcoders] Best practice for databinding with MenuBar?

2008-11-22 Thread Mark Carter
] = this[allowFuncName](); } } Any thoughts on whether this is a good approach or not? Mark Carter wrote: How can I call the allowX() function where X is a string stored in a var? -- View this message in context: http://www.nabble.com/Best-practice-for-databinding-with-MenuBar--tp20622610p20634401

Re: [flexcoders] Store local data

2008-11-22 Thread Mark Carter
Does this help? http://jessewarden.com/2008/11/writing-a-caching-engine-for-flash-player.html Marco Catunda wrote: The kind of data is a dataprovider with a lot of records (500 - 2000). The shared objects don't store many datas. :( Let me explain my problem. I have a screen which

[flexcoders] Best practice for databinding with MenuBar?

2008-11-21 Thread Mark Carter
I have a MenuBar where the dataProvider is specified in MXML as an XMLList. For the enabled attributes I do something like: enabled={allowThis()} However, to get databinding working I end up passing in the relevant bindable property and then ignore it within the implementation of allowMe().

Re: [flexcoders] Best practice for databinding with MenuBar?

2008-11-21 Thread Mark Carter
Thanks for that Amy. Doesn't that only work if you have a set isAllowed() as well? Unfortunately, in my scenario, isAllowed() is not set in this kind of way - its more of a calculation based on various vars elsewhere (some non-bindable). Amy-28 wrote: how bout [Bindable

RE: [flexcoders] Best practice for databinding with MenuBar?

2008-11-21 Thread Mark Carter
PROTECTED] On Behalf Of Mark Carter Sent: Friday, November 21, 2008 9:51 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Best practice for databinding with MenuBar? I have a MenuBar where the dataProvider is specified in MXML as an XMLList. For the enabled attributes I do

[flexcoders] Tree updateList() not updating top level

2008-11-20 Thread Mark Carter
I have a component extending Tree and I use a custom ITreeDataDescriptor since I want to filter the visible nodes. I also use showRoot=false. When changes are made to the underlying data model (dataProvider) I call updateList(). This works fine for all but the top level items. If I add/remove a

Re: [flexcoders] Tree updateList() not updating top level

2008-11-20 Thread Mark Carter
Tree.updateList(), what if you just want to redraw one item in the tree. I looked on the itemRenderer class but couldnt find anything that worked for me. Mark Carter wrote: I have a component extending Tree and I use a custom ITreeDataDescriptor since I want to filter the visible nodes. I also

RE: Re: [flexcoders] Listeners and weak references

2008-11-05 Thread Mark Carter
Is it true to say that when passing an anonymous function to the addEventListener function, you should never use weak references??? If you do, then wouldnt the listener (anonymous function) get garbage collected as soon as the calling method returns Nikolay Iliev wrote: Thanks for this

[flexcoders] MenuBar menuitem data binding bug?

2008-11-05 Thread Mark Carter
mx:MenuBar id=myMenuBar mx:XMLList !--DOES NOT WORK!!! menuitem label=Action enabled={bindableProp != null}/-- menuitem label=Action enabled={myMenuBar != null amp;amp; bindableProp != null}/ /mx:XMLList /mx:MenuBar This allows me to disable the

Re: [flexcoders] MenuBar menuitem data binding bug?

2008-11-05 Thread Mark Carter
Correction - bindableProp is not a Boolean -- View this message in context: http://www.nabble.com/MenuBar-menuitem-data-binding-bug--tp20343455p20343457.html Sent from the FlexCoders mailing list archive at Nabble.com.

Re: [flexcoders] MenuBar menuitem data binding bug?

2008-11-05 Thread Mark Carter
Hi - I tried that but, no, that doesn't work either: mx:MenuBar id=myMenuBar mx:XMLList !--DOES NOT WORK!!! menuitem label=Action enabled={bindableProp != null}/-- !--DOES NOT WORK!!! menuitem label=Action enabled={bindableProp != null ? true : false}/-- !--DOES NOT

Re: [flexcoders] Dynamicaly loading of images

2008-10-30 Thread Mark Carter
Ben Stucki came up with a neat solution to this: http://blog.benstucki.net/?p=42 I took his idea a bit further: http://blog.flex.mark.carter.name/2008/05/displaying-icons-loaded-at-runtime-in.html Let me know if this helps - I've received no feedback on my icon stuff at all so far! -- View

Re: [flexcoders] Equivalent to Java's Class.isInstance(Object) instance method?

2008-10-27 Thread Mark Carter
Oops, sorry. Thanks, you're right! FlexBuilder code completion wasn't giving me the chance to put a variable after is - so I just assumed it wasn't possible (like in Java). andrii_olefirenko wrote: obj is cls - it works for me, no compile error (Flex SDK 3). -- View this message in

Re: Re: [flexcoders] Equivalent to Java's Class.isInstance(Object) instance method?

2008-10-27 Thread Mark Carter
Hi Mike - sorry, you've lost me there... The few tests I've done show that obj is cls is what I need. Are you saying that does not work? Michael Schmalle wrote: Adding to the insight, if you wanted to use the 'is' operator with those two arguments, you need to create an instance of the

[flexcoders] Equivalent to Java's Class.isInstance(Object) instance method?

2008-10-26 Thread Mark Carter
I've got an array of objects which I want to filter according to the object's class. The class itself is referenced by a variable so I cannot use the is operator. I'd like to be able to do something like: filterClass.isInstance(obj) Do I need to use isPrototypeOf()? - I don't really understand

Re: [flexcoders] Equivalent to Java's Class.isInstance(Object) instance method?

2008-10-26 Thread Mark Carter
Sprite(); trace(displayObject is DisplayObject); trace(displayObject is Sprite); trace(displayObject is UIComponent); Best regards --- In flexcoders@yahoogroups.com, Mark Carter [EMAIL PROTECTED] wrote: I've got an array of objects which I want to filter according to the object's class

Re: [flexcoders] Setting text on a text node in e4x

2008-10-25 Thread Mark Carter
Thanks for that keith, but that simply replaces the child nodes of the first page element with a new text node element. I want to reuse the old text node child of the first page element. khair wrote: var doc= book toc/ toc/ pageAbc/page page123/page pageXYZ/page

Re: [flexcoders] Setting text on a text node in e4x

2008-10-25 Thread Mark Carter
to a question I asked a while ago: http://tech.groups.yahoo.com/group/flexcoders/message/114156 - Daniel Freiman On Fri, Oct 24, 2008 at 1:06 PM, Mark Carter [EMAIL PROTECTED] wrote: Unfortunately not. I tried this: public static function setTextNodeText(textNode:XML, newText:String):void

Re: [flexcoders] Setting text on a text node in e4x

2008-10-25 Thread Mark Carter
Thanks - I do want to alter the original document, but keep the original text node. I.e. just change the text node's content. But its ok - I'm going to go with a different approach instead because it seems like a bad idea to hang on to references of text nodes... khair wrote: If you don't

[flexcoders] Setting text on a text node in e4x

2008-10-24 Thread Mark Carter
Hi - So, I know how to append a text node to an (parent) element, and how to replace a text node with a new text node (based on a specified string), but how do I set text on a text node? In my situation it is very important that the reference to the text node object is the same before and after

Re: [flexcoders] Setting text on a text node in e4x

2008-10-24 Thread Mark Carter
clear it has been replaced by a new text node... Daniel Freiman wrote: does this do it? parentElement.text()[index] = newText; - Daniel Freiman On Fri, Oct 24, 2008 at 11:48 AM, Mark Carter [EMAIL PROTECTED] wrote: Hi - So, I know how to append a text node to an (parent) element

RE: [flexcoders] Setting text on a text node in e4x

2008-10-24 Thread Mark Carter
I should have mentioned that my elements have mixed content. Basically I have HTML (dynamically generated from some XML) in a TextArea. If some part of the text area is selected then I keep a reference to the corresponding text nodes (or subsets of text nodes), so that after the XML text has

Re: [flexcoders] drag drop invokes click handler of dragged compoent

2008-10-22 Thread Mark Carter
The DragManager has a useful method to save you the trouble: isDragging(), I think. I needed to do something like this just yesterday... I have a list or words in one list and then the synonyms for the selected word in another. I want to be able to drag a word from the first list to the second

[flexcoders] How to display message in empty Tree component

2008-10-17 Thread Mark Carter
I'm using a Tree component with a dataProvider set using an XML object. Also showRoot=false. If I set using a childless XML object then one item is shown in the tree. That's a bit weird but it sort of allows me a way to display my message (using labelFunc) to No items. But then I have to be

Re: [flexcoders] Auto resizing a list popup control of a PopUpButton

2008-10-14 Thread Mark Carter
) and multiply with 20 (try different values) and so depending on the length, the height of the list will automatically resize. For example : _tier.height = tierData.length * 20; where tierData:ArrayCollection; _tier:List; -Naveen On Sun, Oct 12, 2008 at 3:26 AM, Mark Carter [EMAIL

Re: [flexcoders] Smooth scrolling when setting verticalScrollPosition on TextArea

2008-10-13 Thread Mark Carter
Oh, its fine - not choppy at all. I've even been toying with the idea of doing something more acceleration based instead, but probably won't bother. I scroll to a position where some text is newly selected. I just needed to be careful that I only made the selection after the scrolling finished.

[flexcoders] Auto resizing a list popup control of a PopUpButton

2008-10-12 Thread Mark Carter
I have a PopUpButton with List popup control where I occasionally change the dataprovider at runtime. However, when I change the dataprovider I want the popup control to resize to the number of items in the list. At the moment, I just set the height as a factor of the number of items, but is

[flexcoders] Smooth scrolling when setting verticalScrollPosition on TextArea

2008-10-11 Thread Mark Carter
In AS3, I set the vertical scroll position of the text area, but would like the area to smoothly scroll to that area rather than jump to it (disorientating the user). I've done this using the AnimateProperty class on the verticalScrollPosition property. Is there a more standard way? -- View

Re: [flexcoders] ComboBox edit field selection when populated

2008-10-10 Thread Mark Carter
Have you tried google for an autocomplete component? This should be helpful: http://www.websector.de/blog/2008/04/30/quick-tip-avoid-issues-using-adobes-autocomplete-input-component-using-flex-3/ There are also a few on the Adobe Exchange: http://www.adobe.com/cfusion/exchange/index.cfm --

Re: [flexcoders] modal PopUp with one component, that should accept user interaction

2008-10-10 Thread Mark Carter
What exactly do you want to do? i.e. why do the other components have to be mouse-shielded? I assume you know about PopUpButton - I don't know if you could use that to help you do what you want...? -- View this message in context:

[flexcoders] Expanding/collapsing branch on Tree does not give focus to Tree

2008-10-09 Thread Mark Carter
When expanding/collapsing a Tree branch, I notice that the Tree does not gain focus. Is this what a user would normally expect? -- View this message in context: http://www.nabble.com/Expanding-collapsing-branch-on-Tree-does-not-give-focus-to-Tree-tp19895221p19895221.html Sent from the

Re: [flexcoders] Copy/Paste but removing HTML formatting

2008-10-09 Thread Mark Carter
Ok, I can answer my own question now... On the underlying textfield component of the textarea, set the useRichTextClipboard property to false. Mark Carter wrote: I should have mentioned, this is within the same flex app. Therefore, I suppose I don't need to use the System clipboard

Re: [flexcoders] Trouble shooting internal build errors

2008-10-09 Thread Mark Carter
I sometimes get this when performing a build (not release) but have always solved the problem by restarting FlexBuilder... basicasm wrote: I made a small change in a project and now FlexBuilder will not export a release build. It fails with An internal build error has occured and says I

[flexcoders] Collapse branch in Tree changes selection but does not trigger CHANGE event

2008-10-08 Thread Mark Carter
I think this is a bug, but am not sure. If I have a tree with a child item selected and then I collapse/close the branch containing that selection, the selection is automatically changed to the item I collapsed but no CHANGE event is triggered. Is this a bug? -- View this message in context:

[flexcoders] Copy/Paste but removing HTML formatting

2008-10-04 Thread Mark Carter
I want the user to be able to copy text from an HTML-formatted Text Area and paste into a non-HTML TextArea. However, when they do this, the pasted text appears with the same formatting as in the original (indentation, font size etc). How can this be avoided? -- View this message in context:

Re: [flexcoders] Copy/Paste but removing HTML formatting

2008-10-04 Thread Mark Carter
system behaviour? Mark Carter wrote: I want the user to be able to copy text from an HTML-formatted Text Area and paste into a non-HTML TextArea. However, when they do this, the pasted text appears with the same formatting as in the original (indentation, font size etc). How can

[flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
Ok, that subject is a bit vague but here's an example of what I mean: group id=1 namefred/name namebob/name namepeter/name /group Say we have lots of these group elements in an XML document. I want to select all groups including the names fred and bob, for example. Is it possible in one e4x

Re: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
to build an e4x expression at runtime? Daniel Freiman wrote: try this: rootXML.group.(name.text().contains(fred) name.text().contains(bob)) - Daniel Freiman On Mon, Sep 22, 2008 at 5:20 AM, Mark Carter [EMAIL PROTECTED] wrote: Ok, that subject is a bit vague but here's an example

Re: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
insensitivity... --- In flexcoders@yahoogroups.com, Daniel Freiman [EMAIL PROTECTED] wrote: try this: rootXML.group.(name.text().contains(fred) name.text().contains(bob)) - Daniel Freiman On Mon, Sep 22, 2008 at 5:20 AM, Mark Carter [EMAIL PROTECTED] wrote: Ok, that subject

Re: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
Nice. I see what you've done there (instead of var result:XMLList = rootXML.group.name; as the first line which would have been rather inefficient). I suppose this general approach doesnt work if I want to do things like lowercase or substring matching...? Daniel Freiman wrote: You're

Re: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
:20 AM, Mark Carter [EMAIL PROTECTED] wrote: Ok, that subject is a bit vague but here's an example of what I mean: group id=1 namefred/name namebob/name namepeter/name /group Say we have lots of these group elements in an XML document. I want to select all groups

Re: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
It seems to work it out for you when it can. name.text()[0].toLowerCase() works name.text().toLowerCase() also works if there is exactly one name child of each group element. Daniel Freiman wrote: name.text()[0] will give you a single XML node of Kind string. If you want to operate on it

RE: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
Thanks - thats very useful - hadn't thought of that. Assumed it would not be possible. Whats the best way to get a handle on the item element from within the itemContains function? I would probably go with this approach: xlFilteredItems = _xmlData..group.(nameElementsContainAll(name,filters));

RE: [flexcoders] e4x problem - filtering elements based on multiple child conditions

2008-09-22 Thread Mark Carter
); } } } return matchedFilters.length() == filters.length(); } Mark Carter wrote: Thanks - thats very useful - hadn't thought of that. Assumed it would not be possible. Whats the best way to get a handle on the item element from within the itemContains function? I

Re: [flexcoders] SoundChannel position misreporting

2008-08-13 Thread Mark Carter
There is already a bug about this: http://bugs.adobe.com/jira/browse/FP-33 The last comment says it might be fixed in the latest Flash Player 10 pre-release (beta 2, version 10,0,0,525) from early July... I'll try to check this soon... -- View this message in context:

Re: [flexcoders] SoundChannel position misreporting

2008-07-29 Thread Mark Carter
I also have this problem. If i call the play Sound play() method with the position 1, then play begins at 20secs. In general if I specify a value of X, then play will begin at 2X milliseconds from the beginning. I have tried it with 64kbps and 32kbps mp3, FWIW. What am I doing wrong!? --

Re: [flexcoders] SoundChannel position misreporting

2008-07-29 Thread Mark Carter
The two mp3s I tried are both 22050Hz. (of course, sample rate is far more relevant than bit rate - I must have been half dead when I wrote that earlier!) The playback itself is completely fine - not double speed. Its just the position value... Ok, so I've done so more experimenting: If I

Re: [flexcoders] SoundChannel position misreporting

2008-07-29 Thread Mark Carter
Toby Ashley wrote: Very interested to hear if you find a solution. Sure, will do although I think any workaround will be to check the sample rate in the ID tag and then scale the position accordingly. BTW, the length field is always correct. Therefore, if you use a progress bar (using the

Re: [flexcoders] Displaying icons loaded at runtime, in Buttons, Trees etc

2008-06-24 Thread Mark Carter
Anyone had a chance to look at this? - I think it could be very useful for some people... -- View this message in context: http://www.nabble.com/Displaying-icons-loaded-at-runtime%2C-in-Buttons%2C-Trees-etc-tp17179354p18104998.html Sent from the FlexCoders mailing list archive at Nabble.com.

[flexcoders] Displaying icons loaded at runtime, in Buttons, Trees etc

2008-05-11 Thread Mark Carter
I've developed a class to make it easier to display runtime-loaded icons in Buttons and Trees etc. Features include: * Displaying icons loaded at runtime in components that normally only accept embedded icons * Displaying default embedded images when runtime icons cannot be loaded *

[flexcoders] Displaying icons loaded at runtime, in Buttons, Trees etc

2008-05-11 Thread Mark Carter
I've developed a class to make it easier to display runtime-loaded icons in Buttons and Trees etc. This uses the same technique provided by Ben Stucki: http://blog.benstucki.net/?p=42 but takes his idea a little bit further. Supports: * Displaying icons loaded at runtime in components that

[flexcoders] Displaying icons loaded at runtime, in Buttons, Trees etc

2008-05-11 Thread Mark Carter
I've developed a class to make it easier to display runtime-loaded icons in Buttons and Trees etc. Features include: * Displaying icons loaded at runtime in components that normally only accept embedded icons * Displaying default embedded images when runtime icons cannot be loaded