Re: [SPAM] [flexcoders] Animating items in a tilelist when filtering arraycollection

2010-02-13 Thread ZIONIST
Hi Valdhor, i have sent a new stand alone app to you email 
valdhorli...@embarqmail.com that does not require any application server and 
database, just uses xml to store data. hope you can work around with this one. 



Re: [SPAM] [flexcoders] Animating items in a tilelist when filtering arraycollection [1 Attachment]

2010-02-13 Thread amanyire arthur
Ok managed to make it a stand alone. does not require any application server. 
just uses xml for data. hope this is what you meant.


 



  











  

Re: [flexcoders] I need a recommendation of an actionscript 3 book for Flex

2010-02-13 Thread Erik de Bruin
Hi Fred,

I would start with 'Essential ActionScript 3.0' from (Colin Moock, O'Reilly)
and follow that up with 'Advanced ActionScript 3.0 with Design Patterns
(Joey Lott and Danny Patterson, Adobe Press).

These should put you solidly on the road to AS3 greatness :-)

Regards,

EdB

On Sat, Feb 13, 2010 at 8:43 AM, fred44455 fred44...@yahoo.com wrote:



 All the books that I checked are AS3 books for Flash. Where can I find a
 book for AS3 for Flex 3(4). Or maybe all the Flex 3 books explain AS3 and I
 don't need them? But I would like to know AS3 very well as most Flex 3 books
 don't spend much time going into details about AS3. What are your
 recommendations to learn AS3 for Flex?

 Thank you for your time guys.

 Fred.

  




-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl


Re: [flexcoders] Re: Null pointer exceptions in call from Flex

2010-02-13 Thread Tom McNeer
Hi,


On Fri, Feb 12, 2010 at 7:20 PM, Flex myflexdownlo...@gmail.com wrote:

  So, it seems some combination of this data is not loved by the
 CFASSerializer in the AMF gateway.


Yes, but ... the inconsistency goes deep. The same method, with the same
parameters, can be called within less than a second with different results.
In one case, the NullPointerException occurs. In the other, the gateway
returns data correctly.

So the data going in both directions can be exactly the same. But in only
one case does the serializer cause an error. I've experimented with a
variety of data combinations. But as I say, the results are inconsistent,
even with the same data being serialized in both directions.

So it doesn't seem to be a data issue - unless something at a deeper level,
beyond the application code or the data that is actually sent from Flex or
that exists in the database, is actually corrupting or not returning the
data correctly. Basically, something inside CF.

Perhaps someone else might have seen this?

-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560


Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Amy


--- In flexcoders@yahoogroups.com, Mike msl...@... wrote:

 I must take the DataGrid as I find it.  If no labelFunction is defined, that 
 approach won't work; also each item in the dataProvider might be manifested 
 in 0 or more columns.  This approach probably won't be general enough.

Do you have enough control in the project to ask that the Value Objects in the 
DataProvider implement a common interface?  Then just have a getter defined by 
the interface that says what the rendered row should look like.

I haven't had good luck instantiating renderers by hand, especially ones that 
fully implement IDropInListItemRenderer, and you're goingto run into several 
problems trying to do this:

1) Performance: Creating an object is usually the biggest processor hit.  
Multiply this across multiple columns, and you are likely to have a slowdown.
2) Timing: It's not like you can just create the renderers and immediately 
start reading through them for text.  You'll need to wait until everthing is 
complete and all the properties are set, so you're going to have to pass things 
back and forth between multiple event handlers.
3) Depth: Since you have no control over the renderers, you don't have any way 
of knowing whether they're composed of containers within containers, etc.
4) Layout: Presumably, you want to have the text appear in the same order it 
appears in the columns, and then within the individual renderers.  There's no 
guarantee that your iteration will go from top left to bottom right, so you'll 
have to record where the text was found and then arrange it in some way that 
tries to make sense (but may not, depending on what is going on in the 
renderers).
5) Random surprises from the renderer developers.  If the renderer developer 
makes a reference to its parent, owner, or something else like that and you 
instantiate it in a way that doesn't involve a List of some sort, you may wind 
up with Null Pointer Exceptions.  They may come up with other stuff that won't 
come up in your testing with reasonable renderers that you wrote, but it will 
be your fault when they do something stupid and YOUR logic errors out.

