Re: [flexcoders] Take two: dynamic asset creation

2007-10-23 Thread Arul
Dear Alex Harui,

I think that will help!

We just need to create a class with getInstance() method that returns the 
instance we need based on the parameter we passed to the constructor

Say for example,

BitmapFactory class that takes bitmapData as a parameter and returns a 
bitmapAsset using the given bitmapData when getInstance method is called

myButton.icon = new BitmapFactory(myBitmapData);

will get it right :)

Regards,
Arul


  - Original Message - 
  From: Alex Harui 
  To: flexcoders@yahoogroups.com 
  Sent: Wednesday, October 24, 2007 1:27 AM
  Subject: RE: [flexcoders] Take two: dynamic asset creation



  That?s fine.  We wouldn?t do what you suggested though, we?d use 
IClassFactory in more places




--

  From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ian 
Thomas
  Sent: Tuesday, October 23, 2007 6:37 AM
  To: flexcoders@yahoogroups.com
  Subject: Re: [flexcoders] Take two: dynamic asset creation



  Hi Alex,
 I've submitted this as a feature request on the Flex tracker.

 As an aside, the simplest solution is (I think) a very straightforward 
change to the Flex API. If the expected data fields were extended so that as 
well as 'icon' you passed in 'iconArguments' and those arguments, if present, 
were used as arguments to the asset constructor it would solve it all. And I 
don't think it would impact performance appreciably - the only difference is 
that internally Flex would call new SomeAssetClass(someArgs) instead of new 
SomeAssetClass(). The parameterisation of those constructors would open up so 
much more potential. 

  Cheers,
 Ian

  On 10/23/07, Alex Harui [EMAIL PROTECTED] wrote:

  If we can figure out a way to allow this in the future, we will.  You aren't 
the first person to ask for it.  When we wrote 2.0, we were so worried about 
performance we made assumptions that skipped levels of indirection like the one 
you want.







   

Re: [flexcoders] Take two: dynamic asset creation

2007-10-22 Thread Arul
Dear Ian,

I understand your use-case, I also needed something similar

Let me do a quick experiment and get back to you on this

Regards,
Arul

www.shockwave-india.com/blog/



  - Original Message - 
  From: Ian Thomas 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, October 22, 2007 10:43 PM
  Subject: [flexcoders] Take two: dynamic asset creation


  Here's an easier way to explain the problem I posted about earler.

  If I create some BitmapAssets manually rathern than using embed:

  var b1:BitmapAsset=new BitmapAsset(someBitmapData1);
  var b2:BitmapAsset=new BitmapAsset(someBitmapData2); 
  var b3:BitmapAsset=new BitmapAsset(someBitmapData3);

  How do I then pass them to something like a TileList, which expects an icon 
property of type Class:

  var rowData:Object={label:Some Label,icon:WhatGoesHere}; 

  Where WhatGoesHere can't be BitmapAsset (that just produces an empty bitmap). 
Nor can it be b1, because that's not of type Class.

  The goal here is to achieve this without creating a new ItemRenderer. 

  Thanks in advance,
  Ian


   

Re: [flexcoders] Take two: dynamic asset creation

2007-10-22 Thread Arul
Dear Ian,

Thanks for the links

Right now I'm stuck in the same place as Josh Tynjala . old school style 
Function prototypes are not treated as Class. since flex components expect a 
class it fails
But I'm going to dig further in the morning (now its 1 am in Singapore)

Regards,
Arul


  - Original Message - 
  From: Ian Thomas 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, October 22, 2007 11:47 PM
  Subject: Re: [flexcoders] Take two: dynamic asset creation


  Thanks Arul,
The more I delve in to this and experiment with it the more I'm beginning 
to think it's not possible.

  Ben Stucki has an interesting post on a similar solution:
  http://blog.benstucki.net/?p=42

  But it relies on you needing to know exactly which component container the 
resulting object is destined for, and that won't work in TileLists (because 
ItemRenderers get reused). 

  Josh Tynjala has a slightly different solution:
  
http://www.zeuslabs.us/2007/09/28/actionscript-3-bitmap-image-classes-with-functions-and-loaders
 

  But it hits the same issue that I did, which is that in AS3 Function!=Class 
any more.

  It feels like it _ought_ to be easy.

  If it's really true that we can't use runtime-created assets with the Flex 
