[flexcoders] Re: Is there a way to detect whether a TextLine is partially cut-off (vertically) in TLF?
I figured it out: var lastFullyVisibleLine:TextFlowLine; for (var i:int = textFlowComposer.numLines - 1; i = 0; i--) { lastFullyVisibleLine = textFlowComposer.lines[i] as TextFlowLine; if (lastFullyVisibleLine.textLineExists lastFullyVisibleLine.y + lastFullyVisibleLine.textHeight = height) { break; } } Baz On Wed, Oct 26, 2011 at 7:56 PM, Baz li...@thinkloop.com wrote: Say you had a container that was 15px tall, and each TextLine was 10px high - the last TextLine would be vertically clipped by 5px, but since it is partially visible, TLF would mark it as visible. Anyone know if there is a smart way to detect when a TextLine is vertically clipped? Thanks, Baz
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
My examples work in Flex 4.5.1, and monkey patching is not straightforward based on my Googling. Looks like no way out without upgrading. Baz On Tue, Oct 25, 2011 at 12:37 PM, Baz li...@thinkloop.com wrote: Hey Alex, I tried changing Framework Linkage to Merged into Code as well as checking/unchecking use local debug runtimes... without much effect. I'm reading your blog and piecing out what might apply to me. It's pretty advanced stuff. The thing is the font is there - if I specify it directly in RichEditableText it shows up. What is the container doing to TextFlow that I am not, and how can I mimic that. I've introspected almost every property and function of TextFlow, FlowComposer, ContainerController, TextFlowLine and TextLine (I've been on this for many days now :). Judging by the output of textFlowLine.getTextLine().textBlock.dump(), TLF is just not aware/registering the font until after the container is rendered. If you are curious to see it work and fail side-by-side in a simplified compilable app, check out: http://dl.dropbox.com/u/480077/FlexTestTLF.zip If you run it, you will notice 4 RichEditableTextContainers. The first two use device fonts (Courier and Arial), and they are interpreted correctly. The trace of the dump() in the console shows this nicely. The third box, in red, is the problem. This box tries to employ an embeded font before the container is rendered, and if you look at the trace, it's not accepting the font and instead using the default Times New Roman. The fourth box is exactly the same as the third box, but solves the problem by applying the truncation at updateComplete, rather than on initialize. The trace shows the font to be correct as well. Do you think all this is related to contexts and multiple swfs as you describe in your blog? Thanks! What do you make of this? Is there a way to mimic what happens to textFlow on updateComplete but inside initialize? On Tue, Oct 25, 2011 at 10:02 AM, Alex Harui aha...@adobe.com wrote: ** See the embedded font post on my blog. The control needs to have the right SWF context. Does it work if you turn off RSLs? On 10/25/11 3:01 AM, Baz li...@thinkloop.com wrote: Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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 http://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script s:RichEditableText id=one width=500 height=204 renderingMode=cff fontLookup=embeddedCFF / /s:Application I know the font works because if I specify *any* embedded font directly in the RichEditableText, the specified embedded fonts shows up. Thanks, Baz -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
Actually what Alex mentioned is correct too - I need to change the linkage to merged into codes well as upgrade to 4.5.1. Baz On Wed, Oct 26, 2011 at 1:40 PM, Baz li...@thinkloop.com wrote: My examples work in Flex 4.5.1, and monkey patching is not straightforward based on my Googling. Looks like no way out without upgrading. Baz On Tue, Oct 25, 2011 at 12:37 PM, Baz li...@thinkloop.com wrote: Hey Alex, I tried changing Framework Linkage to Merged into Code as well as checking/unchecking use local debug runtimes... without much effect. I'm reading your blog and piecing out what might apply to me. It's pretty advanced stuff. The thing is the font is there - if I specify it directly in RichEditableText it shows up. What is the container doing to TextFlow that I am not, and how can I mimic that. I've introspected almost every property and function of TextFlow, FlowComposer, ContainerController, TextFlowLine and TextLine (I've been on this for many days now :). Judging by the output of textFlowLine.getTextLine().textBlock.dump(), TLF is just not aware/registering the font until after the container is rendered. If you are curious to see it work and fail side-by-side in a simplified compilable app, check out: http://dl.dropbox.com/u/480077/FlexTestTLF.zip If you run it, you will notice 4 RichEditableTextContainers. The first two use device fonts (Courier and Arial), and they are interpreted correctly. The trace of the dump() in the console shows this nicely. The third box, in red, is the problem. This box tries to employ an embeded font before the container is rendered, and if you look at the trace, it's not accepting the font and instead using the default Times New Roman. The fourth box is exactly the same as the third box, but solves the problem by applying the truncation at updateComplete, rather than on initialize. The trace shows the font to be correct as well. Do you think all this is related to contexts and multiple swfs as you describe in your blog? Thanks! What do you make of this? Is there a way to mimic what happens to textFlow on updateComplete but inside initialize? On Tue, Oct 25, 2011 at 10:02 AM, Alex Harui aha...@adobe.com wrote: ** See the embedded font post on my blog. The control needs to have the right SWF context. Does it work if you turn off RSLs? On 10/25/11 3:01 AM, Baz li...@thinkloop.com wrote: Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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 http://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script s:RichEditableText id=one width=500 height=204 renderingMode=cff fontLookup=embeddedCFF / /s:Application I know the font works because if I specify *any* embedded font directly in the RichEditableText, the specified embedded fonts shows up. Thanks, Baz -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
We're on 4.1. Cheers, Baz On Wed, Oct 26, 2011 at 2:56 PM, Alex Harui aha...@adobe.com wrote: ** Which version do want it to work in? On 10/26/11 1:44 PM, Baz li...@thinkloop.com wrote: Actually what Alex mentioned is correct too - I need to change the linkage to merged into codes well as upgrade to 4.5.1. Baz On Wed, Oct 26, 2011 at 1:40 PM, Baz li...@thinkloop.com wrote: My examples work in Flex 4.5.1, and monkey patching is not straightforward based on my Googling. Looks like no way out without upgrading. Baz On Tue, Oct 25, 2011 at 12:37 PM, Baz li...@thinkloop.com wrote: Hey Alex, I tried changing Framework Linkage to Merged into Code as well as checking/unchecking use local debug runtimes... without much effect. I'm reading your blog and piecing out what might apply to me. It's pretty advanced stuff. The thing is the font is there - if I specify it directly in RichEditableText it shows up. What is the container doing to TextFlow that I am not, and how can I mimic that. I've introspected almost every property and function of TextFlow, FlowComposer, ContainerController, TextFlowLine and TextLine (I've been on this for many days now :). Judging by the output of textFlowLine.getTextLine().textBlock.dump(), TLF is just not aware/registering the font until after the container is rendered. If you are curious to see it work and fail side-by-side in a simplified compilable app, check out: http://dl.dropbox.com/u/480077/FlexTestTLF.zip If you run it, you will notice 4 RichEditableTextContainers. The first two use device fonts (Courier and Arial), and they are interpreted correctly. The trace of the dump() in the console shows this nicely. The third box, in red, is the problem. This box tries to employ an embeded font before the container is rendered, and if you look at the trace, it's not accepting the font and instead using the default Times New Roman. The fourth box is exactly the same as the third box, but solves the problem by applying the truncation at updateComplete, rather than on initialize. The trace shows the font to be correct as well. Do you think all this is related to contexts and multiple swfs as you describe in your blog? Thanks! What do you make of this? Is there a way to mimic what happens to textFlow on updateComplete but inside initialize? On Tue, Oct 25, 2011 at 10:02 AM, Alex Harui aha...@adobe.com wrote: See the embedded font post on my blog. The control needs to have the right SWF context. Does it work if you turn off RSLs? On 10/25/11 3:01 AM, Baz li...@thinkloop.com http://li...@thinkloop.com wrote: Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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 http://ns.adobe.com/flex/spark http://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script s:RichEditableText id=one width=500 height=204 renderingMode=cff fontLookup=embeddedCFF / /s:Application I know the font works because if I specify *any* embedded font directly in the RichEditableText, the specified embedded fonts shows up. Thanks, Baz -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Is there a way to detect whether a TextLine is partially cut-off (vertically) in TLF?
Say you had a container that was 15px tall, and each TextLine was 10px high - the last TextLine would be vertically clipped by 5px, but since it is partially visible, TLF would mark it as visible. Anyone know if there is a smart way to detect when a TextLine is vertically clipped? Thanks, Baz
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
Hey Alex, I'm using TLF 1.1 Build 604 that I think comes bundled with 4.1 - you? Baz On Wed, Oct 26, 2011 at 9:42 PM, Alex Harui aha...@adobe.com wrote: ** For me, the font looks right although the console reports Times New Roman. Which version of TLF are you using? On 10/26/11 5:41 PM, Baz li...@thinkloop.com wrote: We're on 4.1. Cheers, Baz On Wed, Oct 26, 2011 at 2:56 PM, Alex Harui aha...@adobe.com wrote: Which version do want it to work in? On 10/26/11 1:44 PM, Baz li...@thinkloop.com http://li...@thinkloop.com wrote: Actually what Alex mentioned is correct too - I need to change the linkage to merged into codes well as upgrade to 4.5.1. Baz On Wed, Oct 26, 2011 at 1:40 PM, Baz li...@thinkloop.com http://li...@thinkloop.com wrote: My examples work in Flex 4.5.1, and monkey patching is not straightforward based on my Googling. Looks like no way out without upgrading. Baz On Tue, Oct 25, 2011 at 12:37 PM, Baz li...@thinkloop.com http://li...@thinkloop.com wrote: Hey Alex, I tried changing Framework Linkage to Merged into Code as well as checking/unchecking use local debug runtimes... without much effect. I'm reading your blog and piecing out what might apply to me. It's pretty advanced stuff. The thing is the font is there - if I specify it directly in RichEditableText it shows up. What is the container doing to TextFlow that I am not, and how can I mimic that. I've introspected almost every property and function of TextFlow, FlowComposer, ContainerController, TextFlowLine and TextLine (I've been on this for many days now :). Judging by the output of textFlowLine.getTextLine().textBlock.dump(), TLF is just not aware/registering the font until after the container is rendered. If you are curious to see it work and fail side-by-side in a simplified compilable app, check out: http://dl.dropbox.com/u/480077/FlexTestTLF.zip If you run it, you will notice 4 RichEditableTextContainers. The first two use device fonts (Courier and Arial), and they are interpreted correctly. The trace of the dump() in the console shows this nicely. The third box, in red, is the problem. This box tries to employ an embeded font before the container is rendered, and if you look at the trace, it's not accepting the font and instead using the default Times New Roman. The fourth box is exactly the same as the third box, but solves the problem by applying the truncation at updateComplete, rather than on initialize. The trace shows the font to be correct as well. Do you think all this is related to contexts and multiple swfs as you describe in your blog? Thanks! What do you make of this? Is there a way to mimic what happens to textFlow on updateComplete but inside initialize? On Tue, Oct 25, 2011 at 10:02 AM, Alex Harui aha...@adobe.com http://aha...@adobe.com wrote: See the embedded font post on my blog. The control needs to have the right SWF context. Does it work if you turn off RSLs? On 10/25/11 3:01 AM, Baz li...@thinkloop.com http://li...@thinkloop.com http://li...@thinkloop.com wrote: Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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 http://ns.adobe.com/flex/spark http://ns.adobe.com/flex/spark http://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
Version 10.3.183.10 - u? :) So what exactly worked for you, the initial app I pasted or the one I provided a link for later? Thanks, Baz
[flexcoders] Manual TextFlow + Embedded Font not supported?
Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script s:RichEditableText id=one width=500 height=204 renderingMode=cff fontLookup=embeddedCFF / /s:Application I know the font works because if I specify *any* embedded font directly in the RichEditableText, the specified embedded fonts shows up. Thanks, Baz
Re: [flexcoders] Manual TextFlow + Embedded Font not supported?
Hey Alex, I tried changing Framework Linkage to Merged into Code as well as checking/unchecking use local debug runtimes... without much effect. I'm reading your blog and piecing out what might apply to me. It's pretty advanced stuff. The thing is the font is there - if I specify it directly in RichEditableText it shows up. What is the container doing to TextFlow that I am not, and how can I mimic that. I've introspected almost every property and function of TextFlow, FlowComposer, ContainerController, TextFlowLine and TextLine (I've been on this for many days now :). Judging by the output of textFlowLine.getTextLine().textBlock.dump(), TLF is just not aware/registering the font until after the container is rendered. If you are curious to see it work and fail side-by-side in a simplified compilable app, check out: http://dl.dropbox.com/u/480077/FlexTestTLF.zip If you run it, you will notice 4 RichEditableTextContainers. The first two use device fonts (Courier and Arial), and they are interpreted correctly. The trace of the dump() in the console shows this nicely. The third box, in red, is the problem. This box tries to employ an embeded font before the container is rendered, and if you look at the trace, it's not accepting the font and instead using the default Times New Roman. The fourth box is exactly the same as the third box, but solves the problem by applying the truncation at updateComplete, rather than on initialize. The trace shows the font to be correct as well. Do you think all this is related to contexts and multiple swfs as you describe in your blog? Thanks! What do you make of this? Is there a way to mimic what happens to textFlow on updateComplete but inside initialize? On Tue, Oct 25, 2011 at 10:02 AM, Alex Harui aha...@adobe.com wrote: ** See the embedded font post on my blog. The control needs to have the right SWF context. Does it work if you turn off RSLs? On 10/25/11 3:01 AM, Baz li...@thinkloop.com wrote: Hello, Anyone have any idea why the embedded font in the following basic application does not show up? ?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 http://ns.adobe.com/flex/spark xmlns:mx=library://ns.adobe.com/flex/mx http://ns.adobe.com/flex/mx creationComplete=application1_initializeHandler(event) minWidth=955 minHeight=600 fx:Script ![CDATA[ import flash.text.engine.FontLookup; import flashx.textLayout.elements.TextFlow; import mx.events.FlexEvent; import spark.utils.TextFlowUtil; [Embed(source=ZemkeHandITCTT.ttf, fontFamily=zem, embedAsCFF=true, fontWeight=normal, mimeType=application/x-font)] public const zem_embed_class:Class; protected var embeddedFontMarkup:XML = p fontFamily=zem fontLookup=embeddedCFFspanSome content/span/p; protected function application1_initializeHandler(event:FlexEvent):void { var textFlow:TextFlow = TextFlowUtil.importFromXML(embeddedFontMarkup); textFlow.fontFamily = 'zem'; textFlow.fontLookup = FontLookup.EMBEDDED_CFF; one.textFlow = textFlow; } ]] /fx:Script s:RichEditableText id=one width=500 height=204 renderingMode=cff fontLookup=embeddedCFF / /s:Application I know the font works because if I specify *any* embedded font directly in the RichEditableText, the specified embedded fonts shows up. Thanks, Baz -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] line returns in a tooltip field
In flex 4 this works: mx:DataGrid id=b2 width=100 toolTip=Click this button #13; to submit the form./
[flexcoders] recursion help?
I'm having a heck of a time converting this search of nested arrays from fixed depth to variable depth using recursion. Any recursion gurus willing to help? public function filterFolderFromPath(fullPath:String):void { for each (var currentFolder:Folder in folders) { if(currentFolder.path == fullPath) { filterFolder = currentFolder; break; } else { for each (var currentFolder2:Folder in currentFolder.children) { if(currentFolder2.path == fullPath) { filterFolder = currentFolder2; break; } else { for each (var currentFolder3:Folder in currentFolder2.children) { if(currentFolder3.path == fullPath) { filterFolder = currentFolder3; break; } else { for each (var currentFolder4:Folder in currentFolder3.children) { if(currentFolder4.path == fullPath) { filterFolder = currentFolder4; break; } else { for each (var currentFolder5:Folder in currentFolder4.children) { if(currentFolder5.path == fullPath) { filterFolder = currentFolder5; break; } } } } } } } } } } }
Re: [flexcoders] recursion help?
Awesome! Gregor it works perfectly, not even a slight adjustment needed, thanks! So much prettier now :) Oleg, thank you too for your input! Cheers, Baz
[flexcoders] What happened to Flex 4 SDK nightly builds?
I just went to check out the Flex 4 SDK nightlies ( http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4) and noticed that there haven't been any builds since May 12th - anyone know what that's about?
[flexcoders] How to make a s:Label with variable content wrap, without specifying width=100%?
I have a s:Label in an ItemRender whose content is variable in length from item to item. This label also has a ToolTip defined that gets displayed when a user hovers over the text. I would like for this label to wrap and adjust to the browser size, but I don't want to specify width=100% because then the tooltip displays when hovering over empty space. Anyone know of a clever solution? Thanks!
Re: [flexcoders] Highlight keywords in a block of text using TextLine
Is it possible to use mxml tags like RichEditableText or TextArea whose content is already populated as the source for this process? What would we get from them, TextLine's? TextBlock's? This is a lot more challenging than I thought it would be :)
Re: [flexcoders] Highlight keywords in a block of text using TextLine
Thanks a lot for your input guys. Nice example Andriy, but the viewsource link is dead. I think I found the simplest way of doing this: setFormatOfRange() It basically changes the format (background/foreground) of a range of characters in a RichEditableText component. So all I have to do is (from inside RichEditableText): var highlightFormat:TextLayoutFormat = new TextLayoutFormat(); highlightFormat.backgroundColor = 0xffee66; var keywordsArray:Array = model.keywords.toLowerCase().split(' '); var indexOfKeyword:int = 0; for each (var currentKeyword:String in keywordsArray) { while((indexOfKeyword = this.text.toLowerCase().indexOf(currentKeyword, indexOfKeyword)) = 0) { this.setFormatOfRange(highlightFormat, indexOfKeyword, indexOfKeyword + currentKeyword.length); indexOfKeyword++; } } Clean.
Re: [flexcoders] Highlight keywords in a block of text using TextLine
Oh Andriy I just realized what you suggested is the same thing, just on a RichText through editManager.applyFormat - very nice. Baz
[flexcoders] Transitions don't work with stateGroups?
I have defined the following stateGroup and transition, but the transition doesn't fire when the toState is to a stateGroup. It does work if its directly to the state name. Is this normal? s:states s:State name=searching_keywords stateGroups=searching / s:State name=loading_nextpage stateGroups=searching / /s:states s:transitions s:Transition fromState=* toState=searching s:Parallel duration=750 s:AnimateColor targets={[bgFill,bgStroke,labelDisplay]} repeatBehavior=reverse repeatCount=0 easer={myEaser} / /s:Parallel /s:Transition /s:transitions
[flexcoders] Highlight keywords in a block of text using TextLine
I have a search and results page that I would like to highlight the keywords that were searched for, in the text of the results. It was suggested that I use TextLine for this, but I am having trouble figuring out how to make it work. I started a simple, compilable dummy application and was hoping someone could give me some tips on how to continue: ?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/mx initialize=initApp(); fx:Script import flash.display.Sprite; import flash.text.engine.*; private var textLine:TextLine; private function initApp():void { var normalFormat:ElementFormat = new ElementFormat(null, 12, 0x00); var highlightFormat:ElementFormat = new ElementFormat(null, 14, 0xff); var textBlock:TextBlock = new TextBlock(new TextElement(This is text that has KEYWORDS. I would like to highlight these KEYWORDS by changing their font color and adding a light yellow background graphic., normalFormat)); textLine = textBlock.createTextLine(); textLine.y = 100; embeddedFontHolder.addChild(textLine); } /fx:Script mx:UIComponent width=100% id=embeddedFontHolder / /s:Application Anyone have any ideas? Cheers, Baz
Re: [flexcoders] Highlight keywords in a block of text using TextLine
OLEG! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! AWESOME! ! ! ! ! It works! I've been trying for 2 days :)
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Alex, thanks a lot for the tip, TextLine is VERY interesting and I've been researching it a lot. I'm surprised not to have bumped into a plug-and-play HighlightComponent that someone's released, so I guess I'll have to roll my own. I'm not sure exactly where to start though. Do I use atoms? How do I get at a RichEditableText's TextLines, it sems only available in TextArea? Should I use TextFlowComposer? What would the general anatomy of a HighlightComponenet look like? Thanks! On Fri, May 28, 2010 at 11:04 AM, Baz li...@thinkloop.com wrote: Alex I'm going to look into that, thanks for the tip. Similarly, if I wanted to change the font color of a single word, would I use TextLine (or something similar) or would I then have to manually break apart the span tags to be able to give them different styles?
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Alex I'm going to look into that, thanks for the tip. Similarly, if I wanted to change the font color of a single word, would I use TextLine (or something similar) or would I then have to manually break apart the span tags to be able to give them different styles?
[flexcoders] useHandCursor and selectable=true?
I would like to use the hand cursor while still allowing my RichEditbleText to be selectable. The combination of selectable=true and useHandCursor=true does not change the cursor to a hand. Any ideas?
Re: [flexcoders] useHandCursor and selectable=true?
Thanks Oleg. You are helpful as usual. I want to mimic HTML in how a link is selectable, yet still clickable with the hand cursor. There is a millimeter of space before and after the link where the handcursor changes to a selection cursor. As I write this I just realized there is an s:a tag that does exactly that! Baz
[flexcoders] Is it possible to define a component's skin within the component itself using something like fx:component?
Is it possible to define a component's skin within the component itself along the lines of: s:Button xmlns:fx=http://ns.adobe.com/mxml/2009; s:skinClass fx:Component s:SparkSkin xmlns:s=library://ns.adobe.com/flex/spark ... /s:SparkSkin /fx:Component /s:skinClass /s:Button
Re: [flexcoders] Is it possible to define a component's skin within the component itself using something like fx:component?
Thank you.
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Now that some time's gone by, what is the best way in Flex 4 to get the coordinates of a specific character? I would like to highlight keywords in a RichEditableText component - very much like this example: http://flexdevtips.blogspot.com/2010/05/highlight-scrollbar-track.html (view source enabled) Another way would be to dynamical create s:span's with their own highlight style when you encounter a keyword. What's a nice clean Flex 4 way to highlight words in a text?
Re: [flexcoders] Re: Is it possible to integrate the CTRL+F browser search with flex text?
valdhor, are you going to open source your solution :) :) :) :) :) On Wed, May 26, 2010 at 6:01 AM, valdhor valdhorli...@embarqmail.comwrote: Basically, yes. What I do is iterate over all the children in the current view (myModule.getChildren). Depending on the type of object, I run different code. For example, if the object is a datagrid I grab the dataprovider and search that. If it's a text field, it is way easier. It can get tricky in some situations (like the data is filtered etc). Then, of course, you need a way to highlight the found text. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Baz li...@... wrote: Does the search functionality have to be customized for the different elements and states currently on the screen, or is there a way to generalize it for any/all visible text? For example if you have an About Us page with one big text block, it takes different code to search that over the Search Results page which has an itemrenderer composed of multiple labels. Cheers. On Tue, May 25, 2010 at 6:01 AM, valdhor valdhorli...@...wrote: Yes, openSearchWindow() is my own custom find functionality coded in flex and manually searches contents on the page. The browsers search box is part of the browser that has no knowledge of the contents of the Flash plug-in. I also had a different project that has a menu bar system at the top and a text field for searching. I set up the CTRL+F listener to set focus to that text field. It made it look kinda like the browsers search box (Enough so that the users didn't complain). --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Baz lists@ wrote: I love it. So openSearchWindow() is your own custom find functionality coded in flex and manually searches contents on the page, right? You haven't found a way to integrate directly with a browser's search box? Baz On Mon, May 24, 2010 at 10:48 AM, valdhor valdhorlists@wrote: openSearchWindow();
Re: [flexcoders] Re: Is it possible to integrate the CTRL+F browser search with flex text?
Does the search functionality have to be customized for the different elements and states currently on the screen, or is there a way to generalize it for any/all visible text? For example if you have an About Us page with one big text block, it takes different code to search that over the Search Results page which has an itemrenderer composed of multiple labels. Cheers. On Tue, May 25, 2010 at 6:01 AM, valdhor valdhorli...@embarqmail.comwrote: Yes, openSearchWindow() is my own custom find functionality coded in flex and manually searches contents on the page. The browsers search box is part of the browser that has no knowledge of the contents of the Flash plug-in. I also had a different project that has a menu bar system at the top and a text field for searching. I set up the CTRL+F listener to set focus to that text field. It made it look kinda like the browsers search box (Enough so that the users didn't complain). --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Baz li...@... wrote: I love it. So openSearchWindow() is your own custom find functionality coded in flex and manually searches contents on the page, right? You haven't found a way to integrate directly with a browser's search box? Baz On Mon, May 24, 2010 at 10:48 AM, valdhor valdhorli...@...wrote: openSearchWindow();
[flexcoders] Having trouble justifying Flex to the higher-ups... It only seems to be appropriate for media based sites...
We are building a text-based app that searches records in a database then displays the results on a page using an ItemRenderer type deal. We want to include some niceties like infinite-scroll - where a user would simply scroll down and subsequent records would load automatically in the background - and intelligent feedback - where different elements on the page animate in some way to show progress or activity. These can be accomplished easily using either Flex or AJAX. My superiors, and admittedly myself, are having trouble justifying using Flex to implement this. Some reasons: - Text is not properly selectable (unless you put everything in one huge/ugly/unfeasible TextInput block) - Text is not findable using the browser's CTRL+F - Text is not properly/nicely indexable by search engines - Slower to render than HTML (as fast as it is, it is still slower, more to load, etc) - Inferior mobile experience (I tested 10.1 on my Nexus One, and it's very good, but still far worse (for text/scrolling) than simply using HTML in the native browser (which has built-in scrolling, flicking, and zooming, with zero additional effort, while Flash doesn't). If you do any research for whose using Flex in public applications, you will only find media based sites like: - picnik.com (photos) - beatport.com (mp3's) - mixbook.com (photos) - mastercard.com (only a configurator sub-element) - ANYTHING VIDEO I am having trouble seeing the benefit of using Flex for anything non audio/visual related. Besides the advantage of it being cross-browser/cross-platform, is there any compelling reason to consider Flex for this app rather than HTML/AJAX? Cheers, Baz
Re: [flexcoders] Having trouble justifying Flex to the higher-ups... It only seems to be appropriate for media based sites...
Thanks Oleg. You confirmed my suspicions. You are right that Flex/Flash performs very well for exactly the type of site you referenced (pixlr.com). I can affirm though, that it does not perform great with text heavy activities - especially if we are talking about RichEditableText with the span and b, etc - even excluding discussion of load times and such, just runtime performance is flickery, choppy, etc. I guess I have to master JQuery now, sad... I love Flex.
Re: [flexcoders] Re: Is it possible to integrate the CTRL+F browser search with flex text?
Interesting! How do you open a new tab? Detect the browser the execute the appropriate Javascript? For the CTRL+F popup - that's your own flex popup with search functionality right?
Re: [flexcoders] Re: Is it possible to integrate the CTRL+F browser search with flex text?
I love it. So openSearchWindow() is your own custom find functionality coded in flex and manually searches contents on the page, right? You haven't found a way to integrate directly with a browser's search box? Baz On Mon, May 24, 2010 at 10:48 AM, valdhor valdhorli...@embarqmail.comwrote: openSearchWindow();
[flexcoders] Is it possible to remove the 3d effects on controls like dropdownlist and scroller without extending them?
is it possible to remove the 3d effects on controls like dropdownlist and scroller without extending them? I just want them to be flat. Thanks, Baz
[flexcoders] Is it possible to make multiple labels selectable as one text block like in regular html
If you have an item renderer with multiple labels like: s:Group s:Label text=abc / s:Label text=def / s:Label text=ghi / /s:Group Is it possible to make the text selectable across renderers and labels as one logical block exactly like in html?
Re: [flexcoders] how to adjust mouse wheel scrolling for custom itemrender?
Ah I see, thanks for the info. Where would I listen to the capture phase? In the scroller component? On Tue, May 18, 2010 at 1:30 PM, Alex Harui aha...@adobe.com wrote: Scrolling speed is a known issue. Some folks have had luck by modifying the delta property of the MouseEvent before the scroller sees it by using a capture phase or high priority event handler. On 5/18/10 11:23 AM, Baz li...@thinkloop.com wrote: I have a skinnabledatacontainer with custom itemrender surrounded by a scroller and I want to adjust how many records are scrolled when the mouse-wheel is used. Currently it scrolls way to many records. Is there an easy way to do this? So far, the only way I've found is to extend the existing scroller, then override the mx_internals set mouseWheel function. The file also has to be AS, because overriding mx_internals functions doesn't work in mxml fx:script. It's a very heavy solution for a relatively simple activity, am I missing something? Cheers, Baz -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
Re: [flexcoders] Is it possible to make multiple labels selectable as one text block like in regular html
I don't mind writing code, any clues on where to start? Perhaps something like a global selection manager that detects mousedown and secretly traverses all the components behind the scenes? On Fri, May 21, 2010 at 11:14 AM, Alex Harui aha...@adobe.com wrote: That’s not a feature of the framework, but if you write enough code I think it should be possible. On 5/21/10 10:37 AM, Baz li...@thinkloop.com wrote: If you have an item renderer with multiple labels like: s:Group s:Label text=abc / s:Label text=def / s:Label text=ghi / /s:Group Is it possible to make the text selectable across renderers and labels as one logical block exactly like in html? -- Alex Harui Flex SDK Team Adobe System, Inc. http://blogs.adobe.com/aharui
[flexcoders] Is it possible to integrate the CTRL+F browser search with flex text?
All browsers have some text search functionality triggered by CTRL+F. Is it possible to use that to search text in a Flex application?
Re: [flexcoders] Is it possible to make multiple labels selectable as one text block like in regular html
It would be very beneficial if Flex/we could interact with all text in a particular view as a single, separate logical unit on its own *layer*.
[flexcoders] Is it possible to disable automatic re-positioning of viewports when associated with a Scroller?
If you implement the Scroller (or VScroller) in a non-standard way as a separate entity (i.e. NOT surrounding the object you want to scroll) then manually assign it's viewport to the object that needs to be scrolled. The scroller automatically changes the size and position of it's target object. Is there a way to disable this? Some non-tested example code: s:Application s:Scroller top=0 viewport={myViewPortObject} / s:Group id=myViewPortObject top=500 / /s:Application In this example, the top=500 of the Group is not respected and instead automatically shifted to fit into the positioning of the Scroller (top=0). I would like for the Scroller to ONLY provide scrolling capabilities regardless of where I decide to place the viewport, without having to extend it - something like disableAutoPositioning=true - is this possible? Thanks, Baz
[flexcoders] how to adjust mouse wheel scrolling for custom itemrender?
I have a skinnabledatacontainer with custom itemrender surrounded by a scroller and I want to adjust how many records are scrolled when the mouse-wheel is used. Currently it scrolls way to many records. Is there an easy way to do this? So far, the only way I've found is to extend the existing scroller, then override the mx_internals set mouseWheel function. The file also has to be AS, because overriding mx_internals functions doesn't work in mxml fx:script. It's a very heavy solution for a relatively simple activity, am I missing something? Cheers, Baz
Re: [flexcoders] Re: Folder-style dragOver highlight on tree
Doesn't the node already highlight because you are rolling over it?
[flexcoders] Best way to remove line breaks from Label text?
I have an s:Label whose text comes from a DB. What's the best way to remove, or not show, any line breaks that may be in that text? I could use another text element if that's easier/cleaner. Thanks.
Re: [flexcoders] Re: Thoughts on Flash by Steve Jobs
I think open and closed is too broad... and their definitions are moot. If anything Flash is a daywalker. A half breed. Its a creature of the night but it can exist during the day. It doesn't have to feed on human blood but you wouldn't want to be around him when he's hungry. especially on the feast of a thousand moons. unless of course you've been turned. and in vampire society there's pure blood and non-pure blood (the turned). pure bloods are born-vampires, offspring that were conceived between two turn-blood or born vampires. both carries with it a specific connotation that is reflected in their society and hierarchy. ...what were we talking about? hehehe
[flexcoders] SSL + Secret Key, enough to secure remote services?
There are tons of different ways to implement security on remote services. I would like to double-check if there are any flaws with the one I am looking at: 1. Load the app swf using HTTPS, which automatically forces all future requests from within the app to use HTTPS 2. Load a secret key that is securely stored on the server (not compiled into the swf!) 3. Use the secret key with every remote request to ensure the client is valid Any security holes with that? Cheers, Baz
Re: [flexcoders] Re: Thoughts on Flash by Steve Jobs
The best part is that HTML5 video is going to be based on H.264 - which is not only a proprietary codec, BUT COSTS MONEY! At least flash is free. Here's an excerpt of what happened with gif: The web in 1999 was a lot smaller than it is today, so a lot of people don’t remember what happened back when Unisys decided to start to enforce their GIF-related patentshttp://en.wikipedia.org/wiki/Gif#Unisys_and_LZW_patent_enforcement. GIF was already widely used on the web as a fundamental web technology. Much like the codecs we’re talking about today it wasn’t in any particular spec but thanks to network effects it was in use basically everywhere. Unisys was asking some web site owners $5,000-$7,500 to able to use GIFs on their sites. Note that these patents expired about five years ago, so this isn’t an issue today, but it’s still instructive. It’s scary to think of a world where you would have to fork up $5000 just to be able to use images on a web site. Think about all of the opportunity, the weblogs, the search engines (even Google!) and all the other the simple ideas that became major services that would never have been started because of a huge tax being put on being able to use a*fundamental* web technology. It makes the web as a democratic technology distinctly un-democratic. from ( http://www.0xdeadbeef.com/weblog/2010/01/html5-video-and-h-264-what-history-tells-us-and-why-were-standing-with-the-web/ )
Re: [flexcoders] Re: Thoughts on Flash by Steve Jobs
There are 2 distinct and separate anti-Adobe issues from Apple. One is the anti-flash stance, which we have been focusing on in this thread - but a separate and important second issue is Apple disallowing *NATIVE* IPHONE BINARIES that are created using CS5: http://www.adobe.com/devnet/logged_in/abansod_iphone.html. So just to be 1000% clear, you write code in AS3, then the compiler outputs a pure iphone binary - there is no Flash, no runtime, no swf - nothing. So my question is, how would Apple even know what tools I used to create an app? What if I made my own code generator in objective C, is that allowed? Are they also going to say I'm not allowed to use notepad to write my code? Cheers, Baz On Mon, May 3, 2010 at 8:15 AM, Gregor Kiddie gregor.kid...@channeladvisor.com wrote: If we are swapping rumours though... I liked the one that Apple had demanded a truly ridiculous sum of money from Adobe yearly to allow Flash on the iPhone, and when Adobe refused to pay up, SJ made it his mission to prevent it from happening! I’d call it a tithe, but that brings far too many religious connotations to be associated with Jobs... Gk.
[flexcoders] how to handle remote requests the never return or get lost?
If you send a request to a web service, and for some reason that request never returns because it got lost on the net, or some other failure. What strategies do people employ on the flex side to handle that situation? FaultEvent wouldn't fire in this case, because there are no known faults yet. Perhaps, people employ some timeout functionality on their remote listeners? Cheers, Baz
Re: [flexcoders] Re: how to handle remote requests the never return or get lost?
You confirmed my suspicions. I believe that very few developers employ this, but it seems quite important as requests can get lost relatively often. Anyone think it would be beneficial to have a TimeoutEvent built right in along side ResultEvent and FaultEvent to make it easier? Baz On Mon, May 3, 2010 at 1:24 PM, jamesfin james.alan.finni...@gmail.comwrote: I agree with Rick. For all net calls, I have a timer going and a simple queue that is populated when sending each request. When and if they return sometime later, they are removed from the queue. If requests aren't received by some set timeout, they are ignored. I employ the use of tokens for each request so I know if I should ignore them or not if they are expired by my timeout. You could also log the failure to the server or trace if you want to track them. james --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Rick Genter rick.gen...@... wrote: On Mon, May 3, 2010 at 1:14 PM, Baz li...@... wrote: If you send a request to a web service, and for some reason that request never returns because it got lost on the net, or some other failure. What strategies do people employ on the flex side to handle that situation? FaultEvent wouldn't fire in this case, because there are no known faults yet. Perhaps, people employ some timeout functionality on their remote listeners? Cheers, Baz Do you use a URLRequest/URLLoader to place your request? I think if you listen for an IOErrorEvent.IO_ERROR, one gets raised if the request times out at the HTTP level. If the request gets to the server but the server just takes too long to respond, then I think you'll have to add some sort of timer. -- Rick Genter rick.gen...@...
[flexcoders] Out of curiosity, what would Adobe lose if Flash were open sourced?
I don't know much about how to answer this, so I'm not trying to take a position or anything: purely out of curiosity, what would Adobe lose if Flash were open sourced? Is it that competitors would more easily be able to make competing IDEs? Cheers, Baz
Re: [flexcoders] Re: Flebuilder 3 manage project
You definitely need some kind of source control like SVN or GIT. You check out your project, work/test locally, then commit back to the repo. You can do this as often as you like. If you don't want to go that route, even though you really, really, really should... at a minimum, make sure that the project is not on the share. Create your project locally, with all the settings and *dot* files (and have the other developers do the same), then only share the pure src code on the network share. You can link it to your project by opening the create new folder dialog, clicking on advanced the selecting link (something like that) and choosing your network share. Also, yahoo can notify you of new messages - there is a delivery preferences option, or something like that. Baz On Mon, Apr 26, 2010 at 7:58 AM, aceoohay pa...@compuace.com wrote: We are still having the problem, but I have been too busy to check flexcoders. It sure would be nice if Yahoo groups would notify you of responses to threads you are members of. We are not using a CVS, the project is on a network share, multiple developers have FB3 on their desktop, and the problems we are having generally include slow compiles and modules in the project not compiling after a chhange. The last problem is the real pain, you make a change, compile and test, and the change doesn't seem to do anything. The most reliable way of resolving the issue is to remove the module from the project and re-add it. Paul --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Ivan ivan.ilija...@... wrote: Hello Paul. Can you give us some hints what kind of problems are you talking about? Are you using Subversion, CVS or some other repository? --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, aceoohay pauls@ wrote: We are doing a conversion of 200+ screens from Oracle Forms to Flex, and have 4 developers working on the project. We are experiencing a variety of problems with flexbuilder when everyone is using the same project. Where can I find some hints on how to manage a project with multiple developers? Paul
Re: [flexcoders] Re: Flebuilder 3 manage project
In my book, there are only 2 options for source control: GIT and Subversion. The main difference between them is that GIT is distributed and SVN is centralized. The future is with GIT, but SVN is more prevalent and its tooling more refined. If I were you, learning a whole new system, I'd go with GIT - it's really much, much, much better, and the eclipse plugin (eGIT) has been maturing very well. In terms of setup, it will only be a few hours for either one, but it will take some effort and reading - neither are totally point and click. Depending on your corporate policy, I'd just pay a couple of bucks a month for a hosted solution at somewhere like github.com. That's where all open flex projects are going and it's an unbelievably well put together site with TONS of help docs. Also there's a fantastic book that was just opened up and published online: http://progit.org/book/ Good luck! Baz On Mon, Apr 26, 2010 at 2:18 PM, aceoohay pa...@compuace.com wrote: Okay, say I want to use some sort of version control. I am not opposed to it, but I can't spend too much effort implementing this whilst still trying to get the project done within an unreasonable deadline. What do you suggest product wise? My developers have local/vpn access to the network where the project files are stored. Everything is all windows. Generally everyone works on discreet parts of the system except me, I work on the shared portions, and help out in whatever discreet section someone needs help in. The shared (classes, components the like) pieces that I work on need to be propagated to the other developers as soon as I publish them. As I mentioned before, I don't have a lot of manpower to put to implementing a version control system. Based on the above, what would be best? Paul --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Baz li...@... wrote: You definitely need some kind of source control like SVN or GIT. You check out your project, work/test locally, then commit back to the repo. You can do this as often as you like. If you don't want to go that route, even though you really, really, really should... at a minimum, make sure that the project is not on the share. Create your project locally, with all the settings and *dot* files (and have the other developers do the same), then only share the pure src code on the network share. You can link it to your project by opening the create new folder dialog, clicking on advanced the selecting link (something like that) and choosing your network share. Also, yahoo can notify you of new messages - there is a delivery preferences option, or something like that. Baz On Mon, Apr 26, 2010 at 7:58 AM, aceoohay pa...@... wrote: We are still having the problem, but I have been too busy to check flexcoders. It sure would be nice if Yahoo groups would notify you of responses to threads you are members of. We are not using a CVS, the project is on a network share, multiple developers have FB3 on their desktop, and the problems we are having generally include slow compiles and modules in the project not compiling after a chhange. The last problem is the real pain, you make a change, compile and test, and the change doesn't seem to do anything. The most reliable way of resolving the issue is to remove the module from the project and re-add it. Paul --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, Ivan ivan.ilijasic@ wrote: Hello Paul. Can you give us some hints what kind of problems are you talking about? Are you using Subversion, CVS or some other repository? --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.comflexcoders% 40yahoogroups.com, aceoohay pauls@ wrote: We are doing a conversion of 200+ screens from Oracle Forms to Flex, and have 4 developers working on the project. We are experiencing a variety of problems with flexbuilder when everyone is using the same project. Where can I find some hints on how to manage a project with multiple developers? Paul
Re: [flexcoders] Re: artchitectural suggestion for making any uicomponent draggable?
Very helpful, thanks! Anyone have success/recommends BIFFF (Behaviour Injection Framework For Flex) http://wiki.github.com/seanhess/bifff/?
[flexcoders] Does filterFunction create a new array behind the scenes?
Hi, Anyone know what filterFunction on an ArrayCollection does to the source array behind the scenes? Does it create a new subset array with the filtered items? Does it hide elements in the same array somehow? Thanks, Baz
[flexcoders] artchitectural suggestion for making any uicomponent draggable?
Hello, I have an application where any uicomponent is draggable relative to the stage. The code is the same for each one. Does anyone have a suggestion on a clean way of enabling that functionality for any uicomponent while minimizing duplication? Here is a snippet of the main (duplicate) dragging logic: private function drag(event:MouseEvent):void { var snapIt:Boolean = false; var distanceX:int = (stage.mouseX - xPosStart); var distanceY:int = (stage.mouseY - yPosStart); if ((snapIt)((distanceX != 0)||(distanceY != 0))) { var snapTo:int = 15; var xMove:int = xStart+distanceX; var yMove:int = yStart+distanceY; var xSnap:int = xMove + (snapTo - xMove % snapTo); var ySnap:int = yMove + (snapTo - yMove % snapTo); this.x=xSnap; this.y=ySnap; } else { this.x=xStart+distanceX; this.y=yStart+distanceY; } event.updateAfterEvent(); }
Re: [flexcoders] Flex 4 list of text elements!
In the layout tag there is verticalScrollPolicy=off and horizontalScrollPolicy=off Baz
[flexcoders] Virtualized Item Render - Display Current Row
I have an array collection with 1000 items that I display in a virtualized itemrenderer. What is the best way to display the row number of that item as it is in the big source query? That is, if they are looking at items 100-110 it would show 100, 101, 102, ... and not 1, 2, 3...
Re: [flexcoders] Virtualized Item Render - Display Current Row
Hey thanks Alex, but I am getting 0 for the value of verticalScrollPosition. I am using a SkinnableDataContainer with s:Scroller defined in it's skin and a custom itemRenderer=views.reports.ReportItemRenderer - perhaps I am doing something wrong? Thanks again, Baz
Re: [flexcoders] Re: Font Embedding from *.ttc files
He is not a genius, just highly gifted, he missed the mensa cut-off by 2 points... /RandomLateNightComment
Re: [flexcoders] Clean way to filter very large ArrayCollection (in pieces) using filterFunction
Thanks for the suggestion Roman, could you tell me a little more? How can I refresh only a certain range records? Baz
[flexcoders] What happened to the examples on flexaxmples.com
Is it just me or did flexamples.com remove the actual flex application demos and only leave the code?
Re: [flexcoders] What happened to the examples on flexaxmples.com
Yeah I did mis-type the urls in the email, but that's the site I'm talking about. Do you see any flex demos on this page for example: http://blog.flexexamples.com/2009/11/11/creating-an-animated-transition-when-scrolling-through-items-in-a-spark-hgroup-container/
Re: [flexcoders] What happened to the examples on flexaxmples.com
Haha, thanks Peter! Thanks Adnan! I swear I tried around 5 random samples and there was no flex app in any of them, talk about bad luck. I love this resource, I started a Progressive Auto Quote :)
[flexcoders] Clean way to filter very large ArrayCollection (in pieces) using filterFunction
Hello, I have a very large arraycollection that users can filter by typing characters into a search box. I use ArrayCollection's filterFunction to perform the filtering, but as the recordset grows, it (obviously) takes longer to filter and makes the interface less responsive. Is there a way to access/adjust the internals of filterFunction without having to roll my own or implement greenthreading? Similarly, is there a way to know how far into the filtering it is, for example to update a Number of Matched Records box that gets updated DURING the filtering process rather than jst at the end when it is done? Cheers, Baz
Re: [flexcoders] How can I keep myself motivated to program in Flex? Please help. Thanks?
Maybe you should see a doctor, it's not normal to black-out every 3 days.
Re: [flexcoders] Re: Honestly guys , at 48 should I expect Flex AS3 to change my life job wise?
There's a ton of Flex jobs in the States too. You don't even need a year, you just need 2-3 medium sized applications under your belt and you're good to go. Flex 4 is actually much easier than Flex 3. They replaced a lot of complicated and disjointed low-level code with much simpler, higher-level code constructs - especially when it comes to layouts, colors, and shapes. Don't use the drawing API in Flex 3 - that's going away - otherwise you are certainly not wasting your time with Flex 3. Once you get one simple Flex 3 app down, I'd jump into Flex 4 and continue from there. At my company we couldn't care less about age, sex or race. We have a lot of foreigners and people of varying ages - it would be nice to have a few more females but they don't apply! Cheers, Baz On Sun, Nov 29, 2009 at 2:24 AM, Kevin Bowers kevin.bow...@btinternet.comwrote: Hi, As a fellow 48 year old I'd say it would depend on a who range of things, not just the Flex scripting skills. For a start, where in the world are you? Here in Europe there is a real shortage of Flex skills, so anyone with a fair level of ability should be able to get a job. As for the Flex version, well Flex 3 will continue to be in use for some time I think, but as has been said earlier picking up Flex 4 once you have a handle on 3 shouldn't be too much of a problem. Good luck, Kev -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Ivan Wang *Sent:* 29 November 2009 07:07 *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] Re: Honestly guys , at 48 should I expect Flex AS3 to change my life job wise? Actually the differences between Flex 3 and 4 may not be that much as you guess, at least not totally different. Flex is a framework anyway, the basic things are still stay the same. Changes in layout, skin, new namespace etc. just make it more well-organized and easier to use. My suggestion is that you can learn AS first, then use Flex 3 to build a small application from the ground up to learn the basic Flex. That's all you need to start Flex 4. - Original Message - *From:* fred44455 fred44...@yahoo.com *To:* flexcoders@yahoogroups.com *Sent:* Sunday, November 29, 2009 2:06 PM *Subject:* [flexcoders] Re: Honestly guys , at 48 should I expect Flex AS3 to change my life job wise? Mr. Wang, Thank you so much for your input. I am currently learning Flex 3 under Lynda.com Essential training and I also purchased Lynda.ActionScript 3 essential training(with Flex not Flash). I am using both tutorials and I seems to pick up the basics nicely. However I tried to follow Flex4 in a week(from adobe videos) but it was too hard for me to understand. These videos I think were assuming that you kow Flex basics. As you said it will be better to start with Flex4 the framwook but there is no Flex 4 book availble yet!! Do you think that the difference between Flex 3 and Flex 4 is that huge? What I am trying to say is that I hope that I am not wasting my time learning Flex 3 to realize(when the Flex 4 books will be available) that it is a totally different programming using Flex 4. Thank you in advance for your answer, Regards, Fred. --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, Ivan Wang ivan.wang2...@... wrote: Of course you will, learning a new language has nothing to do with one's age. ActionScript is quite a simple language compared to other and Flex is just a framework. One year is long enought to be a Flex Dev. I suggest you start from Flex 4 since it's quite diffrent from its previous brother. Have fun. - Original Message - From: fred44455 To: flexcoders@yahoogroups.com flexcoders%40yahoogroups.com Sent: Sunday, November 29, 2009 12:05 PM Subject: [flexcoders] Honestly guys , at 48 should I expect Flex AS3 to change my life job wise? I am 48 and currently learning Flex3 AS3. I have tried several other platforms languages and so far Flex is where I feel home , the coding feel more intuitive to me , so I am expecting to keep learning the material. Now let's say 1 year from now if I try to get a job will I be able to get an entry level as Flex Developer? Even at my age? Or should I just continue this as a hobby. Thanks for your time, Fred.
Re: [flexcoders] Question about Flex Actionscript 3 code Flash actionscript 3 code
Hey, Flex is nothing more than a framework built using AS3, and AS3 only exists in the flash player, so they are the exact same AS3. An Flex (mxml) component, is just a set of AS3 classes, that you can modify, update, extend, or change in any way. Flex simply provides a high-level and convenient way to implement Action Script. To learn, I'd start with a simple mxml app, then as you progress, start adding more complexity and customizations. You will quickly find out that you will have to drop down to the lower-level AS3 code, by creating your own classes, or extending existing flex components. At the end of the day, to be a good Flex developer, you have to also be a good AS3 developer, so it's in your interest to learn both. Good luck! Baz On Sat, Nov 21, 2009 at 5:27 PM, fred44455 fred44...@yahoo.com wrote: I am new to Flex however I have both platforms , Flex 3 and Flash CS4. My question is : When you code AS3 using Flex3 is it totally similar than Flash AS3? Do they use different packages Classes? Is it better to start with Flex 3 first then doing Flash aftwards?or can I learn both platforms on the same time?I want to become a Flex Developer but i noticed that the job postings often require Flex/Flash knowledge. Thanks for your time.
[flexcoders] Re: embed font into preloader
I am thinking that converting the 6 chars I need for the preloader to vector graphics would be the most efficient way to display/animate that text without loading any superfluous data. To accomplish this, would I export them through illustrator? To what format? Is there a flex way of doing this? Thanks. On Thu, Oct 15, 2009 at 12:18 PM, Baz li...@thinkloop.com wrote: I have a custom font I would like to use for my preloader, but I would like to implement it without having to use Flash IDE. I know the exact text I need to write, it is only 6 characters long, but later on in the app I will need the entire set of chars of that font. What is the best way to go about this? 1. Should I embed the font twice, once with a tiny subset of 6 chars for the preloader, then again in flex for the rest of the chars? 2. Should I create vector images of each character for the preloader (I need to animate each char independently)? 3. Should I create a series of png's for each char? 4. Anything else? Thanks!
Re: [flexcoders] Re: defining more than one class in a simple .as file (ref)
me? On Fri, Oct 16, 2009 at 1:31 PM, Tracy tr...@nts3rd.com wrote: Please do not hijack threads. Unless your post is directly applicable to another, start a new topic. Do not just change the subject line. It confuses some threaded readers, like yahoo's html version. Tracy --- In flexcoders@yahoogroups.com flexcoders%40yahoogroups.com, dennis den...@... wrote: I want to create more than one class in a single .as file, but finally this is not allowed! I read at http://livedocs.adobe.com/flex/3/html/help.html?content=basic_as_2.htmlthe follow rule: In a single ActionScript file, you can define only one class in the package. To define more than one class in a file, define the additional classes outside of the package body. Implementing by this way, the additional classes doesn't belong to the package (specified in the .as), but belong in the default package something that I do not want it. Of course, the other way Is to implement the class in another .as of the same package but this will have as result so many .as files (doing nothing in particular). So, I just want to clear, there is no way to have more than one class of the same package in the same .as file??? dennis ...we are what we are doing... P Think! before you print.
[flexcoders] embed font into preloader
I have a custom font I would like to use for my preloader, but I would like to implement it without having to use Flash IDE. I know the exact text I need to write, it is only 6 characters long, but later on in the app I will need the entire set of chars of that font. What is the best way to go about this? 1. Should I embed the font twice, once with a tiny subset of 6 chars for the preloader, then again in flex for the rest of the chars? 2. Should I create vector images of each character for the preloader (I need to animate each char independently)? 3. Should I create a series of png's for each char? 4. Anything else? Thanks!
Re: [flexcoders] defining more than one class in a simple .as file (ref)
No definitely not, but I am curious what your specific use-case is to want that. How would you be able to find a class without opening every file to see if it is in there? On Thu, Oct 15, 2009 at 12:33 AM, dennis den...@anel.cc wrote: I want to create more than one class in a single .as file, but finally this is not allowed! I read at http://livedocs.adobe.com/flex/3/html/help.html?content=basic_as_2.htmlthe follow rule: “In a single ActionScript file, you can define only one class in the package. To define more than one class in a file, define the additional classes outside of the package body.” Implementing by this way, the additional classes doesn’t belong to the package (specified in the .as), but belong in the “default package” something that I do not want it. Of course, the other way Is to implement the class in another .as of the same package but this will have as result so many .as files (doing nothing in particular). So, I just want to clear, there is no way to have more than one class of the same package in the same .as file??? *dennis* ...*we are what we are doing*... *P **Think! before you print.** *
[flexcoders] Duplicate decompression when app starts
I have a Flex 4 (gumbo) app that uses modules and it seems there is a lot of duplicate decompression and loading of swf's when the app runs, is this normal? Here is the trace: [SWF] /cf8/hub-debug/Hub.swf - 753,158 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 2,247,068 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 641,053 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 1,179,749 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 440,166 bytes after decompression [SWF] /cf8/hub-debug/reportcenter/ReportCenter.swf - 371,185 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 641,053 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 2,247,068 bytes after decompression [Unload SWF] /cf8/hub-debug/Hub.swf [SWF] /cf8/hub-debug/Hub.swf - 1,179,749 bytes after decompression [SWF] /cf8/hub-debug/Hub.swf - 440,166 bytes after decompression [Unload SWF] /cf8/hub-debug/Hub.swf [Unload SWF] /cf8/hub-debug/Hub.swf Thanks!
[flexcoders] Does SPLICE loop through the array or not?
Hi, if I have a large array and I wanted to remove, say, item #455 - is splice the best way to do that? How efficient is splice? Does it loop through the array anyway behind the scenes, or does it use a more direct mechanism to remove the item and adjust the rest of the count? Cheers, Baz
Re: [flexcoders] callLater in a non UI actionscript component (pseudo-threading)
Alex thanks for the tip. I saw your post about pseudo-threading: http://blogs.adobe.com/aharui/2008/01/threads_in_actionscript_3.html Then I found this project doing it: http://code.google.com/p/async-threading/downloads/list Do you know that project? Should I use that? Thanks so much! Baz On Wed, Oct 7, 2009 at 9:35 PM, Alex Harui aha...@adobe.com wrote: Calllater is just using enterFrame and render events. If you have any Flex code in the app, you can use Application.application.callLater Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Wednesday, October 07, 2009 2:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] callLater in a non UI actionscript component (pseudo-threading) I currently have an expensive process that I am pseudo-threading by processing part of it, then using callLater to process the rest. This lets me update the view after each batch is processed, giving the user feedback during the process. Also, it gives the user a window to 'interrupt' the process and change some parameters so that it continues processing the rest of the data with those new paramaters. I would like to move this batch pseudo-threading functionality to my service layer (an AS component) but callLater is a UIComponent function. Is there a way to get similar functionality in a NON-UIComponent component? Is there a better way of going about this? Thank you!
[flexcoders] When does myArrayCollection.setItemAt() get invoked in the component lifecycle?
If I had a ui component and on init() I did myArrayCollection.setItemAt(value, position) - when would the visual component bound to the arraycollection get updated? Is it immedietly when the function is called, or is it automatically deferred to updateDisplayList()? Basically, should I implement the invalidateProperties() / commitProprties() strategy when using setItemAt() on an Arraycollection or is this automatically handled? Cheers, Baz
Re: [flexcoders] When does myArrayCollection.setItemAt() get invoked in the component lifecycle?
Alex you're the best thank you for all the help! So to follow, a strategy of deferring the setItemAt() call to commitProperties() has no value in this case? On Fri, Oct 9, 2009 at 1:29 PM, Alex Harui aha...@adobe.com wrote: It is deferred to updateDisplayList Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Friday, October 09, 2009 11:09 AM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] When does myArrayCollection.setItemAt() get invoked in the component lifecycle? If I had a ui component and on init() I did myArrayCollection.setItemAt(value, position) - when would the visual component bound to the arraycollection get updated? Is it immedietly when the function is called, or is it automatically deferred to updateDisplayList()? Basically, should I implement the invalidateProperties() / commitProprties() strategy when using setItemAt() on an Arraycollection or is this automatically handled? Cheers, Baz
[flexcoders] how light-weight is an array of custom objects if those custom objects already exist in another array?
Hi, I have an ArrayCollection of custom objects, and I need to create a subset of those custom objects based on a condition (without using the built-in filter() functionality). I am thinking of storing that subset in a second array, but that is not mandatory - performance is key in this piece of the app. If I did use a second array, how light-weight would it be, are arrays extremely effecient constructs in general? Also, in terms of the custom objects, I believe that they would all be linked by reference, and not duplicated in the second array - is this correct, and does that make the array basically the same as if it were storing simple integers? Overall, is this the most effecient way of getting a subset of an array? Thanks!
Re: [flexcoders] how light-weight is an array of custom objects if those custom objects already exist in another array?
Great, thank you! On Wed, Oct 7, 2009 at 11:13 AM, Paul Andrews p...@ipauland.com wrote: Baz wrote: Hi, I have an ArrayCollection of custom objects, and I need to create a subset of those custom objects based on a condition (without using the built-in filter() functionality). I am thinking of storing that subset in a second array, but that is not mandatory - performance is key in this piece of the app. If I did use a second array, how light-weight would it be, are arrays extremely effecient constructs in general? Also, in terms of the custom objects, I believe that they would all be linked by reference, and not duplicated in the second array - is this correct, and does that make the array basically the same as if it were storing simple integers? Overall, is this the most effecient way of getting a subset of an array? All objects are accessed by reference and essentially your proposed array would be an array of pointers, so it's about as lightweight as it can get. Paul Thanks!
[flexcoders] callLater in a non UI actionscript component (pseudo-threading)
I currently have an expensive process that I am pseudo-threading by processing part of it, then using callLater to process the rest. This lets me update the view after each batch is processed, giving the user feedback during the process. Also, it gives the user a window to 'interrupt' the process and change some parameters so that it continues processing the rest of the data with those new paramaters. I would like to move this batch pseudo-threading functionality to my service layer (an AS component) but callLater is a UIComponent function. Is there a way to get similar functionality in a NON-UIComponent component? Is there a better way of going about this? Thank you!
Re: [flexcoders] custom itemrender flicker
You might be better off suppressing the setItemAt if it is the same. That is exactly what I did and it works great. Now the only issue I need to solve is how the entire collection reloads if only one item is changed. Do you have any advice on where I should begin looking for that? I am very comfortable extending and overriding anything. Thanks alot! On Mon, Oct 5, 2009 at 10:36 PM, Alex Harui aha...@adobe.com wrote: It depends on how you coded the renderer. Our list classes have very general and somewhat inefficient update strategies because we want to make sure most collection updates renderer correctly. I haven’t looked at how Spark List thinks, but mx:List will refresh all renderers even if only one item changes because it doesn’t know if another renderer might have “look-ahead” and also care about the item even though its data item is some other item in the collection. You might be better off suppressing the setItemAt if it is the same. Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Monday, October 05, 2009 3:18 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] custom itemrender flicker Hey Alex, thanks a lot for your reply. So it is *proper* behaviour that if you setItemAt in a custom itemrenderer that the whole control is rebuilt visually? Incidentally I am using Flex 4, so this might be of even more interest. I have a SkinnableDataContainer with an ArrayCollection dataprovider that holds custom objects ('reports' in this case). If my current collection has: 1. Report #1 = Name: 1stReportName, Path: 1stReportPath 2. Report #2 = Name: 2ndReportName, Path: 2ndReportPath And then I do a myArrayCollection.setItemAt(Report1, 0), which basically sets the first item to the same report it currently has. The itemrenderer empties of all items, then re-displays them, causing a flicker or flash that is noticeable on a slow computer. Wouldn't it make more sense for the itemrender NOT to re-build itself from scratch on every change? What if you had 100 items and u onl;y set one item? Thanks a lot! Baz On Mon, Oct 5, 2009 at 3:05 PM, Alex Harui aha...@adobe.com wrote: It depends on how you wrote the renderer. You can try overriding the “function set data()” to check for changes to the object referenced by the renderer, but then if some sub-property changes, the renderer will not update. Might be better to understand why it flickers when updating. Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Monday, October 05, 2009 12:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] custom itemrender flicker If I have a custom item render based on an ArrayCollection with 10 times, and just for fun, I loop through those 10 items and setItemAt the exact same values that are already there - on screen the list of items reloads in a sense, re-building itself to the exact same values. I would like that in such a case, the on-screen controls know that they are the same as before and not to rebuild themselves. Is this possible? Can I intercept some event to double check whether they are the same or different? The goal of course, is to have this behaviour even if one some items changed. For example if I change only the 10th item, I would expect only the 10th item to refresh, no the whole collection. Thanks for any ideas! P.S. I am not useing refresh() on the ArrayCollection is it set to auto-update. Also, all my setItemAt calls are done in commitProperties()
[flexcoders] custom itemrender flicker
If I have a custom item render based on an ArrayCollection with 10 times, and just for fun, I loop through those 10 items and setItemAt the exact same values that are already there - on screen the list of items reloads in a sense, re-building itself to the exact same values. I would like that in such a case, the on-screen controls know that they are the same as before and not to rebuild themselves. Is this possible? Can I intercept some event to double check whether they are the same or different? The goal of course, is to have this behaviour even if one some items changed. For example if I change only the 10th item, I would expect only the 10th item to refresh, no the whole collection. Thanks for any ideas! P.S. I am not useing refresh() on the ArrayCollection is it set to auto-update. Also, all my setItemAt calls are done in commitProperties()
Re: [flexcoders] custom itemrender flicker
Hey Alex, thanks a lot for your reply. So it is *proper* behaviour that if you setItemAt in a custom itemrenderer that the whole control is rebuilt visually? Incidentally I am using Flex 4, so this might be of even more interest. I have a SkinnableDataContainer with an ArrayCollection dataprovider that holds custom objects ('reports' in this case). If my current collection has: 1. Report #1 = Name: 1stReportName, Path: 1stReportPath 2. Report #2 = Name: 2ndReportName, Path: 2ndReportPath And then I do a myArrayCollection.setItemAt(Report1, 0), which basically sets the first item to the same report it currently has. The itemrenderer empties of all items, then re-displays them, causing a flicker or flash that is noticeable on a slow computer. Wouldn't it make more sense for the itemrender NOT to re-build itself from scratch on every change? What if you had 100 items and u onl;y set one item? Thanks a lot! Baz On Mon, Oct 5, 2009 at 3:05 PM, Alex Harui aha...@adobe.com wrote: It depends on how you wrote the renderer. You can try overriding the “function set data()” to check for changes to the object referenced by the renderer, but then if some sub-property changes, the renderer will not update. Might be better to understand why it flickers when updating. Alex Harui Flex SDK Developer Adobe Systems Inc. http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Monday, October 05, 2009 12:32 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] custom itemrender flicker If I have a custom item render based on an ArrayCollection with 10 times, and just for fun, I loop through those 10 items and setItemAt the exact same values that are already there - on screen the list of items reloads in a sense, re-building itself to the exact same values. I would like that in such a case, the on-screen controls know that they are the same as before and not to rebuild themselves. Is this possible? Can I intercept some event to double check whether they are the same or different? The goal of course, is to have this behaviour even if one some items changed. For example if I change only the 10th item, I would expect only the 10th item to refresh, no the whole collection. Thanks for any ideas! P.S. I am not useing refresh() on the ArrayCollection is it set to auto-update. Also, all my setItemAt calls are done in commitProperties()
[flexcoders] If you refresh() an ArrayCollection, should that be in commitProperties() or updateDisplayList()?
If you refresh() an ArrayCollection, should that be in commitProperties() or updateDisplayList()?
Re: [flexcoders] Re: what happens if you setItemAt the exact same item in an ArrayCollection?
Thank you. To stop views from updating if an object with the same values was set, how would I intercept the events that get fired and cancel them? Would I play with the bubbling values? Cheers, Baz On Wed, Sep 30, 2009 at 11:20 PM, mrcaraion mrcara...@yahoo.com wrote: The ArrayCollection will dispatch a CollectionEvent (with CollectionEventKind.REPLACE) in either case, it will not check to see if that is the same object, whether with the same reference or with the same values.
Re: [flexcoders] Re: what happens if you setItemAt the exact same item in an ArrayCollection?
Oh excellent, I can do that :) Thanks a lot for your advice! On Thu, Oct 1, 2009 at 1:54 PM, mrcaraion mrcara...@yahoo.com wrote: I think a solution will be to extend the ArrayCollection and to override setItemAt() method (and other methods if needed) and to prevent the call of super.setItemAt() if the reference of passed item is equal to the existing item at the given position, something like: override public function setItemAt(item:Object, index:int):Object { if (item == getItemAt(index)) { return item; } super.setItemAt(item, index); } you may implement even a check of property equalities, but this only for objects with the same type or dynamic one. cheers!
[flexcoders] what happens if you setItemAt the exact same item in an ArrayCollection?
Hi, if I have an array collection of custom objects (i.e. Reports), and I used setItemAt to set the exact same object instance ion the exact same spot - will the array collection fire events and update boujnd views - or will it know *know* to do nothing because there was no real change? What if the object was a different instance, but had the exact same values? Is this considered a *new* object and events will be fired? Thanks for your time! Baz
[flexcoders] Text Effect: One Letter at a Time
Is it possible to apply an effect on a single letter in a textinput field? For example, when a letter gets typed (*change* effect), that letter expands and fades out. So if someone types a word, each letter of that word independently and sequentially expands and fades out as they are typed. Cheers.
[flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Anyone know how to get the X/Y coordinates of a specific character/letter in a text field or text input? Thanks!
Re: [flexcoders] How to get X, Y position/coordinates of a specific character/letter in a text field
Hey Thanks Ian, I was just looking at that actually but TextInput doesn't seem to have it (Flex 4). I read that you can use: import mx.core.mx_internal; use namespace mx_internal; to access TextField and then getCharBoundaries() but that doesn't seem to work in Flex 4. Any ideas? Thanks, Baz On Mon, Aug 31, 2009 at 1:19 PM, Ian Thomas i...@eirias.net wrote: Take a look at flash.text.TextField.getCharBoundaries() (and other TextField methods). HTH, Ian On Mon, Aug 31, 2009 at 8:53 PM, Bazli...@thinkloop.comlists%40thinkloop.com wrote: Anyone know how to get the X/Y coordinates of a specific character/letter in a text field or text input? Thanks!
[flexcoders] Re: Text Effect: One Letter at a Time
I am thinking that I need to isolate the position of the specific letter, then create a new text element with that letter to animate then destroy. What do you guys think, is that the way to go? Is there a more efficient way? Cheers, Baz On Mon, Aug 31, 2009 at 10:56 AM, Baz li...@thinkloop.com wrote: Is it possible to apply an effect on a single letter in a textinput field? For example, when a letter gets typed (*change* effect), that letter expands and fades out. So if someone types a word, each letter of that word independently and sequentially expands and fades out as they are typed. Cheers.
Re: [flexcoders] Hierarchical Tree Data
Hey Wesley, when does the hierarchy get setup? Do you use an orm that builds and nests all objects - then, I guess, send that entire strucutre off to flex through remote object (amf). What do you get in flex, a nested ArrayCollection of objects, with a nested ArrayCollection of objects, indefinitely until all levels are fulfilled? Cheers, Baz On Sat, Aug 15, 2009 at 2:23 PM, Wesley Acheson wesley.ache...@gmail.comwrote: I usually do this at the server level. I collect all my data from the database and then I put it into objects. (I use java) Then I use Xstream to convert to XML if required. However usually I just use a remote object and bypass the XML stage. Regards, Wesley Acheson On Fri, Aug 14, 2009 at 10:25 PM, Baz li...@thinkloop.com wrote: How do you generally handle generating hierarchical tree data from a database. Lets say I had a query that returned *Name, ID, ParentID* with an indefinite number of nest levels, and I wanted to turn that into a nice xml structure - do you usually peform that transofrmation at the DB layer, the app layer, or is there perhaps an easy Flex function that can take care of that? The ideal function would take the query and ask for the id and parentid properties to use to recurse through the query, i.e. generateNestedXMLFromFlatQuery(QueryData, ID_ColumnName, ParentID_columnName):XML; Thoughts?
[flexcoders] Re: ItemRenderer Effects Virtualization
Perhaps its not possible due to the virtualization? On Thu, Aug 13, 2009 at 7:34 PM, Baz li...@thinkloop.com wrote: Is it possible to implement effects on virtualized itemrenderers? What about if the change in underlying data is based on an ArrayCollection filterFunction? Basically, I show/hide items based on keywords users type. I would like to fade the items in and out when they are shown/hidden. The show/hide is implemented using a filterFunction on my source ArrayCollection, so the data isn't actually being added/removed. Thoughts? Cheers, Baz
[flexcoders] Re: regex: keyword search
Here's the actual code, is it possible to replace this with one line of RegEx: var myBigText:String = 'This is sample text to be searched for the existence of all keywords anywhere in any order'; var keywords:Array = ['UserProvidedKeyword1', 'UserProvidedKeyword2', 'UserProvidedKeyword3']; var allKeywordsExist:Boolean = true; for(var i:int = 0; i keywords.length; i++) { var myRegEx:regEx = new RegExp('.*' + keyword[i] + '.*', 'i'); if(!myRegEx.test(myBigText)) { allKeywordsExist = false; break; } return allKeywordsExist; On Thu, Aug 13, 2009 at 6:30 PM, Baz li...@thinkloop.com wrote: Users provide keywords separated by spaces through an input box, and I would like to see if they all exist in a certain text. So for example if a user provides flex awesome or awesome flex they should both match the phrase flex is quite awesome. The following regex won't work because it is order dependent: .*keyword1.*keyword2.* Is there a way to tell the regex to search the entire string from the beginning for each keyword? Currently I am looping through each keyword and testing them separately - if all tests pass then I return true, but that seems wasteful. Thanks, Baz
[flexcoders] Hierarchical Tree Data
How do you generally handle generating hierarchical tree data from a database. Lets say I had a query that returned *Name, ID, ParentID* with an indefinite number of nest levels, and I wanted to turn that into a nice xml structure - do you usually peform that transofrmation at the DB layer, the app layer, or is there perhaps an easy Flex function that can take care of that? The ideal function would take the query and ask for the id and parentid properties to use to recurse through the query, i.e. generateNestedXMLFromFlatQuery(QueryData, ID_ColumnName, ParentID_columnName):XML; Thoughts?
[flexcoders] regex: keyword search
Users provide keywords separated by spaces through an input box, and I would like to see if they all exist in a certain text. So for example if a user provides flex awesome or awesome flex they should both match the phrase flex is quite awesome. The following regex won't work because it is order dependent: .*keyword1.*keyword2.* Is there a way to tell the regex to search the entire string from the beginning for each keyword? Currently I am looping through each keyword and testing them separately - if all tests pass then I return true, but that seems wasteful. Thanks, Baz
[flexcoders] ItemRenderer Effects Virtualization
Is it possible to implement effects on virtualized itemrenderers? What about if the change in underlying data is based on an ArrayCollection filterFunction? Basically, I show/hide items based on keywords users type. I would like to fade the items in and out when they are shown/hidden. The show/hide is implemented using a filterFunction on my source ArrayCollection, so the data isn't actually being added/removed. Thoughts? Cheers, Baz
[flexcoders] ItemRender - Access Specific Item at Run-time
I have a custom ItemRender that uses an ArrayCollection dataProvider. Everything loads up and displays nicely, but I am having a heck of a time finding out how to get at a specifc item in the list to change its state - something like myDataContainer.ItemArray[10].state = my_custom_state to get at the 10th item. Bear in mind its not the source ArrayCollection that I need to get at, that's no problem, its access to the components that get created from the ArrayCollection that I'm looking for. Is there a way? Thanks very much.
[flexcoders] Re: ItemRender - Access Specific Item at Run-time
I saw this info in another thread, and it makes sense, especially since I'm thinking of using virtualization: Renderers are virtual There's only as many renderers as you can see on screen plus one or two. If you have 1000 items and only see 8, there's only 8 to 10 renderers so indexToItemRenderer will return null for the other 992. It is better to simply iterate through the collection/dataprovider using So the question becomes, how do you change the state of a specific item? Should I add a column in my ArrayCollection called state and use that in the ItemRender? Cheers, Baz ICollectionView/IViewCursor or IList APIs On Wed, Aug 12, 2009 at 12:57 PM, Baz li...@thinkloop.com wrote: I have a custom ItemRender that uses an ArrayCollection dataProvider. Everything loads up and displays nicely, but I am having a heck of a time finding out how to get at a specifc item in the list to change its state - something like myDataContainer.ItemArray[10].state = my_custom_state to get at the 10th item. Bear in mind its not the source ArrayCollection that I need to get at, that's no problem, its access to the components that get created from the ArrayCollection that I'm looking for. Is there a way? Thanks very much.
Re: [flexcoders] ItemRender - Access Specific Item at Run-time
Thank you very much Tracy. What do you suggest to show/hide specific items based on an outside event? I am hesitant to *remove* the item from the ArrayCollection as I have to add it back at some point, maintaining the same complicated sort order. Currently my ArrayCollection contains a list of custom objects, would you suggest I had a property to those objects called *isHidden*, or something along those lines, and use that to set the state to hidden? Thanks a lot. On Wed, Aug 12, 2009 at 1:14 PM, Tracy Spratt tr...@nts3rd.com wrote: “access to the components that get created from the ArrayCollection… Is there a way?” Short answer, no. Longer answer: itemRenderers are recycled and only the visible renderers even exist. When using item renderers, any state that depends on the item/row must be driven by the item. You need to set up your renderer so that when an underlying item property changes, that change causes the rendered component’s state to change. You do this by overriding the set data() function and commitProperties function. Find an example of an itemRenderer and modify it rather than trying to do this from scratch. Tracy Spratt, Lariat Services, development services available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Wednesday, August 12, 2009 3:57 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] ItemRender - Access Specific Item at Run-time I have a custom ItemRender that uses an ArrayCollection dataProvider. Everything loads up and displays nicely, but I am having a heck of a time finding out how to get at a specifc item in the list to change its state - something like myDataContainer.ItemArray[10].state = my_custom_state to get at the 10th item. Bear in mind its not the source ArrayCollection that I need to get at, that's no problem, its access to the components that get created from the ArrayCollection that I'm looking for. Is there a way? Thanks very much.
Re: [flexcoders] ItemRender - Access Specific Item at Run-time
@Jake, I am implementing search-as-you-type, so there's a separate input box outside of the itemrender that needs to show/hide items that match or don't match what was typed in. I am using the *change* event of the search box. @Tracy, thanks for the suggestion, I tried that originally and it worked, but the experience was lacking because all items would disappear then re-appear on every key press. I would like for only the specific items affected to fade-out or fade-in when required. So far it seems adding an IsVisible property will work. When the input box *changes* I update the collection then invalidate the container's properties (or refresh the collection?). Depending on how that works out, I may or may not need to add commitProperties logic. Baz On Wed, Aug 12, 2009 at 1:45 PM, Tracy Spratt tr...@nts3rd.com wrote: To show/hide items, use a filter on the collection. It does not actually remove any items. Tracy Spratt, Lariat Services, development services available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Wednesday, August 12, 2009 4:21 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] ItemRender - Access Specific Item at Run-time Thank you very much Tracy. What do you suggest to show/hide specific items based on an outside event? I am hesitant to *remove* the item from the ArrayCollection as I have to add it back at some point, maintaining the same complicated sort order. Currently my ArrayCollection contains a list of custom objects, would you suggest I had a property to those objects called *isHidden*, or something along those lines, and use that to set the state to hidden? Thanks a lot. On Wed, Aug 12, 2009 at 1:14 PM, Tracy Spratt tr...@nts3rd.com wrote: “access to the components that get created from the ArrayCollection… Is there a way?” Short answer, no. Longer answer: itemRenderers are recycled and only the visible renderers even exist. When using item renderers, any state that depends on the item/row must be driven by the item. You need to set up your renderer so that when an underlying item property changes, that change causes the rendered component’s state to change. You do this by overriding the set data() function and commitProperties function. Find an example of an itemRenderer and modify it rather than trying to do this from scratch. Tracy Spratt, Lariat Services, development services available -- *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On Behalf Of *Baz *Sent:* Wednesday, August 12, 2009 3:57 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] ItemRender - Access Specific Item at Run-time I have a custom ItemRender that uses an ArrayCollection dataProvider. Everything loads up and displays nicely, but I am having a heck of a time finding out how to get at a specifc item in the list to change its state - something like myDataContainer.ItemArray[10].state = my_custom_state to get at the 10th item. Bear in mind its not the source ArrayCollection that I need to get at, that's no problem, its access to the components that get created from the ArrayCollection that I'm looking for. Is there a way? Thanks very much.