In short, you have to work together with your other team members one way or 
another to make this work.  Why not just shortcut to the most performant method?

-Amy



[flexcoders] Re: AdvancedDataGrid Grouping with XML

2010-02-13 Thread Amy


--- In flexcoders@yahoogroups.com, srieger_1 srie...@... wrote:

 OK, I have made some progress on this issue but still unable to resolve it 
 completely.  It's getting embarrassing already. . . .  I am trying to use 
 some XML that I get from an application to feed an advanceddatagrid where I 
 can group the entries.
 
  
 
 I have a demo with view source here :  
 http://estar.lmsnet.com/lmsdev/testgrouping.html
 
  
 
 I am trying to group the entries by Category then display the path and file 
 name when the category is expanded. I cannot believe I can't figure this out. 
  I am hoping there are some XML folks out there that can offer some advice .

I think you'll need to use a groupingFunction to group on 

.attribute('name').child('text').text()=='Category'

(Sorry, for some reason my blog doesn't email me these days when I get a 
comment.)

HTH;

Amy





Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Mike
I have no control over the dataProvider at all.  Performance is not an issue, 
because the data extraction only happens once, and it can be time-sliced it so 
the webapp does not appear to freeze.  Passing through multiple event handlers, 
including EnterFrame would be perfectly acceptable.

 3) Depth: Since you have no control over the renderers, you don't have any 
 way of knowing whether they're composed of containers within containers, etc.
True.  The routine needs to deal with that.

 4) Layout: Presumably, you want to have the text appear in the same order it 
 appears in the columns, and then within the individual renderers.  There's no 
 guarantee that your iteration will go from top left to bottom right, so 
 you'll have to record where the text was found and then arrange it in some 
 way that tries to make sense (but may not, depending on what is going on in 
 the renderers).
Yes, doing this right will be a lot of work.

 5) Random surprises from the renderer developers.  If the renderer developer 
 makes a reference to its parent, owner, or something else like that and you 
 instantiate it in a way that doesn't involve a List of some sort, you may 
 wind up with Null Pointer Exceptions.  They may come up with other stuff that 
 won't come up in your testing with reasonable renderers that you wrote, but 
 it will be your fault when they do something stupid and YOUR logic errors out.
Yep, that is true.

 In short, you have to work together with your other team members one way or 
 another to make this work.  
There are no other team members.  This is a library routine.  I want this to be 
as general as possible, and am prepared to do what it takes to make it work 
properly.

 Why not just shortcut to the most performant method?
Performance is not important, general utility is important.  The library 
feature should just work, no excuses.



RE: [SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Tracy Spratt
If you can get what you need easily from a rendered renderer, then it
sounds like the hidden DG with all of the rows rendered might be the way to
go.

 

Tracy Spratt,

Lariat Services, development services available

  _  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Mike
Sent: Saturday, February 13, 2010 2:10 PM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a
DataGrid

 

  

I have no control over the dataProvider at all. Performance is not an issue,
because the data extraction only happens once, and it can be time-sliced it
so the webapp does not appear to freeze. Passing through multiple event
handlers, including EnterFrame would be perfectly acceptable.

 3) Depth: Since you have no control over the renderers, you don't have any
way of knowing whether they're composed of containers within containers,
etc.
True. The routine needs to deal with that.

 4) Layout: Presumably, you want to have the text appear in the same order
it appears in the columns, and then within the individual renderers. There's
no guarantee that your iteration will go from top left to bottom right, so
you'll have to record where the text was found and then arrange it in some
way that tries to make sense (but may not, depending on what is going on in
the renderers).
Yes, doing this right will be a lot of work.

 5) Random surprises from the renderer developers. If the renderer
developer makes a reference to its parent, owner, or something else like
that and you instantiate it in a way that doesn't involve a List of some
sort, you may wind up with Null Pointer Exceptions. They may come up with
other stuff that won't come up in your testing with reasonable renderers
that you wrote, but it will be your fault when they do something stupid and
YOUR logic errors out.
Yep, that is true.

 In short, you have to work together with your other team members one way