framework without handrolling a load of different ItemRenderers or creating our 
own subclasses of the Flex components, then that's very depressing and seems 
ill-thought-out. :-( 

  Cheers,
  Ian



  On 10/22/07, Arul [EMAIL PROTECTED] wrote:

Dear Ian,

I understand your use-case, I also needed something similar

Let me do a quick experiment and get back to you on this

Regards,
Arul

www.shockwave-india.com/blog/



  - Original Message - 
  From: Ian Thomas 
  To: flexcoders@yahoogroups.com 
  Sent: Monday, October 22, 2007 10:43 PM
  Subject: [flexcoders] Take two: dynamic asset creation


  Here's an easier way to explain the problem I posted about earler.

  If I create some BitmapAssets manually rathern than using embed:

  var b1:BitmapAsset=new BitmapAsset(someBitmapData1);
  var b2:BitmapAsset=new BitmapAsset(someBitmapData2); 
  var b3:BitmapAsset=new BitmapAsset(someBitmapData3);

  How do I then pass them to something like a TileList, which expects an 
icon property of type Class:

  var rowData:Object={label:Some Label,icon:WhatGoesHere}; 

  Where WhatGoesHere can't be BitmapAsset (that just produces an empty 
bitmap). Nor can it be b1, because that's not of type Class.

  The goal here is to achieve this without creating a new ItemRenderer. 

  Thanks in advance,
  Ian






   

Re: [flexcoders] Wondering why ArrayUtil.getItemIndex() loops through Array Items instead of using Array.indexOf()

2007-03-17 Thread Arul
Yeah! Only when ArrayUtil.getItemIndex() is able to find Objects inside nested 
arrays it will serve a purpose

Regards,
Arul

  - Original Message - 
  From: Troy Gilbert 
  To: flexcoders@yahoogroups.com 
  Sent: Saturday, March 17, 2007 12:19 AM
  Subject: Re: [flexcoders] Wondering why ArrayUtil.getItemIndex() loops 
through Array Items instead of using Array.indexOf()


  And furthermore, what's the point of having that method? I would assume the 
point of a util function would be to aggregate several common steps, but it 
seems to me like they just changed name?

  Array.indexOf() == ArrayUtil.getItemIndex() (functionality-wise)

  So, what's the deal?

  Troy.




  On 16 Mar 2007 07:39:31 -0700, Arul  [EMAIL PROTECTED] wrote:
Looking at mx.utils.ArrayUtil class I'm wondering why it does not make use 
of native method Array.indexOf for getItemIndex() method. I'm thinking
native method should be faster

public static function getItemIndex(item:Object, source:Array):int
{
var n:int = source.length ;
for (var i:int = 0; i  n; i++)
{
if (source[i] === item)
return i;
}

return -1;
}



Is there a specific reason? If so, I would like to know 

Thanks  Regards,
Arul





--
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 







   

[flexcoders] Wondering why ArrayUtil.getItemIndex() loops through Array Items instead of using Array.indexOf()

2007-03-16 Thread Arul
Looking at mx.utils.ArrayUtil class I'm wondering why it does not make use 
of native method Array.indexOf for getItemIndex() method. I'm thinking 
native method should be faster

public static function getItemIndex(item:Object, source:Array):int
{
var n:int = source.length;
for (var i:int = 0; i  n; i++)
{
if (source[i] === item)
return i;
}

return -1;
}



Is there a specific reason? If so, I would like to know

Thanks  Regards,
Arul 




 Yahoo! Groups Sponsor ~-- 
Great things are happening at Yahoo! Groups.  See the new email design.
http://us.click.yahoo.com/lOt0.A/hOaOAA/yQLSAA/nhFolB/TM
~- 

--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 


[flexcoders] Bug.Flex 2: Background becomes black when defining depthColors style for Tree Component

2007-01-10 Thread Arul
Bug.Flex 2: Background becomes black when defining depthColors style for Tree 
Component.

It used to work fine before (in Flex 2.0). Now with Flex 2.0.1, it renders as 
shown below when we define depthColors attribute for Tree Component 
depthColors=[0xFF, 0xF2F6F7, 0xEDF5F7, 0xE8F0F2, 0xD3E2E6]


 

Any workaround?

Regards,
Arulattachment: depthColorsBlackPatch-727119.jpg


Re: [flexcoders] Re: Bug.Flex 2: Background becomes black when defining depthColors style for Tree Component

2007-01-10 Thread Arul
Ya. I also did the same for now. but still looking for ways to use the 
depthColors

Regards,
Arul


  - Original Message - 
  From: bhaq1972 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, January 11, 2007 6:04 AM
  Subject: [flexcoders] Re: Bug.Flex 2: Background becomes black when defining 
