Re: [flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-05-01 Thread Guy Morton
On 01/05/2010, at 1:54 PM, Amy wrote:
 It may be low, but there's a certain amount of logic to it, considering when 
 Steve Jobs was out, he was given a liver transplant. In ancient times, the 
 liver was considered to be the seat of anger. MPO is that there's been a lot 
 of angry behavior coming out of Apple lately, and not just aimed at Adobe.
 
I'd say the anger has almost uniformly been directed *at* Apple (and Jobs). 
Re-read his articlethere are no angry words there. 

People who don't like Apple tend to see everything Apple does as an attack on 
them and their choices, but it's like the egocentric person who thinks 
everything is about them - Apple can be acting in their own interests and not 
in yours *without* wishing *you* harm. 

I don't see Apple lining people up and forcing them to buy iPods, iPads, 
iPhones or iMacs, so, y'know, people can and will vote with their feet if Apple 
does stuff they don't like. For me, not supporting Flash on iP*s doesn't 
outweigh the other good things about the platform and devices, and I like the 
new emphasis on supporting web standards.

Guy

Re: [flexcoders] Re: XMLListCollection DataGrid Performance vs Any Other DataProvider Type

2010-05-01 Thread Alex Harui
Maybe I wasn’t clear.  You will still be using ArrayCollection, but the items 
in the collection will be ValueObjects or data class instances instead of 
Objects or XML nodes.  Properly written ValueObjects are faster than Objects 
and much faster than XML nodes for each property you access.  If you do it 
often enough it pays off the conversion time, and collection item properties 
are accessed during scrolling so usually it pays off if folks are going to surf 
the data.

It’s pretty simple.  If you got XML like this:

Var xml:XML = employees
employee id=”12345”
firstNameAlex/firstName
lastNameHarui/lastName
/employee
employee id=”23456”
firstNameGordon/firstName
lastNameSmith/lastName
/employee
/employees

You get the list of employees:

Var empList:XMLList = xml.employee;

Now if you just do:
Var n:int = empList.length();
Var arr:Array = new Array();
For (var I = 0; I  n; i++)
{
arr[i] = empList[i];
}

Then each of the items in the collection is XML and access to the properties 
are significantly slower and scrolling performance may suffer.

If you convert to objects:
For (var I = 0; I  n; i++)
{
var emp:XML = empList[i];
var o:Object = new Object();
o.firstName = emp.firstName.toString();
o.lastName = emp.lastName.toString();
o.id = e...@id.tostring();
arr[i] = o;
}

There is a cost to converting the data, but access to properties is much faster 
and you’ll probably feel it in scrolling.
The recommended practice is to make a data class or ValueObject

Public class Employee
{
public var id:String;
public var firstName:String
public var lastName:String;
}
For (var I = 0; I  n; i++)
{
var emp:XML = empList[i];
var o:Employee = new Employee();
o.firstName = emp.firstName.toString();
o.lastName = emp.lastName.toString();
o.id = e...@id.tostring();
arr[i] = o;
}

Access to data will be the fastest although you may not notice over plain 
Object, but the data is now strongly-typed so the compiler will catch you if 
you type the property name incorrectly.  And someday if you convert to 
RemoteObject/AMF, you’ll already have a data class ready to go.

On 4/30/10 10:54 PM, Angelo Anolin angelo_ano...@yahoo.com wrote:






I know a bit of converting my XML data into array collection which I can use as 
DP for my data-based controls.

I want to get some good examples on what Alex posted to convert the 
xmllistcollection to class instances.

I was just thinking cause, xmllistcollection can be definitely bound as a 
dataprovider to a flex control but if I am going to convert the  
xmllistcollection to a class instance and use that class as dataprovider for 
the control, then the overhead may be too much to actually ponder on?




From: jamesfin james.alan.finni...@gmail.com
To: flexcoders@yahoogroups.com
Sent: Fri, 30 April, 2010 7:46:57
Subject: [flexcoders] Re: XMLListCollection DataGrid Performance vs Any Other 
DataProvider Type






This code will convert for you...

You need to replace the xmllist.myxmldata with your own xml structure names.

private function convertXmlToArrayCo llection( myxml:String ):ArrayCollection
{
var xml:XMLDocument = new XMLDocument( myxml );

var decoder:SimpleXMLDe coder = new SimpleXMLDecoder( );
var data:Object = decoder.decodeXML( xml );

var array:Array = ArrayUtil.toArray( data.xmllist. myxmldata) ;

return new ArrayCollection( array );
}

A quick follow-up after I made this tweak to use objects vs xml.

In my case, performance increased by about 20% when scrolling on a 24 monitor 
browser full-size by reducing the number of renderers from 10 to 3.  I then 
pre-translated the original xml data in the conversion so that I didn't need to 
do it with a label function.

Performance is now acceptable in full-screen (24) mode.

Bottom-line, avoid renderers.  Label functions are better but are still taxing 
on the performance if there is a bunch of computing going on in those 
functions.  Pre-render data when converting from xml to objects.

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

 I don't know of any links off-hand.  I would simply create a class with the 
 set of properties you are interested in, then take the XML and parse it into 
 instances of that class.

 You can try to get XMLDecoder to do it, but sometimes it is more efficient 
 just to write your own converter.


 On 4/29/10 7:50 PM, Angelo Anolin angelo_anolin@ ... wrote:






 Any link to show us some samples?

 My data is coming from a .NET backend and most of it are in XML format and 
 parsed into XMLListCollection.

 Would appreciate some more info on this.

 THanks.

  _ _ __
 From: Alex Harui aha...@...
 To: flexcod...@yahoogro ups.com mailto:flexcoders%40yahoogroups.com  
 flexcod...@yahoogro ups.com 

[flexcoders] httpService useProxy

2010-05-01 Thread Paul Andrews
I have an app which accesses quite a few php urls returning XML that sit 
in the same directory and domain as the main app. I use a common prefix 
to the file paths yet for some reason I have flex moaning to me about 
setting useProxy to false yet it seems to be false already - much time 
with the debugger and explicit setting makes me think that is certainly 
the case.

Is it some form of voodo? - never really had this kind of problem when 
using URLLoader and the like.

This is Flex 3.0 (with FB 3.0) and I have not moved forward to later 
versions of the SDK.

Paul


[flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-05-01 Thread mitek17
Hi Jeff,

We are talking about Flex, not about the Creative Suite, right?

What about Flex Builder for Linux? Stability of the platform? Performance 
issues?
Debugging tools? Bugs fixed? 
AIR? Personally I don't understand the value of AIR as soon as can't talk to 
the hardware. Walter, what's the point? Offline application for ebay? Why do 
you need to do the online shopping offline? This is an oxymoron. 


PS I am currently profiling an idling application which takes 30-60% of CPU 
time with no user code executed whatsoever ( according to the Profiler which 
sucks big time). Please don't tell me that Flex/Flash is perfect and does not 
need the improvements. The memory  performance issues are the highest 
priorities for our project. I came from the hardcore C++ land  and I know how 
to make efficient  robust applications. With Flash/Flex - it's a game with no 
determined approach. Although,  I had a look at Flex 4 and I liked i. But 
still, 300 000 lines app conversion is a separate project.  



Cheers,
Dmitri.



--- In flexcoders@yahoogroups.com, Battershall, Jeff jeff.battersh...@... 
wrote:

 Mike,
 
 Adobe get cracking - are you kidding me  They've just released a slew 
 of new products in the last two months; they're nearly done on FP 10.1, Air 
 2.0, and forged an important alliance with Google. 
 
 What more do you want them to do before you can say they've gotten cracking?
 
 Jeff
 
 -Original Message-
 From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On 
 Behalf Of mitek17
 Sent: Friday, April 30, 2010 12:33 AM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Re: Thoughts on Flash by Steve Jobs
 
 
 
 --- In flexcoders@yahoogroups.com, Seth Caldwell wiz@ wrote:
 
  Steve is employing several tactics used by politicians. The iphone is not
  open. 
 
 iPhone is a device, not a technology. Technology should be open, device  
 software could be proprietary. Steve stresses it particularly, please read 
 Job's message more throroughly. 
 
 
 I hope that the pressure from Jobs will finally make Adobe get cracking.
 
 Hey, what's with Linux support? What is happening with exception handling? 
 are we there yet? No? Adobe, are you still busy with FX prefix? How many more 
 years it will take to implement the feature which should appear first in any 
 development platform.
 
 It took us YEARS (sic!) for voting, whinging and asking to fix the bugs and 
 provide basic features. Printing support? Forget it, the company which 
 invented PDF  Postscript  is too busy with something else. 
 
 
 Adobe, please wake up and make your call, otherwise it will be too late.  
 
 PS By waking up I don't mean submitting another pile of letters to FTC :) 
 
 
 
 
 
 
 
 
 
 --
 Flexcoders Mailing List
 FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
 Alternative FAQ location: 
 https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
 Search Archives: 
 http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links





[flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-05-01 Thread mitek17


--- In flexcoders@yahoogroups.com, PFD Studio p...@... wrote:

 
 The talk about openness is completely disingenuous.  Flash/Flex/ActionScript 
 is vastly more open than any of the relevant Apple technologies.
 


Here is just a short list of open source projects:
-Apache
-FreeBSD
-Linux
-PostgreSQL
-Firefox
- GNU
-Eclipse

etc etc etc

You can't be half-pregnant. Flash is a proprietary platform and does not matter 
if Tamarin is open source and Flex is open source.  Show us the source code of 
Flash Player and we will fix your bugs. Until then, please don't call Flash 
open.


PS I don't care about openness of Apple products, we are talking here about 
Internet technology available on all platforms - Windows, Mac, Linux.  Mac  
Windows are proprietary, Linux is not, so what?   






Re: [flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-05-01 Thread Oleg Sivokon
@ mitek17

Erm... GNash? Why the heck do you need the player sources? You have the SWF
specs - player is the program that plays SWF files, you can make your own...
In fact, GNash does it already and is GNU program, the problem is flash.*
(AS3) package which is a proprietary extension to ECMAScript. If you want
Flash to be an open standard - this is what you should be asking for :)
Sorry, it's just like asking for ICQ sources while you want to implement
OSCAR or Jabber.


Re: [flexcoders] MS - The future of the web is HTML 5

2010-05-01 Thread Oleg Sivokon
Hehe, I still think that ActiveX was a better idea :) I was against that
technology once, but here's my way of how I learned to understand the
intention of it and why do I think it wasn't that bad:
VIM (a code editor) may be compiled on windows, although it's a console
application, so far gVIM exists I thought it should be possible to stick the
editor window to a Windows form if, say, I can get VIM in a shape of COM
object. I then learned from VIM sources, that it was once been able to do
that - it had an option to be compiled with OLE support. These days OLE is
an obsolete technology, and there isn't much help on it if you will search
MSDN. Any place you come across OLE it would say that ActiveX is the
successor and you should use it instead. Reading more on this subject, gives
you better understanding of the intention of why it was developed (I don't
think it was developed in a very friendly way btw). But, one thing sure -
the intention was to design an interface for a foreign program to run inside
and communicate with Windows program. Explorer is just a particular case.
It was relatively easy to conform to OLE requirements when not using MS
tools - that's why VIM has it, but it became increasingly difficult to
conform to ActiveX requirement. Well, ActiveX is more feature reach and more
advanced in other regards, but it's not achieving its goal because it didn't
became a standard interface for linking and embedding :)
If you want the analogy in Flash world - think of a pure AS3 code
cooperating with Flex framework. A straight forward example - make your
display object be a valid candidate to be added into Flex display list -
implement IUIComponent... yeah, right, I would give up doing this, it's to
much work and most of it, if not all you don't want to do. I don't think
that Flex engineers have thought about it in this aspect, and I think that
MS engineers spoiled a potentially good idea by poor implementation...
Bottom line: I would be much happier to see MS coming up with some
alternative to ActiveX, then wasting time on HTML5. Maybe they need HTML5 to
not to loose in the browsers battle (because of marketing / advertising and
so on), but as I've said in another post, I don't see it as a way internet
wants to be in the future. HTML5 is just another swine flu, which is given
way much more attention than it's worth IMO.


Re: [flexcoders] httpService useProxy

2010-05-01 Thread Paul Andrews
On 01/05/2010 09:16, Paul Andrews wrote:
 I have an app which accesses quite a few php urls returning XML that sit
 in the same directory and domain as the main app. I use a common prefix
 to the file paths yet for some reason I have flex moaning to me about
 setting useProxy to false yet it seems to be false already - much time
 with the debugger and explicit setting makes me think that is certainly
 the case.

 Is it some form of voodo? - never really had this kind of problem when
 using URLLoader and the like.

 This is Flex 3.0 (with FB 3.0) and I have not moved forward to later
 versions of the SDK.

 Paul



OK, the vodoo was mine, after all..


[flexcoders] tree Control

2010-05-01 Thread free man
Hi all,
 
I need urgent help in the tree Control:
 
I am searching in the tree for a given child the function for that is working 
fine but I facing a difficulty of expanding the tree up to that child. 
Can you please help me to do that.
 
Best regards
Freeman
 


  

[flexcoders] Re: Thoughts on Flash by Steve Jobs

2010-05-01 Thread Amy


--- In flexcoders@yahoogroups.com, Guy Morton g...@... wrote:

 On 01/05/2010, at 1:54 PM, Amy wrote:
  It may be low, but there's a certain amount of logic to it, considering 
  when Steve Jobs was out, he was given a liver transplant. In ancient times, 
  the liver was considered to be the seat of anger. MPO is that there's been 
  a lot of angry behavior coming out of Apple lately, and not just aimed at 
  Adobe.
  
 I'd say the anger has almost uniformly been directed *at* Apple (and Jobs). 
 Re-read his articlethere are no angry words there. 
 
 People who don't like Apple tend to see everything Apple does as an attack on 
 them and their choices, but it's like the egocentric person who thinks 
 everything is about them - Apple can be acting in their own interests and not 
 in yours *without* wishing *you* harm. 
 
 I don't see Apple lining people up and forcing them to buy iPods, iPads, 
 iPhones or iMacs, so, y'know, people can and will vote with their feet if 
 Apple does stuff they don't like. For me, not supporting Flash on iP*s 
 doesn't outweigh the other good things about the platform and devices, and I 
 like the new emphasis on supporting web standards.

Where have you been, with his fights with almost everyone, from HTC to 
Gizmodo's editor?

I also don't see Apple's anti-competitive practices as none of my business, 
just like it wasn't none of our business that big banks were selling toxic 
assets to their clients.  No one was lining people up forcing them to take out 
mortgages they couldn't afford, and no one was lining people up forcing 
investors to buy securities based on those mortgages, but a lot of people who 
didn't choose to do either wound up paying the price.

MPO is that if too many developers jump on the Apple boat, they could wind up 
choking off parts of the market that I believe will be better for everyone (and 
certainly me) if they succeed.  I'm not going to sit around on my hands and not 
try to prevent that, to whatever extent I can. 
http://www.insideria.com/2010/04/what-bugs-me-about-apple.html

-Amy



[flexcoders] Re: MS - The future of the web is HTML 5

2010-05-01 Thread Amy


--- In flexcoders@yahoogroups.com, Oleg Sivokon olegsivo...@... wrote:

 Hehe, I still think that ActiveX was a better idea :) I was against that
 technology once, but here's my way of how I learned to understand the
 intention of it and why do I think it wasn't that bad:
 VIM (a code editor) may be compiled on windows, although it's a console
 application, so far gVIM exists I thought it should be possible to stick the
 editor window to a Windows form if, say, I can get VIM in a shape of COM
 object. I then learned from VIM sources, that it was once been able to do
 that - it had an option to be compiled with OLE support. These days OLE is
 an obsolete technology, and there isn't much help on it if you will search
 MSDN. Any place you come across OLE it would say that ActiveX is the
 successor and you should use it instead. Reading more on this subject, gives
 you better understanding of the intention of why it was developed (I don't
 think it was developed in a very friendly way btw). But, one thing sure -
 the intention was to design an interface for a foreign program to run inside
 and communicate with Windows program. Explorer is just a particular case.
 It was relatively easy to conform to OLE requirements when not using MS
 tools - that's why VIM has it, but it became increasingly difficult to
 conform to ActiveX requirement. Well, ActiveX is more feature reach and more
 advanced in other regards, but it's not achieving its goal because it didn't
 became a standard interface for linking and embedding :)
 If you want the analogy in Flash world - think of a pure AS3 code
 cooperating with Flex framework. A straight forward example - make your
 display object be a valid candidate to be added into Flex display list -
 implement IUIComponent... yeah, right, I would give up doing this, it's to
 much work and most of it, if not all you don't want to do. I don't think
 that Flex engineers have thought about it in this aspect, and I think that
 MS engineers spoiled a potentially good idea by poor implementation...
 Bottom line: I would be much happier to see MS coming up with some
 alternative to ActiveX, then wasting time on HTML5. Maybe they need HTML5 to
 not to loose in the browsers battle (because of marketing / advertising and
 so on), but as I've said in another post, I don't see it as a way internet
 wants to be in the future. HTML5 is just another swine flu, which is given
 way much more attention than it's worth IMO.