or another to make this work. 
There are no other team members. This is a library routine. I want this to
be as general as possible, and am prepared to do what it takes to make it
work properly.

 Why not just shortcut to the most performant method?
Performance is not important, general utility is important. The library
feature should just work, no excuses.





[flexcoders] Twitter Feed Within An Air/Flex Application

2010-02-13 Thread James
I've previously made an air application for my university course and my tutor 
has suggested that I incorporate more live data into it. One of the ways he 
suggested was to include a twitter feed. I have no experience of using feeds 
within flex but I think I've managed to get one in.

How it works is when users type in their twitter id and click a load button all 
of their tweets are displayed within a repeater component. They can then click 
a save button to save their twitter id and whenever they start the application 
in the future their tweets will load into the repeater component automatically 
as long as their name has been saved.

This may seem like silly question but does what I've described constitute a 
'live twitter feed' which is what I've been asked to include or am I missing 
something?



[flexcoders] Re: Twitter Feed Within An Air/Flex Application

2010-02-13 Thread turbo_vb
Hi James,

If your application automatically displays new tweets, those created after the 
initial load, than yes; that would be considered live.  If however its just 
taking a snapshot, then no.  A starting point would be to refresh the tweets. 
 Having the ability to post tweets, and see them instantly show up, would also 
make it more live.  Other ideas would be IM, chat, or other real-time 
activities that involve the course; like live test scoring, or something.

-TH

--- In flexcoders@yahoogroups.com, James garymoorcroft_...@... wrote:

 I've previously made an air application for my university course and my tutor 
 has suggested that I incorporate more live data into it. One of the ways he 
 suggested was to include a twitter feed. I have no experience of using feeds 
 within flex but I think I've managed to get one in.
 
 How it works is when users type in their twitter id and click a load button 
 all of their tweets are displayed within a repeater component. They can then 
 click a save button to save their twitter id and whenever they start the 
 application in the future their tweets will load into the repeater component 
 automatically as long as their name has been saved.
 
 This may seem like silly question but does what I've described constitute a 
 'live twitter feed' which is what I've been asked to include or am I missing 
 something?





[flexcoders] Need Help With an App Which Produces Live Images

2010-02-13 Thread James
At the moment I have an application which is meant to produce live thumbnail 
images of websites. Currently how it does this is a html component (myhtml) 
loads websites via it's location property changing from website to website and 
upon fully loading of each site a snapshot is taken of the html component and 
saved as a bitmap and applied as the source of an image corresponding to that 
particular site (abcnewsimage and bbcnewsimage). However I now need to insert 
these snapshots within the 'icon' properties of 2 array collections 
(myTilelistAArrayCollection and myTilelistBArrayCollection) which act as 
dataproviders to populate 2 tilelists (mtTilelistA and myTilelistB).

Basically I need the same images to appear automatically within the tilelists 
the way they do in the 2 images as the snapshots are taken by applying the same 
bitmaps into the currently empty 'icon' properties of the 2 tilelists i.e. the 
icon of the ABC News Item of both array collections must be the same as the 
abcnewsimage and appear as it appears and the same for the BBC News Item icon 
being the same as the bbcnewsimage picture as that appears.

It should look like the images aare appearing in the tilelist at the same time 
as they are appearing in the regular images. What will I need to ut into the 
icon properties to do this?

I hope this makes sense and if anyone can help me out it would be much 
appreciated. :-)

?xml version=1.0 encoding=utf-8?
mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml; 
layout=absolute verticalAlign=middle backgroundColor=white width=1024 
height=768

