[flexcoders] Re: New to FLEX

2008-09-22 Thread Boon Chew

O'reilly's Learning Flex is really good.  The book is printed in full color 
too, so yummy.

http://www.amazon.com/Learning-Flex-Internet-Applications-Developer/dp/0596517327



  

[flexcoders] How to turn a dynamically loaded swf into a popup quick?

2008-09-19 Thread Boon Chew

I have a swf that I am loading in via SWFLoader and I would like to treat it 
like a regular popup (like the ones created via createPopUp), is that possible 
to do with PopUpManager? What's the alternative in order to achieve what 
PopUpManager achieves (ability to set modal/non-modal, bring to front, ability 
to move dialog around, etc.) without writing a ton of code?

- boon



  

Re: [flexcoders] How to turn a dynamically loaded swf into a popup quick?

2008-09-19 Thread Boon Chew
Genius, thanks Mike.

- boon

--- On Fri, 9/19/08, Michael Schmalle [EMAIL PROTECTED] wrote:
From: Michael Schmalle [EMAIL PROTECTED]
Subject: Re: [flexcoders] How to turn a dynamically loaded swf into a popup 
quick?
To: flexcoders@yahoogroups.com
Date: Friday, September 19, 2008, 11:08 AM











Hi,

Couldn't you just create a subclass of say TitleWindow and make the SWF loader 
a single child.

Maybe write a couple public methods to interface through the window to load 
your content.


Then use the PopUpManager to popup that subclass that holds the SWFLoader.

A thought, don't know the security issues though.

Mike

On Fri, Sep 19, 2008 at 2:02 PM, Boon Chew [EMAIL PROTECTED] com wrote:




















I have a swf that I am loading in via SWFLoader and I would like to treat it 
like a regular popup (like the ones created via createPopUp) , is that possible 
to do with PopUpManager? What's the alternative in order to achieve what 
PopUpManager achieves (ability to set modal/non-modal, bring to front, ability 
to move dialog around, etc.) without writing a ton of code?


- boon



  
  





















-- 
Teoti Graphix, LLC
http://www.teotigra phix.com

Teoti Graphix Blog
http://www.blog. teotigraphix. com


You can find more by solving the problem then by 'asking the question'.



  




 

















  

Re: [flexcoders] RE: Alex going offline for a while - and Gordon too!

2008-09-18 Thread Boon Chew

Thanks for the notice, now I gotta push back my project deadline 'til when you 
guys are back ;)

- boon

--- On Thu, 9/18/08, Gordon Smith [EMAIL PROTECTED] wrote:
From: Gordon Smith [EMAIL PROTECTED]
Subject: [flexcoders] RE: Alex going offline for a while - and Gordon too!
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Thursday, September 18, 2008, 2:39 PM



















BTW, I'm on vacation from 9/22 to 10/3. Fortunately, the
community is doing a great job of helping each other on this list! 

   

Gordon Smith 

Adobe Flex SDK Team 

   





From: [EMAIL PROTECTED] ups.com
[mailto:flexcoders@ yahoogroups. com] On Behalf Of Alex Harui

Sent: Wednesday, September 17, 2008 9:03 PM

To: [EMAIL PROTECTED] ups.com

Subject: [flexcoders] Alex going offline for a while 





   









Well,
the time has come for me to take a break from answering flexcoders
postings.  I’ll be turning off my computer around 9pm PDT Thursday and
going on sabbatical so I won’t be thinking about Flex until October 10 or
20.  The last 10 days are “vacation” so I might check in to start getting
my brain in gear again. 

  

In
the meantime, I’m sure the community will eventually answer everything I would
anyway, but just in case, here are some possible responses: 

  

1) 
Search the archives 

2) 
Google for examples 

3) 
Use the debugger 

4) 
Use the profiler 

5) 
Post the entire stacktrace using a debug build so you get line numbers 

6) 
Item renderers recycle 

7) 
Read my blog 

8) 
Feel free to file a bug or enhancement request 

9) 
Yes it is probably possible, but has difficulty rating of ___ 

10)   Ask
Matt or Gordon. 

  

See
you in October 

  

-Alex 





  







  




 

















  

[flexcoders] createPopUp and addPopUp, which one to love?

2008-09-10 Thread Boon Chew

What's the process/criteria in deciding whether to use createPopUp vs 
addPopUp?  They seem interchangeable.  What is it that you can do with one that 
you can't do with the other? Which one do you use the most?