depthColors style for Tree Component


  I noticed this as well. I just took out the depthColors setting and 
  and everything is okay.

  --- In flexcoders@yahoogroups.com, Arul [EMAIL PROTECTED] wrote:
  
   Bug.Flex 2: Background becomes black when defining depthColors 
  style for Tree Component.
   
   It used to work fine before (in Flex 2.0). Now with Flex 2.0.1, it 
  renders as shown below when we define depthColors attribute for Tree 
  Component 
   depthColors=[0xFF, 0xF2F6F7, 0xEDF5F7, 0xE8F0F2, 0xD3E2E6]
   
   
   
   
   Any workaround?
   
   Regards,
   Arul
  


  . 
   

Re: [flexcoders] Re: Trace?

2006-12-25 Thread Arul
Another alternative is a Trace panel built with Flex itself. more info at 
http://www.shockwave-india.com/blog/?archive=2006_12_01_archive.xml#116682290948190547

Regards,
Arul

  - Original Message - 
  From: Ralf Bokelberg 
  To: flexcoders@yahoogroups.com 
  Sent: Thursday, December 21, 2006 6:15 AM
  Subject: Re: [flexcoders] Re: Trace?


  When you install the debug player, you can run tail on flashlog.txt. 
  If you are on windows, you can install cygwin to get tail. 
  Cheers,
  Ralf. 



  On 12/20/06, coderjun [EMAIL PROTECTED] wrote:
I think the firefox extention that Brian was talking about is this:
http://www.sephiroth.it/weblog/archives/2006/10/post_1.php

-Jun



--- In flexcoders@yahoogroups.com, Brian Holmes [EMAIL PROTECTED] wrote:

 Debug mode is the only option as far as I know.
 But you should check out the mx.util.ObjectUtil class.
 It'll allow you to see more complex data. Just import it into your