mx:Script
![CDATA[
import mx.graphics.ImageSnapshot;
import mx.collections.*;

private function takeSnapshot(event:Event) :void
{
var imageBitmapData:BitmapData = 
ImageSnapshot.captureBitmapData(myhtml) ;
switch(myhtml.location)
{
case http://abcnews.go.com/:
abcnewsimage.source = new Bitmap(imageBitmapData);
myhtml.location = http://news.bbc.co.uk/;;
break;
case http://news.bbc.co.uk/:
bbcnewsimage.source = new Bitmap(imageBitmapData);
break;
}
}

  private var myTilelistAArrayCollection:ArrayCollection = new 
ArrayCollection([
{id:ABC New Item, label:ABCNews, icon:},
{id:BBC News Item, label:BBC News, icon:}
 ]);
 
  private var myTilelistBArrayCollection:ArrayCollection = new 
ArrayCollection([
{id:ABC News Item, label:ABCNews, icon:},
{id:BBC News Item, label:BBC News, icon:}
 ]); 

]]
/mx:Script

mx:HBox x=10 y=10
mx:Image id=abcnewsimage width=100 height=100 
scaleContent=true/
mx:Image id=bbcnewsimage width=100 height=100 
scaleContent=true/
/mx:HBox

mx:HTML id=myhtml location=http://abcnews.com/; 
complete=takeSnapshot(event) width=250 height=250 
horizontalScrollPolicy=off verticalScrollPolicy=off  x=10 y=118/
 
mx:TileList x=268 y=118 width=294 height=250 id=myTilelistA 
dataProvider={myTilelistAArrayCollection} rowHeight=100 columnWidth=100/
 
mx:TileList x=570 y=118 width=294 height=250 id=myTilelistB 
dataProvider={myTilelistBArrayCollection} rowHeight=100 columnWidth=100/

/mx:WindowedApplication



[flexcoders] Re: Twitter Feed Within An Air/Flex Application

2010-02-13 Thread James
But is it possible within flex to have a feed that acts live such as this i.e. 
it is constantly changing? I thought within flex you could only load data upon 
some sort of event such as the click of a button?

The user can refresh their tweets simply by clicking the load tweets button 
again but may it be better to have a refresh function constantly running and 
refreshing the feed every couple of seconds to keep it essentially 'live'? I 
thought something like this would take up memory/loading times though.

The ability to post tweets to twitter from within an app does sound like a 
great idea though. I wouldn't know where to start on this though. Do you know 
of any examples on the net that show this being done that I could implement 
into my own?

Cheers for your help though. These are good ideas.

--- In flexcoders@yahoogroups.com, turbo_vb timh...@... wrote:

 Hi James,
 
 If your application automatically displays new tweets, those created after 
 the initial load, than yes; that would be considered live.  If however its 
 just taking a snapshot, then no.  A starting point would be to refresh the 
 tweets.  Having the ability to post tweets, and see them instantly show up, 
 would also make it more live.  Other ideas would be IM, chat, or other 
 real-time activities that involve the course; like live test scoring, or 
 something.
 
 -TH
 
 --- In flexcoders@yahoogroups.com, James garymoorcroft_ict@ wrote:
 
  I've previously made an air application for my university course and my 
  tutor has suggested that I incorporate more live data into it. One of the 
  ways he suggested was to include a twitter feed. I have no experience of 
  using feeds within flex but I think I've managed to get one in.
  
  How it works is when users type in their twitter id and click a load button 
  all of their tweets are displayed within a repeater component. They can 
  then click a save button to save their twitter id and whenever they start 
  the application in the future their tweets will load into the repeater 
  component automatically as long as their name has been saved.
  
  This may seem like silly question but does what I've described constitute a 
  'live twitter feed' which is what I've been asked to include or am I 
  missing something?
 





[flexcoders] Re: Twitter Feed Within An Air/Flex Application

2010-02-13 Thread turbo_vb
Polling the twitter service every 60 seconds (refresh) would be a way
that you could get updates semi-automatically.  You're not using RTMP,
so you're never going to be really live.   HTTPService calls are
asynchronous, so there isn't much overhead just listening to a Timer().
For extending the functionality, here's a couple links.
http://blogs.adobe.com/flexdoc/2009/03/simple_twitter_client_in_flex.htm
http://blogs.adobe.com/flexdoc/2009/03/simple_twitter_client_in_flex.ht\
ml  l http://apiwiki.twitter.com/Twitter-API-Documentation
http://apiwiki.twitter.com/Twitter-API-Documentation
-TH

