I don't know about DHTML. But this was the only workaround that I could find for the Flash runtime. It would be nice to make an extension class of LzText that encapsulates this though, for people to use.
On Mon, Apr 14, 2008 at 5:53 PM, Greg Denton <[EMAIL PROTECTED]> wrote: > Looks interesting. A couple of questions, though: (1) will this work > with dhtml? (2) seems like the simplest UI would be: swap the fg/bg > colors for the selected chars, wouldn't it be best to build that into > the system, or allow some way to configure it explicitly? > > Do the css style sheets affect edittext at all? If so, is there a way > of specifying all 4 colors that way? > > Thanks. > > On Mon, Apr 14, 2008 at 2:42 PM, Henry Minsky <[EMAIL PROTECTED]> > wrote: > > There is an article I found which suggests a workaround using color > > transforms > > > > http://www.digitalflipbook.com/archives/flash/ > > > > Something like this may work. It is following the idea in the article, > > to basically invert the color transform on the > > movieclip containing the text field, and then set the text foreground > > and background color to the inverse of what you want. > > > > I just did this by experimenting with black and white, ideally you > > would use something based on their > > approach of actually inverting the colors using the color transform > based > > on the > > foreground and bgcolor of the textfield that you desire. > > > > > > <canvas> > > <simplelayout axis="y"/> > > <class name="myinputtext" extends="inputtext" > > > <handler name="oninit"> > > var field = this.sprite.__LZtextclip; > > field.backgroundColor = 0xffffff; > > field.textColor = 0x000000; > > > > // invert the color transform for the sprite > > var colorTrans = { > > ra: -100,// is the percentage for the red component (-100 > to > > 100). > > rb: 0xd3,// is the offset for the red component (-255 to > 255). > > ga: -100, // is the percentage for the green component > > (-100 to 100). > > gb: 0xd3, // is the offset for the green component (-255 to > > 255). > > ba: -100,// is the percentage for the blue component (-100 > to > > 100). > > bb: 0xd3,// is the offset for the blue component (-255 to > 255). > > aa: 100,// is the percentage for alpha (-100 to 100). > > ab: 0 // is the offset for alpha (-255 to 255). > > }; > > this.sprite.setColorTransform > > (colorTrans); > > </handler> > > </class> > > <myinputtext name="field" width="300" fgcolor="0xFFFFFF" > > bgcolor="0x000000" height="30" fontsize="13">Is this selection > > visible?</myinputtext> > > <myinputtext name="field2" width="300" fgcolor="0x999999" > > bgcolor="0x333333" height="30" fontsize="13">Is this selection > > visible?</myinputtext> > > > > > > </canvas> > > > > > > On Mon, Apr 14, 2008 at 5:02 PM, Greg Denton <[EMAIL PROTECTED]> > wrote: > > > > > > > My app changes the color of text depending on what the text is. When > > > it changes to a lighter shade of gray (via setColor) the hiliting, or > > > whatever the background color is called when chars are selected, is > > > automatically changed to the same gray and completely masks the text. > > > Can't figure out how to fix this. And, the textselectedcolor, > > > texthilitecolor in the component styles don't seem to work with > > > edittext. Running on 4.0.11. Thanks for any tips. > > > > > > > > > > > > > -- > > Henry Minsky > > Software Architect > > [EMAIL PROTECTED] > > > > > -- Henry Minsky Software Architect [EMAIL PROTECTED]