[-] The doc says:
You can use the addPopUp() method of the PopUpManager to create a pop-up 
window without defining a custom component. Can't you do that with createPopUp 
as well?

[-] The doc also says ...Using the addPopUp() method may be preferable to 
using the createPopUp()
method if you have to pop up a simple dialog box that is never reused
elsewhere.  However, it is not the best coding practice if the pop-up is
complex or cannot be reused elsewhere...

It doesn't really explain why it's not the best practice if the pop-up is 
complex or cannot be reused elsewhere.

To me it seems to be more convenient to use addPopUp because I can do whatever 
I want to the dialog instance before I pass it to addPopup( ) but that's more 
theorizing than from actual field experience.

- boon




  

[flexcoders] turn horizontalScrollPolicy and verticalScrollPolicy off for all

2008-09-08 Thread Boon Chew
Hi,

Is there a quick way to turn off horizontalScrollPolicy / verticalScrollPolicy 
or prevent them from showing up once and for all for all containers in an app 
without resorting to patching?

- boon



  

RE: [flexcoders] turn horizontalScrollPolicy and verticalScrollPolicy off for all

2008-09-08 Thread Boon Chew

It's kinda a pain to have to subclass every single container used in the app 
just to turn the policy to off.  I was hoping that for policy-based stuff we 
have an app-wide setting, like Application.application.scrollPolicy = no that 
can be overrided by individual containers.

Lazy programmers like me in this case will probably resort to monkey patching 
the banana containers...

- boon

--- On Mon, 9/8/08, Gordon Smith [EMAIL PROTECTED] wrote:
From: Gordon Smith [EMAIL PROTECTED]
Subject: RE: [flexcoders] turn horizontalScrollPolicy and verticalScrollPolicy 
off for all
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Monday, September 8, 2008, 5:35 PM



















Subclass the containers to set the policies to off and
use the subclasses instead. 

   

Gordon Smith 

Adobe Flex SDK Team 

   





