RE: [flexcoders] Using a const to specify Embed source
Oh, I see - thanks for clearing that up. In my example, you're right, I wouldnt still need the path. But I was hoping to capture asset folder paths as consts and use that as a prefix for the source of the many embedded icons. Alex Harui wrote: Metadata (stuff inside []) is not part of actionscript so variables and consts can't be used. Once embedded, why do you still need the path? -- View this message in context: http://www.nabble.com/Using-a-const-to-specify-Embed-source-tp17159215p17160533.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Using a const to specify Embed source
I'd like to be able to specify the source of an Embed statement using a const rather than a string literal. At the moment I have to do: public static const MY_ICON_PATH:String = ../assets/my_icon.png; [Embed(source=../assets/my_icon.png)] private var MY_ICON_CLASS:Class; which is clearly not nice because I have to define the same path twice. However, I would like to do this (but this gives a compile-time error): public static const MY_ICON_PATH:String = ../assets/my_icon.png; [Embed(source=MY_ICON_PATH)] private var MY_ICON_CLASS:Class; Any ideas? -- View this message in context: http://www.nabble.com/Using-a-const-to-specify-Embed-source-tp17159215p17159215.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names
I tried that but with no success. If I do: topElement.descendants().(hasOwnProperty(@id)); Then I get a long XMLList. But if I do: topElement.descendants().(hasOwnProperty(localName)); Then I get an empty XMLList. I looked at the ECMA spec and they talk about accessing any property using the [[propertyName]] convention. But I couldnt get that to work in this expression... Have you tried topElement.descendants().(localName ==X || localName == Y) ? Not able to check the exact syntax on that just now (is localName an attribute???) , but I think that's worked for me before. There was a post yesterday that seemed to be concerned with a similar sort of thing, you may want to check that as well. -- View this message in context: http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16767574.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Filtering descendant XML nodes based on multiple tag names
Thanks very much - works perfectly. Tracy Spratt wrote: Almost all properties ain e4x are implemented as methods. So you want localName(). Try: topElement.descendants.(localName() ==X || localName() == Y) ; Tracy -- View this message in context: http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16782698.html Sent from the FlexCoders mailing list archive at Nabble.com.
[flexcoders] Filtering descendant XML nodes based on multiple tag names
I would like to get all descendants having a tag name of either X or Y. Can this be done in one nice expression? I want something like this: topElement..(X|Y) or topElement..(localName == X || localName == Y) But neither of those seem to work. At the moment I have to do topElement..* and then filter programatically. -- View this message in context: http://www.nabble.com/Filtering-descendant-XML-nodes-based-on-multiple-tag-names-tp16760756p16760756.html Sent from the FlexCoders mailing list archive at Nabble.com.
RE: [flexcoders] Synchronised TextArea selection
So, I've got it working by listening to both MOUSE_LEAVE and MOUSE_UP. If the mouse up occurs off the stage, then you get a MOUSE_LEAVE event. If the mouse up occurs on the stage, then you get a MOUSE_UP event. So, if you leave the stage and then come back on the stage to do the mouse up, then you get a MOUSE_UP event instead of a MOUSE_LEAVE event So this is fine and works, however, I can't help but feel that listening to the selection parameters is the proper way to do it. Am I wrong in using the BindingUtils.bindSetter method on properties like selectionBeginIndex etc? Any ideas why this doesnt work? Alex Harui wrote: MOUSE_LEAVE is when the mouse is up after being dragged off the stage -- View this message in context: http://www.nabble.com/Synchronised-TextArea-selection-tp7645900p16627536.html Sent from the FlexCoders mailing list archive at Nabble.com.