- Previous thread: [flexcoders] vert scroll fix for Satish T J's PivotComponent?
- Next thread: [flexcoders] Downloading nightly builds of the data visualization
- Threads sorted by date: flex 200909
Let me try rephrasing my earlier post and see if I can get a response:
I've got a RTE called outRTE into which I'm loading XML. I need to act cond=
itionally on the XML, so I've got to use a for-each-in loop to go through i=
t.=20
for each (var item:XML in xData.Content.P.*) {
var textToColor:String =3D item.toString();
outRTE.textArea.text +=3D item.toString();
var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
tr.color =3D "red";
}
I can see that the item data is coming in OK, but the coloring of the text =
just doesn't happen.=20
Can anyone see why?
Thanks,
David
I've got a RTE called outRTE into which I'm loading XML. I need to act cond=
itionally on the XML, so I've got to use a for-each-in loop to go through i=
t.=20
for each (var item:XML in xData.Content.P.*) {
var textToColor:String =3D item.toString();
outRTE.textArea.text +=3D item.toString();
var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
tr.color =3D "red";
}
I can see that the item data is coming in OK, but the coloring of the text =
just doesn't happen.=20
Can anyone see why?
Thanks,
David
Does this:
tr.color = "red";
work in general?
Tracy Spratt,
Lariat Services, development services available
_____
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of stldvd
Sent: Saturday, September 12, 2009 4:33 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Rich Text Editor and XML
Let me try rephrasing my earlier post and see if I can get a response:
I've got a RTE called outRTE into which I'm loading XML. I need to act
conditionally on the XML, so I've got to use a for-each-in loop to go
through it.
for each (var item:XML in xData.Content.P.*) {
var textToColor:String = item.toString();
outRTE.textArea.text += item.toString();
var tr:TextRange = new TextRange(outRTE,false, 2, 5);
tr.color = "red";
}
I can see that the item data is coming in OK, but the coloring of the text
just doesn't happen.
Can anyone see why?
Thanks,
David
tr.color = "red";
work in general?
Tracy Spratt,
Lariat Services, development services available
_____
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of stldvd
Sent: Saturday, September 12, 2009 4:33 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Rich Text Editor and XML
Let me try rephrasing my earlier post and see if I can get a response:
I've got a RTE called outRTE into which I'm loading XML. I need to act
conditionally on the XML, so I've got to use a for-each-in loop to go
through it.
for each (var item:XML in xData.Content.P.*) {
var textToColor:String = item.toString();
outRTE.textArea.text += item.toString();
var tr:TextRange = new TextRange(outRTE,false, 2, 5);
tr.color = "red";
}
I can see that the item data is coming in OK, but the coloring of the text
just doesn't happen.
Can anyone see why?
Thanks,
David
Yes. To make sure, I created a second button with a simple function which i=
sn't running in the loop. It works fine:
private function colorText():void
{
var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
tr.color =3D "red";
}
--- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
>
> Does this:
>=20
> tr.color =3D "red";
>=20
> work in general?
>=20
>=20=20
>=20
> Tracy Spratt,
>=20
> Lariat Services, development services available
>=20
> _____=20=20
>=20
> From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
> Behalf Of stldvd
> Sent: Saturday, September 12, 2009 4:33 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Rich Text Editor and XML
>=20
>=20=20
>=20
>=20=20=20
>=20
> Let me try rephrasing my earlier post and see if I can get a response:
>=20
> I've got a RTE called outRTE into which I'm loading XML. I need to act
> conditionally on the XML, so I've got to use a for-each-in loop to go
> through it.=20
>=20
> for each (var item:XML in xData.Content.P.*) {
>=20
> var textToColor:String =3D item.toString();
> outRTE.textArea.text +=3D item.toString();
> var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> tr.color =3D "red";
> }
>=20
> I can see that the item data is coming in OK, but the coloring of the tex=
t
> just doesn't happen.=20
>=20
> Can anyone see why?
>=20
> Thanks,
>=20
> David
>
sn't running in the loop. It works fine:
private function colorText():void
{
var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
tr.color =3D "red";
}
--- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
>
> Does this:
>=20
> tr.color =3D "red";
>=20
> work in general?
>=20
>=20=20
>=20
> Tracy Spratt,
>=20
> Lariat Services, development services available
>=20
> _____=20=20
>=20
> From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
> Behalf Of stldvd
> Sent: Saturday, September 12, 2009 4:33 PM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Rich Text Editor and XML
>=20
>=20=20
>=20
>=20=20=20
>=20
> Let me try rephrasing my earlier post and see if I can get a response:
>=20
> I've got a RTE called outRTE into which I'm loading XML. I need to act
> conditionally on the XML, so I've got to use a for-each-in loop to go
> through it.=20
>=20
> for each (var item:XML in xData.Content.P.*) {
>=20
> var textToColor:String =3D item.toString();
> outRTE.textArea.text +=3D item.toString();
> var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> tr.color =3D "red";
> }
>=20
> I can see that the item data is coming in OK, but the coloring of the tex=
t
> just doesn't happen.=20
>=20
> Can anyone see why?
>=20
> Thanks,
>=20
> David
>
There's something else that's very strange. Before I enter the loop, I try =
to set the text in the rte to the empty string (before I enter the loop, th=
ere is text in there, so I want to clear it out). I put a break point just =
after that code, and it isn't working. I tried all the following, and none =
worked.
outRTE.textArea.text =3D "";=20
outRTE.text =3D "";
outRTE.text =3D null;
Is there something about clearing the text in an RTE control that I don't k=
now?
--- In flexcoders@yahoogroups.com, "stldvd" wrote:
>
> Yes. To make sure, I created a second button with a simple function which=
isn't running in the loop. It works fine:
>=20
> private function colorText():void
> {
> var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
> tr.color =3D "red";
> }
>=20
>=20
>=20
>=20
> --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
> >
> > Does this:
> >=20
> > tr.color =3D "red";
> >=20
> > work in general?
> >=20
> >=20=20
> >=20
> > Tracy Spratt,
> >=20
> > Lariat Services, development services available
> >=20
> > _____=20=20
> >=20
> > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
> > Behalf Of stldvd
> > Sent: Saturday, September 12, 2009 4:33 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Rich Text Editor and XML
> >=20
> >=20=20
> >=20
> >=20=20=20
> >=20
> > Let me try rephrasing my earlier post and see if I can get a response:
> >=20
> > I've got a RTE called outRTE into which I'm loading XML. I need to act
> > conditionally on the XML, so I've got to use a for-each-in loop to go
> > through it.=20
> >=20
> > for each (var item:XML in xData.Content.P.*) {
> >=20
> > var textToColor:String =3D item.toString();
> > outRTE.textArea.text +=3D item.toString();
> > var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> > tr.color =3D "red";
> > }
> >=20
> > I can see that the item data is coming in OK, but the coloring of the t=
ext
> > just doesn't happen.=20
> >=20
> > Can anyone see why?
> >=20
> > Thanks,
> >=20
> > David
> >
>
to set the text in the rte to the empty string (before I enter the loop, th=
ere is text in there, so I want to clear it out). I put a break point just =
after that code, and it isn't working. I tried all the following, and none =
worked.
outRTE.textArea.text =3D "";=20
outRTE.text =3D "";
outRTE.text =3D null;
Is there something about clearing the text in an RTE control that I don't k=
now?
--- In flexcoders@yahoogroups.com, "stldvd" wrote:
>
> Yes. To make sure, I created a second button with a simple function which=
isn't running in the loop. It works fine:
>=20
> private function colorText():void
> {
> var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
> tr.color =3D "red";
> }
>=20
>=20
>=20
>=20
> --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
> >
> > Does this:
> >=20
> > tr.color =3D "red";
> >=20
> > work in general?
> >=20
> >=20=20
> >=20
> > Tracy Spratt,
> >=20
> > Lariat Services, development services available
> >=20
> > _____=20=20
> >=20
> > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
> > Behalf Of stldvd
> > Sent: Saturday, September 12, 2009 4:33 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Rich Text Editor and XML
> >=20
> >=20=20
> >=20
> >=20=20=20
> >=20
> > Let me try rephrasing my earlier post and see if I can get a response:
> >=20
> > I've got a RTE called outRTE into which I'm loading XML. I need to act
> > conditionally on the XML, so I've got to use a for-each-in loop to go
> > through it.=20
> >=20
> > for each (var item:XML in xData.Content.P.*) {
> >=20
> > var textToColor:String =3D item.toString();
> > outRTE.textArea.text +=3D item.toString();
> > var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> > tr.color =3D "red";
> > }
> >=20
> > I can see that the item data is coming in OK, but the coloring of the t=
ext
> > just doesn't happen.=20
> >=20
> > Can anyone see why?
> >=20
> > Thanks,
> >=20
> > David
> >
>
Here's modified code showing the XML, what I'm trying to achieve, and what =
I'm getting. Can anyone see what's going on here?
If in the outRTE control you insert text=3D"{xData.toString()}" then you ge=
t the bizarre behavior I referred to in my last post (setting text to the e=
mpty string doesn't work).
Code:
test.xml):
The quick brown=20
fox jumps over the lazy=
dog.
Now is the time for all good men to come to the a=
id of their country.
=09
--- In flexcoders@yahoogroups.com, "stldvd" wrote:
>
> There's something else that's very strange. Before I enter the loop, I tr=
y to set the text in the rte to the empty string (before I enter the loop, =
there is text in there, so I want to clear it out). I put a break point jus=
t after that code, and it isn't working. I tried all the following, and non=
e worked.
>=20
> outRTE.textArea.text =3D "";=20
> outRTE.text =3D "";
> outRTE.text =3D null;
>=20
> Is there something about clearing the text in an RTE control that I don't=
know?
>=20
>=20
> --- In flexcoders@yahoogroups.com, "stldvd" wrote:
> >
> > Yes. To make sure, I created a second button with a simple function whi=
ch isn't running in the loop. It works fine:
> >=20
> > private function colorText():void
> > {
> > var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
> > tr.color =3D "red";
> > }
> >=20
> >=20
> >=20
> >=20
> > --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
> > >
> > > Does this:
> > >=20
> > > tr.color =3D "red";
> > >=20
> > > work in general?
> > >=20
> > >=20=20
> > >=20
> > > Tracy Spratt,
> > >=20
> > > Lariat Services, development services available
> > >=20
> > > _____=20=20
> > >=20
> > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] =
On
> > > Behalf Of stldvd
> > > Sent: Saturday, September 12, 2009 4:33 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Rich Text Editor and XML
> > >=20
> > >=20=20
> > >=20
> > >=20=20=20
> > >=20
> > > Let me try rephrasing my earlier post and see if I can get a response=
:
> > >=20
> > > I've got a RTE called outRTE into which I'm loading XML. I need to ac=
t
> > > conditionally on the XML, so I've got to use a for-each-in loop to go
> > > through it.=20
> > >=20
> > > for each (var item:XML in xData.Content.P.*) {
> > >=20
> > > var textToColor:String =3D item.toString();
> > > outRTE.textArea.text +=3D item.toString();
> > > var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> > > tr.color =3D "red";
> > > }
> > >=20
> > > I can see that the item data is coming in OK, but the coloring of the=
text
> > > just doesn't happen.=20
> > >=20
> > > Can anyone see why?
> > >=20
> > > Thanks,
> > >=20
> > > David
> > >
> >
>
I'm getting. Can anyone see what's going on here?
If in the outRTE control you insert text=3D"{xData.toString()}" then you ge=
t the bizarre behavior I referred to in my last post (setting text to the e=
mpty string doesn't work).
Code:
test.xml):
The quick brown=20
fox jumps over the lazy=
dog.
Now is the time for all good men to come to the a=
id of their country.
=09
--- In flexcoders@yahoogroups.com, "stldvd" wrote:
>
> There's something else that's very strange. Before I enter the loop, I tr=
y to set the text in the rte to the empty string (before I enter the loop, =
there is text in there, so I want to clear it out). I put a break point jus=
t after that code, and it isn't working. I tried all the following, and non=
e worked.
>=20
> outRTE.textArea.text =3D "";=20
> outRTE.text =3D "";
> outRTE.text =3D null;
>=20
> Is there something about clearing the text in an RTE control that I don't=
know?
>=20
>=20
> --- In flexcoders@yahoogroups.com, "stldvd" wrote:
> >
> > Yes. To make sure, I created a second button with a simple function whi=
ch isn't running in the loop. It works fine:
> >=20
> > private function colorText():void
> > {
> > var tr:TextRange =3D new TextRange(outRTE,false, 2, 20);
> > tr.color =3D "red";
> > }
> >=20
> >=20
> >=20
> >=20
> > --- In flexcoders@yahoogroups.com, "Tracy Spratt" wrote:
> > >
> > > Does this:
> > >=20
> > > tr.color =3D "red";
> > >=20
> > > work in general?
> > >=20
> > >=20=20
> > >=20
> > > Tracy Spratt,
> > >=20
> > > Lariat Services, development services available
> > >=20
> > > _____=20=20
> > >=20
> > > From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] =
On
> > > Behalf Of stldvd
> > > Sent: Saturday, September 12, 2009 4:33 PM
> > > To: flexcoders@yahoogroups.com
> > > Subject: [flexcoders] Rich Text Editor and XML
> > >=20
> > >=20=20
> > >=20
> > >=20=20=20
> > >=20
> > > Let me try rephrasing my earlier post and see if I can get a response=
:
> > >=20
> > > I've got a RTE called outRTE into which I'm loading XML. I need to ac=
t
> > > conditionally on the XML, so I've got to use a for-each-in loop to go
> > > through it.=20
> > >=20
> > > for each (var item:XML in xData.Content.P.*) {
> > >=20
> > > var textToColor:String =3D item.toString();
> > > outRTE.textArea.text +=3D item.toString();
> > > var tr:TextRange =3D new TextRange(outRTE,false, 2, 5);
> > > tr.color =3D "red";
> > > }
> > >=20
> > > I can see that the item data is coming in OK, but the coloring of the=
text
> > > just doesn't happen.=20
> > >=20
> > > Can anyone see why?
> > >=20
> > > Thanks,
> > >=20
> > > David
> > >
> >
>