class
 and use it from within
 The trace object. Trace(ObjectUtil((someObject));

 Also, there's a nice firefox thread that will allow firefox to pick up
 on the trace statements so it's easier to debug from a web application
 standpoint. Such as it would be hosted in a production environment.
Not
 sure what the link is, so perhaps somebody else might know if you
wanted
 to see it.

 Brian..



 -Original Message-
 From: flexcoders@yahoogroups.com [mailto: [EMAIL PROTECTED]
On
 Behalf Of securenetfreedom
 Sent: Wednesday, December 20, 2006 1:59 PM
 To: flexcoders@yahoogroups.com
 Subject: [flexcoders] Trace?

 I am coming from Flash Timeline Development to Flex (as opposed to
 coming from C#, Java, etc to Flex). So I have some catching up to do.

 One of the things I find most frustrating is the ability to so a
simple
 trace statement, run the code and watch my traces in an output window.
 Is this possible or is Debug mode the only option?

 I would love any Debug tips as well.

 Thanks for your help.

 Jeff




 --
 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

  Recent Activity
a..  70New Members
  Visit Your Group 
  SPONSORED LINKS
a.. Software development tool 
b.. Software development 
c.. Software development services 
d.. Home design software 
e.. Software development company 
  Search Ads
  Get new customers.

  List your web site

  in Yahoo! Search.

  Y! Toolbar
  Get it Free!

  easy 1-click access

  to your groups.

  Yahoo! Groups
  Start a group

  in 3 easy steps.

  Connect with others.
  . 
   

[flexcoders] Bug in Using the XMLListCollection class Example and the Fix

2006-08-23 Thread Arul





Any one tried this example?

Flex 2 Developer's 
Guide  Building User Interfaces forFlex Applications  Using Data 
Providers and Collections  Using hierarchical data providers  Using an 
XML data provider 

http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Partsfile=0513.html


"Using the XMLListCollection class" example has a 
serious problem, when you delete an item in the List, if it is a leaf node in 
the Tree it gets deleted too

This is happening because of cross references 
that exist (we are directly adding the node toListwhich still 
has references to myData, the tree dataProvider)

Solution to this problem is simple, we need to 
make a copy to add to the list, then everything will be all right

we just need to change the doTreeSelect function 
as follows

  // Add the item selected in 
the Tree to the List XMLList data provider. private function 
doTreeSelect():void 
{ if 
(prodTree.selectedItem) 
listDP.addItem(prodTree.selectedItem.copy()); 
} 
I've attached thebug fixedMXML as 
well

Regards,
Arul

Adobe Community Expert
http://www.shockwave-india.com/blog

__._,_.___





--
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.



  






__,_._,___



XMLListCollectionExample.mxml
Description: Binary data


Re: [flexcoders] Populating a tree with E4X notation

2006-08-23 Thread Arul





Here is the working version :)

Regards,
Arul


?xml version="1.0" encoding="utf-8"?mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"mx:Script![CDATA[mx.collections.XMLListCollection;mx.collections.ArrayCollection; [Bindable] public var myData:XML =catalogcategory name="Companies" //catalog;function buildTree():void{/*you have created tags with the name "name" instead creating attribute *///myData.category.name[0]="Nat West PLC";//myData.category.name[0].name[0]="Nat West Reading";[EMAIL PROTECTED]"Nat West PLC";[EMAIL PROTECTED]"Nat West Reading";}]]/mx:Scriptmx:Panelmx:Tree id="prodTree" dataProvider="{myData}" width="200" showRoot="false" labelField="@name" enabled="true" borderStyle="inset"/mx:Button click="buildTree()" label="Build"//mx:Panel/mx:Application
- Original Message - 

From: "jamiebadman" [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Tuesday, August 22, 2006 6:35 PM
Subject: [flexcoders] Populating a tree with E4X 
notation
 Hi,  Wonder if someone can help... I'm trying to 
build a basic tree using  E4X notation but it's going kinda weird - as 
you can see if you run  the code below, the tree seems to show ok - but 
it also shows the  XML over the top of the tree!  I 
guess I'm doing something quite wrong here - could someone put me  on 
the right track ?  (code below)  Thanks, 
 Jamie.   ?xml version="1.0" 
encoding="utf-8"? mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" 
 layout="absolute"   
mx:Script ![CDATA[ import 
mx.collections.XMLListCollection; import mx.collections.ArrayCollection; 
  [Bindable] public var myData:XML =  
catalog   category name="Companies" 
/  /catalog;   private function 
buildTree():void{  myData.category.name[0]="Nat West 
PLC"; myData.category.name[0].name[0]="Nat West  
Reading"; } ]] /mx:Script  
mx:Panel mx:Tree id="prodTree" dataProvider="{myData}" 
 width="200" showRoot="false" labelField="@name" 
enabled="true"  borderStyle="inset"/ mx:Button 
click="buildTree()" label="Build"/   
/mx:Panel /mx:Application
__._,_.___





--
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.



  






__,_._,___



treeTest.mxml
Description: Binary data


Re: [flexcoders] Tree-to-tree drag drop

2006-08-11 Thread Arul
From Flex2_devguide.pf

Notice that the built-in drag-and-drop functionality of the Tree control 
lets you move items. However, if you want to copy items, you must implement 
your own event listeners for the dragDrop and dragComplete events. For more 
information on these events, see Drag-and-drop events on page 874.
Regards,

Arul

- Original Message - 
From: John Mazzocchi [EMAIL PROTECTED]
To: flexcoders@yahoogroups.com
Sent: Thursday, August 10, 2006 1:47 PM
Subject: [flexcoders] Tree-to-tree drag  drop


 This seems like such a simple thing, and yet ...

 I'd like to be able to drag  drop nodes between 2 trees ... both to copy 
 and to move.

 Now both trees have:
 dragEnabled=true dropEnabled=true.

 Scenario (a): they both have dragMoveEnabled=true ... so while they 
 *will* MOVE nodes between each other, they *won't* COPY them when holding 
 down CTRL-key (as they're supposed to).

 Scenario (b): they both have dragMoveEnabled=false ... by default, the 
 nodes should COPY across, but it doesn't allow this, as if dropEnabled 
 were *false*.

 In short, you can't COPY nodes between them ... do I really need to write 
 my own drag  drop functions? :/

 Thanks
 John


 --
 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






 



--
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

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





Re: [flexcoders] Button icon behaviour (Flex 2.0)

2006-02-14 Thread Arul Prasad



Yes?On 2/15/06, Jason Y. Kwong [EMAIL PROTECTED] wrote:



I've got a Button with its icon property set to a coloured icon. I want the Button to show a greyed out icon when it's disabled, so I set the button's disabledIcon style. But this disabled icon didn't show up when the button is disabled. Turns out that if the icon property is set, it's the only icon that gets displayed in all circumstances. To get the effect I wanted, I had to leave the icon property blank and set 4 styles: upIcon, downIcon, overIcon, disabledIcon. The first 3 are set to the same coloured icon and the last to the grey one. Is this how it's supposed to be done?







--
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 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.