--- In flexcoders@yahoogroups.com, James garymoorcroft_...@...
wrote:

 But is it possible within flex to have a feed that acts live such as
this i.e. it is constantly changing? I thought within flex you could
only load data upon some sort of event such as the click of a button?

 The user can refresh their tweets simply by clicking the load tweets
button again but may it be better to have a refresh function constantly
running and refreshing the feed every couple of seconds to keep it
essentially 'live'? I thought something like this would take up
memory/loading times though.

 The ability to post tweets to twitter from within an app does sound
like a great idea though. I wouldn't know where to start on this though.
Do you know of any examples on the net that show this being done that I
could implement into my own?

 Cheers for your help though. These are good ideas.

 --- In flexcoders@yahoogroups.com, turbo_vb TimHoff@ wrote:
 
  Hi James,
 
  If your application automatically displays new tweets, those created
after the initial load, than yes; that would be considered live.  If
however its just taking a snapshot, then no.  A starting point would be
to refresh the tweets.  Having the ability to post tweets, and see
them instantly show up, would also make it more live.  Other ideas would
be IM, chat, or other real-time activities that involve the course; like
live test scoring, or something.
 
  -TH
 
  --- In flexcoders@yahoogroups.com, James garymoorcroft_ict@
wrote:
  
   I've previously made an air application for my university course
and my tutor has suggested that I incorporate more live data into it.
One of the ways he suggested was to include a twitter feed. I have no
experience of using feeds within flex but I think I've managed to get
one in.
  
   How it works is when users type in their twitter id and click a
load button all of their tweets are displayed within a repeater
component. They can then click a save button to save their twitter id
and whenever they start the application in the future their tweets will
load into the repeater component automatically as long as their name has
been saved.
  
   This may seem like silly question but does what I've described
constitute a 'live twitter feed' which is what I've been asked to
include or am I missing something?
  
 




Re: [SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Alex Harui
Except the memory implications of rendering every row must be considered.

And I still haven’t figured out what you’d do for renderers that don’t display 
any text.

And I’m pretty sure I could write a renderer that you could never figure out 
which children have text.

But given all that, then start copying code from DataGridBase.as.  
CreateColumnItemRenderer, setupItemRenderer and some calls to validateNow 
should get the renderer in its “final state”, and code in FocusManager, 
addFocusables walks children in the two known ways of figuring out your 
children.  If you run into TextFields, pull their text or htmlText and if you 
run into TextLines  Not sure what you’ll do there.


On 2/13/10 11:22 AM, Tracy Spratt tr...@nts3rd.com wrote:






If you can get what you need easily from a “rendered” renderer, then it sounds 
like the hidden DG with all of the rows rendered might be the way to go.


Tracy Spratt,
Lariat Services, development services available



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mike
Sent: Saturday, February 13, 2010 2:10 PM
To: flexcoders@yahoogroups.com
Subject: [SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid



I have no control over the dataProvider at all. Performance is not an issue, 
because the data extraction only happens once, and it can be time-sliced it so 
the webapp does not appear to freeze. Passing through multiple event handlers, 
including EnterFrame would be perfectly acceptable.

 3) Depth: Since you have no control over the renderers, you don't have any 
 way of knowing whether they're composed of containers within containers, etc.
True. The routine needs to deal with that.

 4) Layout: Presumably, you want to have the text appear in the same order it 
 appears in the columns, and then within the individual renderers. There's no 
 guarantee that your iteration will go from top left to bottom right, so 
 you'll have to record where the text was found and then arrange it in some 
 way that tries to make sense (but may not, depending on what is going on in 
 the renderers).
Yes, doing this right will be a lot of work.

 5) Random surprises from the renderer developers. If the renderer developer 
 makes a reference to its parent, owner, or something else like that and you 
 instantiate it in a way that doesn't involve a List of some sort, you may 
 wind up with Null Pointer Exceptions. They may come up with other stuff that 
 won't come up in your testing with reasonable renderers that you wrote, but 
 it will be your fault when they do something stupid and YOUR logic errors out.