From:
[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of 
Boon
Chew

Sent: Monday, September 08, 2008 5:26 PM

To: flexcoders

Subject: [flexcoders] turn horizontalScrollPol icy and
verticalScrollPolic y off for all 





   








 
  
  Hi,

  

  Is there a quick way to turn off horizontalScrollPol icy / 
verticalScrollPolic y
  or prevent them from showing up once and for all for all containers in an app
  without resorting to patching?

  

  - boon 
  
 


   



  







  




 

















  

RE: [flexcoders] turn horizontalScrollPolicy and verticalScrollPolicy off for all

2008-09-08 Thread Boon Chew

Thanks, good advice.

- boon

--- On Mon, 9/8/08, Alex Harui [EMAIL PROTECTED] wrote:
From: Alex Harui [EMAIL PROTECTED]
Subject: RE: [flexcoders] turn horizontalScrollPolicy and verticalScrollPolicy 
off for all
To: flexcoders@yahoogroups.com flexcoders@yahoogroups.com
Date: Monday, September 8, 2008, 5:44 PM



















Or don’t use Container.  Make sure you need some feature of
Container (border, background, clipping) or else you might really want to use
UIComponent. 

   





From:
[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of 
Gordon
Smith

Sent: Monday, September 08, 2008 5:36 PM

To: [EMAIL PROTECTED] ups.com

Subject: RE: [flexcoders] turn horizontalScrollPol icy and verticalScrollPolic y
off for all 





   









Subclass the containers to set the
policies to off and use the subclasses instead. 

  

Gordon Smith 

Adobe Flex SDK Team 

  





From:
[EMAIL PROTECTED] ups.com [mailto:flexcoders@ yahoogroups. com] On Behalf Of 
Boon
Chew

Sent: Monday, September 08, 2008 5:26 PM

To: flexcoders

Subject: [flexcoders] turn horizontalScrollPol icy and verticalScrollPolic y
off for all 





  








 
  
  Hi,

  

  Is there a quick way to turn off horizontalScrollPol icy / 
verticalScrollPolic y
  or prevent them from showing up once and for all for all containers in an app
  without resorting to patching?

  

  - boon 
  
 


  











  







  




 

















  

[flexcoders] Donkey patching UIMovieClip subclass...

2008-08-28 Thread Boon Chew
Hi,

I just started using the Flex Component Kit so I am probably not doing it 
right.  If I have a symbol that's linked to a UIMovieClip subclass in my Flex 
project, and if the class uses any Flex framework stuff, Flash would refuse to 
publish my FLA skin file.  This makes sense since the Flex framework is not in 
Flash's classpath.  To get around things I also made my Flash point to another 
classpath set up specifically to placate the Flash compiler, in it I have a 
dummy version of the UIMovieClip subclass that doesn't refer to any Flex 
framework stuff at all.  Of course the real Flex code is still using the actual 
UIMovieClip subclass that does everything.  It's a little dumb, hence donkey 
patching (as opposed to the smarter monkey).  Is there anything I should be 
doing instead?

-
 boon





  

[flexcoders] Exit effect for popup when being removed

2008-08-26 Thread Boon Chew
Hi,

What's the best way to have a popup menu play an exit effect when it is about 
to be removed by PopUpManager.removePopUp?

Should we play the effect first (say dissolve or wipe up), then on effect end 
call  removePopUp, or is there a more direct / simpler way?

- boon



  

Re: [flexcoders] Exit effect for popup when being removed

2008-08-26 Thread Boon Chew

Sorry, forgot to mention, the effects exit code has to be in a method body of 
actionscript code (as in effect.play( ), .etc.) when the popup is being 
removed, instead of just associating an effect instance with the removedEfffect 
style.  I have tried listening to FlexEvent.REMOVED and run the  exit effect 
handler there but that doesn't seem to work.

- boon

--- On Tue, 8/26/08, Boon Chew [EMAIL PROTECTED] wrote:
From: Boon Chew [EMAIL PROTECTED]
Subject: [flexcoders] Exit effect for popup when being removed
To: flexcoders@yahoogroups.com
Date: Tuesday, August 26, 2008, 6:11 PM











Hi,

What's the best way to have a popup menu play an exit effect when it is about 
to be removed by PopUpManager. removePopUp?

Should we play the effect first (say dissolve or wipe up), then on effect end 
call  removePopUp, or is there a more direct / simpler way?

- boon





  
  




 

















  

[flexcoders] Skinning TitleWindow Question

2008-08-21 Thread Boon Chew
Hi,

I am trying to skin TitleWindow so that the main content area uses gradient 
(like header and footer).  Also want the close button on the left instead of 
right.  What's the best way to go about this short of creating a custom 
container from scratch?

- boon



  

[flexcoders] Does ASVM JIT compiler get rid of empty functions?

2008-08-15 Thread Boon Chew
 
Does anyone know if the Actionscript Virtual Machine JIT compiler removes calls 
to functions with empty body?  The reason for asking this is that I am using 
assert calls in my code a lot, and I plan to comment out the assert function 
body in release build so it becomes a no-op.  Will the code still incur the 
cost of invoking the assert function even though it's empty?
 
- boon


  

[flexcoders] Large XML /w E4X vs. serialized objects /w tree traversal

2008-08-03 Thread Boon Chew
Hi,

I am building an app that deals with a fair bit of people relationship data 
coming down as XML, so the hierarchical nature of XML actually comes in handy 
here.  I have a few options: one is to serialize each person XML node into an 
object, and setup the appropriate data structure for hierarchical data 
traversal (e.g. rooted tree).  Another option is to keep everything in memory 
as XML and accessed the node data via E4X.  The third option is to take a 
hybrid approach, won't consider this route right now unless this appears to be 
the best.

My concern is that instantiating thousands of objects will create a performance 
issue (happened at another project that dealt with thousands of dto's), not to 
mention it's very slow to instantiate lots of objects.  At the same time, I am 
not sure how fast E4X is at dealing with large XML.

Which approach would you take? Which one is likely to scale better? Large 
in-memory XML + E4X traversal or data structure with lots of objects + 
algorthmic tree traversal? 

- boon



  

Re: [flexcoders] Re: Large XML /w E4X vs. serialized objects /w tree traversal

2008-08-03 Thread Boon Chew

Thanks Florian.  Problem is the performance actually degrades quite a bit when 
there are a lot of objects in memory.  Instantiating a lot of objects is dog 
slow as well. Also, there would really be no dependency with the datasource 
even if we go XML (assuming this is the best option) because either way we have 
to write code to process/transform the incoming data, in this case it would be 
just code that transforms whatever format it comes in as into XML.  There is 
also no need for events in this case as well since they are plain vanilla data 
objects with only public properties in it.

- boon

--- On Sun, 8/3/08, florian.salihovic [EMAIL PROTECTED] wrote:
From: florian.salihovic [EMAIL PROTECTED]
Subject: [flexcoders] Re: Large XML /w E4X vs. serialized objects /w tree 
traversal
To: flexcoders@yahoogroups.com
Date: Sunday, August 3, 2008, 12:53 AM











I would choose the class hierachy approach. Write your own classes 
for relationships, 

people etc.



The pros of this approach:

* You do not depend on a datasource: it does not matter where the data comes 
from 

((different) XML sources, remoting [,...]).

* You have strong typed objects and you can embed your own events and errors. 
This 

means (unit-) testing becomes more effective.



The cons:

* You have to implement a parser.



Best regards from Germany.



--- In [EMAIL PROTECTED] ups.com, Boon Chew [EMAIL PROTECTED] . wrote:



 Hi,

 

 I am building an app that deals with a fair bit of people relationship data 
 coming down 

as XML, so the hierarchical nature of XML actually comes in handy here.  I have 
a few 

options: one is to serialize each person XML node into an object, and setup the 

appropriate data structure for hierarchical data traversal (e.g. rooted tree).  
Another option 

is to keep everything in memory as XML and accessed the node data via E4X.  The 
third 

option is to take a hybrid approach, won't consider this route right now unless 
this 

appears to be the best.

 

 My concern is that instantiating thousands of objects will create a 
 performance issue 

(happened at another project that dealt with thousands of dto's), not to 
mention it's very 

slow to instantiate lots of objects.  At the same time, I am not sure how fast 
E4X is at 

dealing with large XML.

 

 Which approach would you take? Which one is likely to scale better? Large 
 in-memory 

XML + E4X traversal or data structure with lots of objects + algorthmic tree 
traversal? 

 

 - boon






  




 

















  

[flexcoders] override/monkey patch global functions possible?

2008-08-02 Thread Boon Chew
Hi,

Is it possible to override global functions such as trace( ) ?  For example, 
sometimes I want the trace( ) to tell me where they are called from, but it's 
kinda a pain to have to import getQualifiedClassName and sprinkle code with 
stuff like (getQualifiedClassName(this) + :  + ...); all over the place.

- boon




  

RE: [flexcoders] When not to use weak references?

2008-07-15 Thread Boon Chew
 it's listening to is still
around though right? Weak reference or no?



-Josh 



  



On Tue, Jul 15, 2008 at 2:43 PM, Tim Rowe [EMAIL PROTECTED] com.au
wrote: 





Use strong references when you're adding an event listener to the
same instance dispatching an event.  If it's an anonymous function, you
need to use a strong reference.  Also, use strong references when you want
speed – weak references are slower. 

Always use weak references when dealing with singletons
(Cairngorm's event dispatcher is a singleton, hence, always use with
Cairngorm), or objects that live the life of the application.  This
includes timers waiting on call backs also. 

  

Not always true but if you have an object you intend to never have
destroyed, but it may also be perfectly safe to use strong references. 
Keep in mind though that using a weak reference on, say, an event listener
where a strong one was required may result in things like that listener not
getting called. 

  

I'm only new to Flex, but this is as I understand it, and no doubt
I've missed a few things here and there. 

  



--Tim Rowe 











From: [EMAIL PROTECTED] ups.com
[mailto:[EMAIL PROTECTED] ups.com]
On Behalf Of Boon Chew

Sent: Tuesday, 15 July 2008 2:08 PM

To: [EMAIL PROTECTED] ups.com

Subject: [flexcoders] When not to use weak references? 







  








 
  
  Hi all,

  

  I have read posts that preached the goodness of weak references for event
  listening, but have not read anything that suggests when you should use
  strong reference over the weak one, and  the down side to using weak
  references.

  

  Any ideas when being weak is not bad thing? :)

  

  - boon 
  
 


  





















 





-- 

Therefore, send not to know For whom the bell tolls. It tolls for
thee.



:: Josh 'G-Funk' McDonald

:: 0437 221 380 :: [EMAIL PROTECTED] com
 















  













  







  




 

















  

[flexcoders] When not to use weak references?

2008-07-14 Thread Boon Chew
Hi all,

I have read posts that preached the goodness of weak references for event 
listening, but have not read anything that suggests when you should use strong 
reference over the weak one, and  the down side to using weak references.

Any ideas when being weak is not bad thing? :)

- boon



  

RE: [flexcoders] In actionscript, converting from string to number loses precision

2006-03-09 Thread Boon Chew



This actually exists in Flash 8 as well. And I don't think it's a case of trace( ) not calling parseFloat, I get the same thing when I output it to a textfield.And it gets better:stop();var s:String = "952.85";var i:Number = parseFloat(s);// txtResultX are dynamic textbox on stagetxtResult1 = Math.floor(952.85 / 0.05); // 19057, correcttxtResult2 = Math.floor(i / 0.05); // 19056, wrongtxtResult3 = Math.floor(i * ( 1 / 0.05)); // 19057, correct- boonGordon Smith [EMAIL PROTECTED] wrote:This is a bug. Can you please file it?Apparently when the AS3 compiler compiles trace(i - 952.86), it doesn't convert the 952.86 to the exact same Number that the player does when it executes parseFloat() on "952.86". They should produce identical Numbers, and the different should be exactly 0.You should be aware, however, that the
 Number they produce will be very close but not exactly equal to decimal 952.86. The reason is that Number stores values as binary fractions, not decimal fractions. A decimal fraction like 0.375 has a terminating binary representation (0.011 =0 x 1/2 + 1 x 1/4 + 1 x 1/8) but a decimal fraction like 952.86 has a non-terminating binary representation that would require an infinite number of bits to represent exactly. This is why an _expression_ like 0.1 + 0.2 == 0.3 evaluates to false! This is NOT a bug, it's a consequence that microprocessors and computer languages tend to do floating-point arithmetic in binary, not in decimal. The Number type in AS3 is the same as the 'double' type in Java and C++, which have the same issue.- GordonFrom: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Boon Chew Sent: Wednesday, March 08, 2006 9:31 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] In actionscript, converting from string to number loses precisionAnyone has any idea why it's not possible to convert a string to a number without losing precision?var s:String =
 "952.86"; var i:Number = parseFloat(s); trace(i); trace(i - 952.86); // Not zero!  - boon  Yahoo! Mail Use Photomail to share photos without annoying attachments.
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









[flexcoders] In actionscript, converting from string to number loses precision

2006-03-08 Thread Boon Chew



Anyone has any idea why it's not possible to convert a string to a number without losing precision?var s:String = "952.86";var i:Number = parseFloat(s);trace(i);trace(i - 952.86); // Not zero!  - boon
	
		 Yahoo! Mail 
Use Photomail to share photos without annoying attachments.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









RE: [flexcoders] eval gone in AS3, how to get reference to movieclip via target name?

2006-03-04 Thread Boon Chew



I am not using Flex, I am mostly curious what I would have to do to my existing Flash actionscript code when AS3 is out for Flash.Gordon Smith [EMAIL PROTECTED] wrote:Whoa not only is there no eval(),  there's no _target, no _level0, and no _global! Plus, you should almost always  use Sprite instead of MovieClip.So what are you really trying to do? Are  you using Flex or just pure AS3? Where are you getting a string like "sprite1.sprite2.sprite3"  from? Why do you have to transform it back into a Sprite reference? Could you have  just kept the reference instead of the string?- GordonFrom: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Boon Chew  Sent: Friday, March 03, 2006 3:41  PM  To: flexcoders@yahoogroups.com  Subject: [flexcoders] eval gone in  AS3, how to get reference to movieclip via target name?Hi all,With the _eval being gone in AS3, does anyone know how to get to the reference  of a movieclip (via the target name string) without using _eval (e.g.  "_level0.mc1.mc2.mc3") ? I know we can instantiate an object  from a class name string via the _global namespace but not positive about mc's.Thanks.- boonYahoo! Mail  Bring photos to life! New  PhotoMail makes sharing a breeze.   
		Brings words and photos together (easily) with 
PhotoMail  - it's free and works with Yahoo! Mail.





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





  




  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



  









[flexcoders] eval gone in AS3, how to get reference to movieclip via target name?

2006-03-03 Thread Boon Chew



   Hi all,With the _eval being gone in AS3, does anyone know how to get to the reference of a movieclip (via the target name string) without using _eval (e.g. "_level0.mc1.mc2.mc3") ? I know we can instantiate an object from a class name string via the _global namespace but not positive about mc's.Thanks.- boon
		Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








  
  
SPONSORED LINKS
  
  
  

Web site design development
  
  
Computer software development
  
  
Software design and development
  
  


Macromedia flex
  
  
Software development best practice
  

   
  







  
  
  YAHOO! GROUPS LINKS



  Visit your group "flexcoders" on the web.
  To unsubscribe from this group, send an email to:[EMAIL PROTECTED]
  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.