That's a very good point.  Most of the time, when I am using Flex, it's to be 
used in environments _other_ than the browser.  If the Flash Player were not an 
ActiveX control, I couldn't do that.

-Amy



[flexcoders] File reference not working locally :S

2010-05-01 Thread Oleg Sivokon
A very confusing situation here...

Here's the code:

private function fr_selectHandler(e:Event):Void
{
var fr:FileReference = cast e.target;
var name:String = ;
var where:String = ;

this._queve.push(fr);
fr.addEventListener(ProgressEvent.PROGRESS, this.fr_progressHandler);
fr.addEventListener(Event.COMPLETE, this.fr_completeHandler);
if (!this._loading)
{
this._queve.pop();
fr.upload(new URLRequest(/), name);
ExternalInterface.call(alert, name);
}
}
(I've omitted the part where name is generated, but it's not important)
I'm using HTTPFox to view the connection between the SWF and the server.
The server is Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k
mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
I have this in my hosts file (Apparently a Windows machine)

127.0.0.1   test-site.tld

And in httpd.conf

VirtualHost 127.0.0.1
   DocumentRoot C:\xampp\xampp\htdocs\projects\test-site
   ServerName test-site.tld
/VirtualHost

(it also has the default localhost host + a bunch more sites defined) And
it used to work when on localhost!

Now, when I'm running the code above I get no error, but nothing is sent to
the server. I can see the alert box popping up, which means that the
function doesn't fail at loading. I've compiled for debugging and I am using
a debug version of Flash Player 10.0.45.
I have searched for security warnings in the flash log file - there were
none (besides, there shouldn't be, since the URL is relative).
I have these settings in mm.cfg:

PolicyFileLog=1   # Enables policy file logging
PolicyFileLogAppend=1  # Optional; do not clear log at startup

And policyfiles.txt remains blank...

I've searched Apache logs for maybe an unsuccessful request for
crossdomain.xml, but no, flash player didn't make such requests?

My SWF is loaded like so:

http://test-site.tld/uploader.swf

However the URL of the page is

http://test-site.tld/admin

(I'm using mod_rewrite + have following settings in .htaccess)

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule ^(.*)$ /index.php?q=$1 [QSA,L]

Any ideas of what may be going wrong? I've tried all I could think of...

Thanks.


[flexcoders] Re: File reference not working locally :S

2010-05-01 Thread Oleg Sivokon
OK, found the problem... HTTPFox doesn't monitor the calls made by
FileReference... don't know why, but after I switched to another
traffic analyzer I could see the request been made.
Sorry, false alarm.


[flexcoders] Bindable metadata tag event name

2010-05-01 Thread sasuke

Hi folks,

The Bindable metadata tag allows an optional event name to be specified
which would be event name that would be dispatched when the property in
consideration changes. I've read somewhere that specifying a distinct event
name for each bindable property reduces the performance overhead (less work
for BindingUtils or so it seems, I can't seem to find the actual
implementation detail). But this doesn't work with bindable properties when
used with flex controls. For e.g. this *works*

mx:Script
  [Bindable]
  private var txt:String = HI;

  private function onCreationCompleteDone(event:Event):void
  {
txt = Changed text!;
  }
/mx:Script
mx:Text text={txt} /

This doesn't (notice the event name specified):


mx:Script
  [Bindable(myEvent)]
  private var txt:String = HI;

  private function onCreationCompleteDone(event:Event):void
  {
txt = Changed text!;  // Never called!
  }
/mx:Script
mx:Text text={txt} /

I did try analyzing the autogenerated AS files; the ones generated when I
use simple [Bindable] is pretty easy to understand since it generates plain
getter and setter for the `txt` property but when I use
[Bindable(someEvent)], the code generated is a bit cryptic with the stuff
with Watchers and all that.

Would someone be kind enough to shed some light on this matter? How this all
this Bindable stuff work under the hood?

TIA,
sasuke
-- 
View this message in context: 
http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28422913.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Re: XMLListCollection DataGrid Performance vs Any Other DataProvider Type

2010-05-01 Thread Angelo Anolin
Thank you very much Alex. This certainly opens up a lot more for my learning.

Angelo




From: Alex Harui aha...@adobe.com
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Sent: Fri, 30 April, 2010 23:53:07
Subject: Re: [flexcoders] Re: XMLListCollection DataGrid Performance vs Any 
Other DataProvider Type

  
Maybe I wasn’t clear.  You will still be using ArrayCollection, but the items 
in the collection will be ValueObjects or data class instances instead of 
Objects or XML nodes.  Properly written ValueObjects are faster than Objects 
and much faster than XML nodes for each property you access.  If you do it 
often enough it pays off the conversion time, and collection item properties 
are accessed during scrolling so usually it pays off if folks are going to surf 
the data.

It’s pretty simple.  If you got XML like this:

Var xml:XML = employees
employee id=”12345”
firstNameAlex/firstName
lastNameHarui/lastName
/employee
employee id=”23456”
firstNameGordon/firstName
lastNameSmith/lastName
/employee
/employees

You get the list of employees:

Var empList:XMLList = xml.employee;

Now if you just do:
Var n:int = empList.length( );
Var arr:Array = new Array();
For (var I = 0; I  n; i++)
{
arr[i] = empList[i];
}

Then each of the items in the collection is XML and access to the properties 
are significantly slower and scrolling performance may suffer.

If you convert to objects:
For (var I = 0; I  n; i++)
{
var emp:XML = empList[i];
var o:Object = new Object();
o.firstName = emp.firstName. toString( );
o.lastName = emp.lastName. toString( );
o.id = e...@id.tostring( );
arr[i] = o;
}

There is a cost to converting the data, but access to properties is much faster 
and you’ll probably feel it in scrolling.
The recommended practice is to make a data class or ValueObject

Public class Employee
{
public var id:String;
public var firstName:String
public var lastName:String;
}
For (var I = 0; I  n; i++)
{
var emp:XML = empList[i];
var o:Employee = new Employee();
o.firstName = emp.firstName. toString( );
o.lastName = emp.lastName. toString( );
o.id = e...@id.tostring( );
arr[i] = o;
}

Access to data will be the fastest although you may not notice over plain 
Object, but the data is now strongly-typed so the compiler will catch you if 
you type the property name incorrectly.  And someday if you convert to 
RemoteObject/ AMF, you’ll already have a data class ready to go.

On 4/30/10 10:54 PM, Angelo Anolin angelo_anolin@ yahoo.com wrote:



 
 
   

I know a bit of converting my XML data into array collection which I can use 
as DP for my data-based controls.

I want to get some good examples on what Alex posted to convert the 
xmllistcollection to class instances.  

I was just thinking cause, xmllistcollection can be definitely bound as a 
dataprovider to a flex control but if I am going to convert the  
xmllistcollection to a class instance and use that class as dataprovider for 
the control, then the overhead may be too much to actually ponder on?





From:jamesfin james.alan.finnigan @gmail.com
To: flexcod...@yahoogro ups.com
Sent: Fri, 30 April, 2010 7:46:57
Subject: [flexcoders] Re: XMLListCollection DataGrid Performance vs Any Other 
DataProvider Type

  
   



This code will convert for you...

You need to replace the xmllist.myxmldata with your own xml structure names.

private function convertXmlToArrayCo llection( myxml:String ):ArrayCollection
{
var xml:XMLDocument = new XMLDocument( myxml );

var decoder:SimpleXMLDe coder = new SimpleXMLDecoder( );
var data:Object = decoder.decodeXML( xml );

var array:Array = ArrayUtil.toArray( data.xmllist. myxmldata) ;

return new ArrayCollection( array );
}

A quick follow-up after I made this tweak to use objects vs xml.

In my case, performance increased by about 20% when scrolling on a 24 
monitor browser full-size by reducing the number of renderers from 10 to 3.  
I then pre-translated the original xml data in the conversion so that I 
didn't need to do it with a label function.  

Performance is now acceptable in full-screen (24) mode.

Bottom-line, avoid renderers.  Label functions are better but are still 
taxing on the performance if there is a bunch of computing going on in those 
functions.  Pre-render data when converting from xml to objects.

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

 I don't know of any links off-hand.  I would simply create a class with the 
 set of properties you are interested in, then take the XML and parse it 
 into instances of that class.
 
 You can try to get XMLDecoder to do it, but sometimes it is more efficient 
 just to write your own converter.
 
 
 On 4/29/10 7:50 PM, Angelo Anolin angelo_anolin@ ... 

Re: [flexcoders] Bindable metadata tag event name

2010-05-01 Thread Richard Rodseth
I've never looked at the implementation. When I do this, I create a custom
getter and setter:

[Bindable(fooChanged)]
public function get foo():Boolean {
  return _foo;
}

public function set foo(value:Boolean):void {
  if (value != _foo) {
_foo = value;
   dispatchEvent(new Event(fooChanged))
}
}

Note that you can also have computed properties based on multiple
properties:

[Bindable(fooChanged)]
[Bindable(barChanged)]
public function get foobar():Boolean {
  return _foo  _bar;
}



On Sat, May 1, 2010 at 12:54 PM, sasuke uzumaki.naruto...@gmail.com wrote:




 Hi folks,

 The Bindable metadata tag allows an optional event name to be specified
 which would be event name that would be dispatched when the property in
 consideration changes. I've read somewhere that specifying a distinct event
 name for each bindable property reduces the performance overhead (less work
 for BindingUtils or so it seems, I can't seem to find the actual
 implementation detail). But this doesn't work with bindable properties when
 used with flex controls. For e.g. this *works*

 mx:Script
 [Bindable]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!;
 }
 /mx:Script
 mx:Text text={txt} /

 This doesn't (notice the event name specified):

 mx:Script
 [Bindable(myEvent)]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!; // Never called!
 }
 /mx:Script
 mx:Text text={txt} /

 I did try analyzing the autogenerated AS files; the ones generated when I
 use simple [Bindable] is pretty easy to understand since it generates plain
 getter and setter for the `txt` property but when I use
 [Bindable(someEvent)], the code generated is a bit cryptic with the stuff
 with Watchers and all that.

 Would someone be kind enough to shed some light on this matter? How this
 all
 this Bindable stuff work under the hood?

 TIA,
 sasuke
 --
 View this message in context:
 http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28422913.html
 Sent from the FlexCoders mailing list archive at Nabble.com.

  



Re: [flexcoders] Bindable metadata tag event name

2010-05-01 Thread sasuke

Hi,

Yes, even I've done that. But my main gripe is that when you have a Bindable
tag with your custom event name, is it not possible to use it directly with
any custom/built-in flex control?

[Bindable(myEvent)]
private var txt:String = HI;

mx:Text text={txt} / // is this not possible if I use custom events?

I've always used plain bindable tags but I'd like to know whether I can
achieve the same auto-updation functionality when it comes to using bindable
tags with custom events.

Regards,
sasuke


Richard Rodseth wrote:
 
 I've never looked at the implementation. When I do this, I create a custom
 getter and setter:
 
 [Bindable(fooChanged)]
 public function get foo():Boolean {
   return _foo;
 }
 
 public function set foo(value:Boolean):void {
   if (value != _foo) {
 _foo = value;
dispatchEvent(new Event(fooChanged))
 }
 }
 
 Note that you can also have computed properties based on multiple
 properties:
 
 [Bindable(fooChanged)]
 [Bindable(barChanged)]
 public function get foobar():Boolean {
   return _foo  _bar;
 }
 
 
 
 On Sat, May 1, 2010 at 12:54 PM, sasuke uzumaki.naruto...@gmail.com
 wrote:
 



 Hi folks,

 The Bindable metadata tag allows an optional event name to be specified
 which would be event name that would be dispatched when the property in
 consideration changes. I've read somewhere that specifying a distinct
 event
 name for each bindable property reduces the performance overhead (less
 work
 for BindingUtils or so it seems, I can't seem to find the actual
 implementation detail). But this doesn't work with bindable properties
 when
 used with flex controls. For e.g. this *works*

 mx:Script
 [Bindable]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!;
 }
 /mx:Script
 mx:Text text={txt} /

 This doesn't (notice the event name specified):

 mx:Script
 [Bindable(myEvent)]
 private var txt:String = HI;

 private function onCreationCompleteDone(event:Event):void
 {
 txt = Changed text!; // Never called!
 }
 /mx:Script
 mx:Text text={txt} /

 I did try analyzing the autogenerated AS files; the ones generated when I
 use simple [Bindable] is pretty easy to understand since it generates
 plain
 getter and setter for the `txt` property but when I use
 [Bindable(someEvent)], the code generated is a bit cryptic with the
 stuff
 with Watchers and all that.

 Would someone be kind enough to shed some light on this matter? How this
 all
 this Bindable stuff work under the hood?

 TIA,
 sasuke
 --
 View this message in context:
 http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28422913.html
 Sent from the FlexCoders mailing list archive at Nabble.com.

  

 
 

-- 
View this message in context: 
http://old.nabble.com/Bindable-metadata-tag---event-name-tp28422913p28424902.html
Sent from the FlexCoders mailing list archive at Nabble.com.