Yep, that is true.

 In short, you have to work together with your other team members one way or 
 another to make this work.
There are no other team members. This is a library routine. I want this to be 
as general as possible, and am prepared to do what it takes to make it work 
properly.

 Why not just shortcut to the most performant method?
Performance is not important, general utility is important. The library feature 
should just work, no excuses.






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui


[SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Mike
Because this is an library for exporting to other formats I only need to 
instantiate one renderer at a time.  Memory requirements should therefore be 
modest.

I have implemented a mechanism to export the display lists of non-text item 
renderers.  The tricky part is learning how to instantiate any type of renderer 
on demand.  Hopefully constructive suggestions will be forthcoming soon.

Mike


--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Except the memory implications of rendering every row must be considered.
 
 And I still haven't figured out what you'd do for renderers that don't 
 display any text.
 
 And I'm pretty sure I could write a renderer that you could never figure out 
 which children have text.
 
 But given all that, then start copying code from DataGridBase.as.  
 CreateColumnItemRenderer, setupItemRenderer and some calls to validateNow 
 should get the renderer in its final state, and code in FocusManager, 
 addFocusables walks children in the two known ways of figuring out your 
 children.  If you run into TextFields, pull their text or htmlText and if you 
 run into TextLines  Not sure what you'll do there.




[flexcoders] Wrap multiple link buttons in datagridcolumn

2010-02-13 Thread aramsdell2000
How would you go about wrapping multiple link buttons in a datagridcolumn?  I 
have an itemrenderer mxml hbox for that column with a repeater for generating 
multiple linkbuttons based on a xml results set. The number of linkbuttons 
varies so I was thinking I could fix the datagridcolumn width (say three button 
widths-wide) and then somehow based on that width, wrap the remaining 4+ 
buttons  to a new line. Not sure if this can be done with an HBox. If it can't 
be done the way I have started it, what is the best way to approach?

Thanks!
Amy



[flexcoders] Multiple conditions in a case (switch/case)

2010-02-13 Thread Wally Kolcz
I feel stupid for not knowing this, but I guess its never come up. How 
do you do multiple conditions on a case statement in a switch. I am 
trying to figure out age so the case says something like 'case kids || 
siblings'. Doesn't seem to be working.



[flexcoders] Re: Multiple conditions in a case (switch/case)

2010-02-13 Thread Jeff
Syntax is something like:

case kids:
case Siblings:
 // do kid / sibling stuff
 break;
case something else

 It confused me the first time I saw it. 

--- In flexcoders@yahoogroups.com, Wally Kolcz wko...@... wrote:

 I feel stupid for not knowing this, but I guess its never come up. How 
 do you do multiple conditions on a case statement in a switch. I am 
 trying to figure out age so the case says something like 'case kids || 
 siblings'. Doesn't seem to be working.





[flexcoders] Re: dynamically loading cssStyle text into Application?

2010-02-13 Thread vipinck
Hi Valdhor,

I was doing the same thing for dynamic styling using an xml style file.  I am 
successful except applying skin files to components. I was trying to keep an 
image inside an FLA and give linkage properties (which extends BitmapData 
class) and load it at runtime. And based on the linkage name specified in the 
XML file, tried getDefinition(name). Got an error which said 'Argument count 
mismatch on TickMark(). Expected 2, got 0.'

Can we load a dynamic image or swf like this, so that I can skin components too 
with XML and resource file instead of pre-compiled skin swfs. I have specific 
need for this, and cant do the CSS/compiled CSS skinning.

Thanks for any help you can offer.

Best regards,
Vipin 

--- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote:

 parseCSS only works for text fields (See
 http://livedocs.adobe.com/flex/3/langref/flash/text/StyleSheet.html)
 
 You will need to parse the string yourself and apply styles as required.
 
 One of the bigger problems are that some styles require strings, others
 require numbers and some even require arrays.
 
 I came up with the following code to demonstrate (You can extend it to
 do whatever you want):
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute
  creationComplete=onCreationComplete()
  mx:Script
  ![CDATA[
  import mx.styles.StyleManager;
 
  private var styleString:String = Button {cornerRadius: 9;
 highlightAlphas: 0, 0; fillAlphas: 1, 1, 1, 1; fillColors: #6699ff,
 #6699ff, #6699ff, #6699ff; color: #0033cc; textRollOverColor: #00;
 textSelectedColor: #00; borderColor: #6699ff; themeColor: #ff;
 fontSize: 12; fontWeight: normal; };
 
  private function onCreationComplete():void
  {
  var CSSArray:Array = styleString.split({);
  var CSSStyleDeclarationName:String =
 CSSArray[0].replace( , );
 
  var stylesArray:Array = CSSArray[1].split(;);
  for each(var currentStyle:String in stylesArray)
  {
  currentStyle = currentStyle.replace(},
 ).replace( , );
  if(currentStyle != null  currentStyle.length  0)
  {
  var currentStyleName:String =
 currentStyle.split(:)[0];
  var currentStyleValue:String =
 currentStyle.split(:)[1].replace( , );
  if(currentStyleName != null  currentStyleValue
 != null)
  {
  switch(currentStyleName)
  {
  case fillColors:
  case fillAlphas:
  case highlightAlphas:
 
 StyleManager.getStyleDeclaration(CSSStyleDeclarationName).setStyle(curre\
 ntStyleName, currentStyleValue.split(,));
  break;
  case cornerRadius:
  case fontSize:
 
 StyleManager.getStyleDeclaration(CSSStyleDeclarationName).setStyle(curre\
 ntStyleName, new Number(currentStyleValue));
  break;
  default:
 
 StyleManager.getStyleDeclaration(CSSStyleDeclarationName).setStyle(curre\
 ntStyleName, currentStyleValue);
  break;
  }
  }
  }
  }
  }
  ]]
  /mx:Script
  mx:Button label=Test Button/
 /mx:Application
 
 
 
 --- In flexcoders@yahoogroups.com, MicC chigwell23@ wrote:
 
  I am loading cssStyle text from server with a stored procedure and
  loading into a string:
 
  Button {
  cornerRadius: 9;
  highlightAlphas: 0, 0;
  fillAlphas: 1, 1, 1, 1;
  fillColors: #6699ff, #6699ff, #6699ff, #6699ff;
  color: #0033cc;
  textRollOverColor: #00;
  textSelectedColor: #00;
  borderColor: #6699ff;
  themeColor: #ff;
  fontSize: 12;
  fontWeight: normal;
  }
 
  into cssString. I want to use this as the Application's StyleSheet
 i.e.
 
mx:Style source=contents of cssString/
 
  I tried
 
  this.styleName = cssString;
 
  and played with
 
  appStyle = new StyleSheet;
  appStyle.parseCSS(cssString);
 
  but a little knowledge is a dangerous thing :-) How do I get the style
  text to become the Application StyleSheet? TIA,
 
  Mic.
 





Re: [SPAM] Re: [SPAM] [flexcoders] Obtaining rendered text from a DataGrid

2010-02-13 Thread Alex Harui
My recommendation is to borrow code from DataGridBase


On 2/13/10 5:21 PM, Mike msl...@mslinn.com wrote:






Because this is an library for exporting to other formats I only need to 
instantiate one renderer at a time.  Memory requirements should therefore be 
modest.

I have implemented a mechanism to export the display lists of non-text item 
renderers.  The tricky part is learning how to instantiate any type of renderer 
on demand.  Hopefully constructive suggestions will be forthcoming soon.

Mike

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Alex 
Harui aha...@... wrote:

 Except the memory implications of rendering every row must be considered.

 And I still haven't figured out what you'd do for renderers that don't 
 display any text.

 And I'm pretty sure I could write a renderer that you could never figure out 
 which children have text.

 But given all that, then start copying code from DataGridBase.as.  
 CreateColumnItemRenderer, setupItemRenderer and some calls to validateNow 
 should get the renderer in its final state, and code in FocusManager, 
 addFocusables walks children in the two known ways of figuring out your 
 children.  If you run into TextFields, pull their text or htmlText and if you 
 run into TextLines  Not sure what you'll do there.






--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui