RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter


Alex Harui wrote:
> 
> Can you repost your example?
> 

Its just the very few simple lines I posted a few posts ago in this topic.
Here is the link:

http://www.nabble.com/Re%3A-Best-practice-for-calling-asynchronous-functions--p20969533.html

Its not a full example, but it gives the idea...
-- 
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20988099.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-12 Thread stinasius
hi guys i think am making progress. this is what i have so far.

"login_example.mxml"


http://www.adobe.com/2006/mxml";
layout="absolute" xmlns:view="components.*">












 



"login_form.mxml"


http://www.adobe.com/2006/mxml";
layout="absolute" title="Login Form">   









  







now i would like to connect that to this coldfusion script to have the
cfc match login details from flex and database

"memberservice.cfc"












variables.dsn = 'usr_grp';

 





















   var aMember = createObject("Component","Member").init();







  
   
 


select memID, memUserName, memPassword, 
memFirstName, memLastName,
memEmail
from member
where memUsername = 
and memPassword = 



















 




  








aMember.setMemberID( getMember.memID);
aMember.setUsername( getMember.memUserName);
aMember.setPassword( getMember.memPassword);
aMember.setFirstName( getMember.memFirstName);
aMember.setLastName( getMember.memLastName);
aMember.setEmail( getMember.memEmail);














 
 
 
 
   aMemberDAO = createObject("component",
"MemberDAO").init('fluid_login');
   aMemberDAO.create(aMember);
 


 
 

 
 
 
 










RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Alex Harui
Can you repost your example?

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mark Carter
Sent: Friday, December 12, 2008 6:54 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Best practice for calling asynchronous functions?


For me, the question is: If I use someObj in the same way as my example above
(i.e. assigning it to a local variable), when will someObj get garbage
collected?

Is it (potentially) when the result/fault event is dispatched or could it be
earlier?

Alex Harui wrote:
>
> I think Amy's point is that, w/o a reference to the anonfun, you can't
> call removeEventListener on it. If I do:
>
> someObj.addEventListener("foo", function (e:Event) { ... } );
>
> someObj will release the anonfun when it gets garbage collected. However,
> until that time, all objects in the scope chain won't be collectable. I
> don't know if that's the case in Java.
>

--
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20986882.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Re: Binding Question - ArrayCollection/ResourceBundle

2008-12-12 Thread securenetfreedom
Thanks, Alex.

So I assume a flex button listens for the locale change event and
therefore updates it's label?

Are you saying create say a LocaleArrayCollection class that dispatches
the locale change event?
Or are you saying create LocaleChangeDispatcher that dispatches the
locale change event and the ArrayCollection would then update by virtue
of the dispatched event?

Thanks in advance.

Jeff



--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> You are defining dynamic objects and they are not bindable.  If you
had a class that dispatched an event when the locale changed then it
should work.
>
\
-
> Is it possible to have an ArrayCollection value updated by a resource
bundle value.
> [Bindable]
> public var cbDP:ArrayCollection = new ArrayCollection();
> cbDP.addItem(
{label:ResourceManager.getInstance().getString('myResources','NAME') });
>
> When changing locales at runtime, all label fields of flex components
update but the ArrayCollection does not.
>
> Is the ResourceManager binding ignored on AC's? Is there another
solution?
>
> Thanks,
>
> Jeff
>




RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter

For me, the question is: If I use someObj in the same way as my example above
(i.e. assigning it to a local variable), when will someObj get garbage
collected?

Is it (potentially) when the result/fault event is dispatched or could it be
earlier?


Alex Harui wrote:
> 
> I think Amy's point is that, w/o a reference to the anonfun, you can't
> call removeEventListener on it.  If I do:
> 
> someObj.addEventListener("foo", function (e:Event) { ... } );
> 
> someObj will release the anonfun when it gets garbage collected.  However,
> until that time, all objects in the scope chain won't be collectable.  I
> don't know if that's the case in Java.
> 

-- 
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20986882.html
Sent from the FlexCoders mailing list archive at Nabble.com.



Re: [flexcoders] Getting NULL Object Reference while deleting last element of the list

2008-12-12 Thread anuj sharma
Hi Marco
I fixed it in the first loop i need to get rid of -1 to finish the loop
correctly, its been fixed now
Thanks for your help
Anuj

On Fri, Dec 12, 2008 at 4:02 AM, Marco Catunda wrote:

>   Anuj,
>
> I think there is something wrong with this structure. Why make it into for
> loop?
> The _addToAssociatedDevicesArr is received the same value
>
>
> for(var i:*=0;i<_addDevicesLen-1;i++)
> {
> _addToAssociatedDevicesArr=nvrsInPoolList.selectedItems;
> }
>
> The last loop has the same problem. The index variable t is never used.
> Why it is in for loop?
>
> for(var t:*=0;t<_addToAssociatedDevicesArr.length;t++)
> {
> if(nvrsInPoolList!=null)
> {
>
> IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex);
> }
> }
>
> About the problem you complain
>
> I think one of this variable is null value:
>
> camerasInPoolList
> arrAddToPool
> arrRemoveFromPool
>
> --
> Marco Catunda
>
>
> On Thu, Dec 11, 2008 at 7:33 PM, anuj181 
> >
> wrote:
> > Hi Guys
> > I am trying to implement the delete entries of the list box. The code
> > works fine till the last entry, when i am trying to delete the last
> > item after selection it is throwing error TypeError: Error #1009:
> > Cannot access a property or method of a null object reference.
> > I have seen this error so many times but I am not sure how will i fix
> > this in the following code. Please help me in fixing this error
> > Thanks
> > Anuj
> >
> > /*CODE*/
> >
> >  > click="addToAssociatedDevices(event)"/>
> >
> > private function addToAssociatedDevices(evt:MouseEvent):void
> > {
> > var _addDevicesLen:int=devicesInList.length;
> > var _addToAssociatedDevicesArr:Array;
> >
> >
> > for(var i:*=0;i<_addDevicesLen-1;i++)
> > {
> > _addToAssociatedDevicesArr=nvrsInPoolList.selectedItems;
> >
> >
> > }
> > if((_addToAssociatedDevicesArr is
> > Array)&&(_addToAssociatedDevicesArr!=null))
> > {
> > var removeIndex:int = 0;
> > for each (var addItemVal:* in _addToAssociatedDevicesArr)
> > {
> > if(addItemVal!=null)
> > {
> >
> > IList(camerasInPoolList.dataProvider).addItem(addItemVal as Object);
> > //Adds a device to the Add To Camera Pool list
> > arrAddToPool.push(addItemVal);
> > //Removes a device from the Remove From Pool list
> > removeIndex = arrRemoveFromPool.indexOf(addItemVal);
> > if(removeIndex > -1) {
> > arrRemoveFromPool.splice(removeIndex,1);
> > }
> > }
> > }
> >
> > }
> > for(var t:*=0;t<_addToAssociatedDevicesArr.length;t++)
> > {
> > if(nvrsInPoolList!=null)
> > {
> >
> >
> IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex);
> > }
> > }
> > }
> >
> >
>  
>


Re: [flexcoders] Filtering the List Entries depending upon the text entered in text Input box

2008-12-12 Thread anuj sharma
Hi Alex
Sorry to get back so late, we had release for couple of days, With you
suggestion I made it working which means it is filtering but now it is
showing the complete XML list , Is there any way I can only show the
attribute with the friendly-name.Like suggested, i put everything in
XMListCollection instead of ArrayCollection which makes it enabel to loop
throught the whoel list but that fixing raises the display issue.I am doing
something wrong here which screwed labelfunction assignfriendlyname for the
list.Please let me know how would we fix that. Many Many thanks for your
help.
Anuj

/*Revised Code*/
//XML File




monitoring
2.0
location
Camera1
AIR




/**CODE*/
//This is REST CALL


//THis makes call to server
devicesXML.url="http://"+IP+"/config/devices";;

[Bindable]
private var filteredDevices:XMLListCollection;
//Thid function is called when values are retreived
private function devicesXMLHandler(event:ResultEvent):void
{
devicesList = event.result.device;

//Changed

filteredDevices=new XMLListCollection(devicesList);

//Checks every device
for each (var devicesInPool:* in devicesList) {
var deviceName:String = devicesinpo...@id;
//var label:string=devicesinpo...@id;
devicesInList.push(deviceName);


nvrsInPoolList.dataProvider = filteredDevices;
filteredDevices.filterFunction=processFilter
}

//This function calls for assigning label for the entries in the List
box named nvsInPoolList

private function assignFriendlyName(item:Object):String
{
//Checks every device
for each (var devicesID:* in devicesList) {
var deviceName:String = devices...@id;
//Checks if the current deviceID matches the current item, if so
it will search its attributes
if(deviceName == item.toString()) {
var devicesText:XMLList =
devicesID.child("attributes").child("attribute");
//Checks every attribute tag for each device
for each (var attributesFriendlyName:* in devicesText) {
//Checks if the attribute name is friendly-name
if(attributesfriendlyna...@name == 'friendly-name') {
var friendlynameText:String = attributesFriendlyName.toString();
return friendlynameText;
}
}

}
}
return item.toString();
}
//Filtering Data in the Device List

private function processFilter(item:Object):Boolean
{
return
String(item).toUpperCase().indexOf(filterText.toUpperCase()) >= 0;
}
//Tracking the typed Camera Name
private function doChange():void
{
if(txtSearch.text!=null)
{
this.filterText=txtSearch.text;
this.filteredDevices.refresh();
}
}






On Tue, Dec 9, 2008 at 8:28 PM, Alex Harui  wrote:

>I'd try using XMLListCollection instead of ArrayCollection
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *anuj sharma
> *Sent:* Tuesday, December 09, 2008 5:05 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Filtering the List Entries depending upon the
> text entered in text Input box
>
>
>
> Sorry Guys
> I posted another mail in the group. I thought it was working but it is not
> going through each node, it is just comparing with the id of the first node
> of my XML , Below is the code , I apologize for jumping to the conclusion
> that it is working as initially it seems like. I am doing somethign wrong
> which makes my code not to loop through each and every node but just
> matching it with the id of the first node of my XML,
> Please help me guys to resolve this problem
>
> //XML File
> 
> 
> 
> 
> monitoring
> 2.0
> location
> Camera1
> AIR
> 
> 
> 
> 
> /**CODE*/
> //This is REST CALL
>  result="devicesXMLHandler(event)" showBusyCursor="true">
> 
> //THis makes call to server
> devicesXML.url="http://"+IP+"/config/devices";;
> //Thid function is called when values are retreived
> private function devicesXMLHandler(event:ResultEvent):void
> {
> devicesList = event.result.device;
>
> //Checks every device
> for each (var devicesInPool:* in devicesList) {
> var deviceName:String = devicesinpo...@id;
> //var label:string=devicesinpo...@id;
> devicesInList.push(deviceName);
> filteredDevices=new ArrayCollection(devicesInList);
>
> nvrsInPoolList.dataProvider = filteredDevices;
> filteredDevices.filterFunction=processFilter;
> }
>
> //This function calls for assigning label for the entries in the List
> box named nvsInPoolList
>
> private function assignFriendlyName(item:Object):String
> {
> //Checks every device
> for each (var devicesID:* in devicesList) {
> var deviceName:String = devices...@id;
> //Checks if the current deviceID matches the current item, if so
> it will search its attributes
> if(deviceName == item.toString()) {
> var devicesText:XMLList =
> devicesID.child("attributes").child("attribute");
> //Checks every attribute tag for each device
> for each (var attributesFriendlyName:* in devicesText) {
> //Checks if the attribute name is friendly-name
> if(attributesfriendlyna...@name == 'friendly-name') {
> var friendlynameText:String = attribute

RE: [flexcoders] Am i high?

2008-12-12 Thread Gordon Smith
I've noticed this using the MAX build of Flex Builder 4 (Windows, standalone), 
pointed at the trunk SDK.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of djhatrick
Sent: Thursday, December 11, 2008 12:40 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Am i high?


or does it seem sometimes that flex4 (using 3.2 sdk) doesn't always
recompile? Anybody noticed this, I'm on a mac.

Thanks,
Patrick



RE: [flexcoders] Re: speed of the "for each" looping

2008-12-12 Thread Gordon Smith
In section 12.6.4, "The for-in statement", of the ECMA-262 spec, it says

The mechanics of enumerating the properties (step 5 in the first algorithm, 
step 6 in the second) is
implementation dependent.

I don't see anything in the spec about Array being an exception and having a 
guaranteed for-in order. So I think an Array or ArrayCollection implementation 
is free to execute a for-in loop in any order it wants.

Gordon Smith
Adobe Flex SDK Team

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Alex Harui
Sent: Thursday, December 11, 2008 11:33 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Re: speed of the "for each" looping

Funny.   I didn't realize we were talking about iterating arrays with for..in 
until just now.  I don't think we do that in Flex code.  If the docs say arrays 
will iterate via for..in in index order then I'd probably trust that, 
especially if you stuff your arrays in index order

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Dave Cragg
Sent: Thursday, December 11, 2008 3:08 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Re: speed of the "for each" looping


Could you clarify this? Does this non-guarantee apply to numerically indexed 
arrays and ArrayCollections too? Or just to associative arrays and object 
properties?

The docs imply that the order is maintained by for...in with numerically 
indexed arrays. It would be a big change if that were not the case.

Cheers
Dave

On 10 Dec 2008, at 23:00, Gordon Smith wrote:




So don't use for..in or for each... in if you care about the enumeration order. 
It could very possibly change in future versions of the Flash Player.

 &n! bsp;   
&nbs! p;
Gordon Smith
Adobe Flex SDK



[flexcoders] Re: Maintaining scale when resizing tag

2008-12-12 Thread Ivo
So the solution was to set the scaleX & scaleY after I know the
dimensions of the stage. Add an event listener for added to stage and
resize, then calculate the scaling factor that will make the longest
side of the app fit into the longest side of the stage then apply the
scaling to both scaleX and scaleY .

Thanks,

- Ivo

--- In flexcoders@yahoogroups.com, ivo  wrote:
>
> Hello listers,
> 
> I have a Flex App with scaleMode set to StageScaleMode.SHOW_ALL, the
Application tag dimension set to 300x500 and it scaled perfectly when
modifying the dimensions of the  tag.
> 
> To make things cleaner I removed all the AS3 code from the
Application MXML file and placed it in an AS3 class that extends
Application (BaseApp.as). I then updated the MXML file to have
 as the root tag with dimension still at
300x500. Now I find that the scale mode is not preserved correctly
when modifying the dimensions of the  tag. The UI content in
the MXML scales down way farther that the embed dimensions.
> 
> If I sized the embed tag at 150x250 I see the flash content takes up
those dimensions but the visual content provided by the MXML subclass
is scaled down to 90x120 .
> 
> If I move the dimensions from the MXML subclass to the base class
then the content is scaled even further to like 45x75
> 
> Can anyone help me understand what is going on and how I can make
the content scale correctly?
> 
> Thanks,
> 
> - Ivo
>




Re: [flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-12 Thread Andriy Panas
Hi Dave,

I aslo Flex Builder 3.0.2 as Flex Builder Plug-in with Eclipse 3.4 on
Windows XP - no problems noticed.

--
Med venlig hilsen / Best regards
Andriy Panas
a.pa...@gmail.com


Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
Yes, that's what we did!  Thanks, team!


On Fri, Dec 12, 2008 at 2:55 PM, Alex Harui  wrote:

>In theory, if you take the VBox and its innards and put them in their
> own MXML file it should work.
>
>
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Michael Prescott
> *Sent:* Friday, December 12, 2008 11:17 AM
>
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It still seems to be true.
>
> Yes, I can see that before repeaters are involved, but the detail popup
> creates a relationship between a pair of components - so once I get to an
> array of such pairs, it seemed like I'd need a detail popup for each pair.
> It's stateful, and it would get muddled up if one detail popup was trying to
> coordinate multiple pairs of controls.  (Basically, I wanted the repeater to
> manage instances of the detail popup as well.)
>
> Michael
>
> On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt 
> wrote:
>
> It IS, or at least was, the case that non-visual components must be at the
> root mxml scope.  I will try to find it documented.
>
>
>
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Rick Winscot
> *Sent:* Friday, December 12, 2008 1:25 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It's difficult to determine what your problem is without knowing a little
> more about what your DetailPopUp does/is. If you post some code it would be
> far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>  
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>  
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>
>
>   
>


RE: [flexcoders] Re: Best Practices: ArrayCollection of custom objects?

2008-12-12 Thread Alex Harui
There's no way to make a function parameter more "narrow" in an override, or 
have multiple signatures for functions, so there's no way to catch this at 
compile time.  You can hint the MXML compiler, but not AS, and usually you 
stuff your AC from AS.

The only thing we do is throw an error at runtime.  I suppose you could wrap 
the whole thing, or copy the code and change signatures.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of burttram
Sent: Friday, December 12, 2008 11:15 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Best Practices: ArrayCollection of custom objects?


Is this such a trivial question that people are passing up replying
in lieu of bringing light to my ignorance, or are there really no best
practices to speak of here?

The only way I've found so far to do this is to deprecate the
overridden method, but even then from time to time we'll get a strange
error (this doesn't happen all of the time):

1021: Duplicate function definition.

Seems pretty obvious what's causing it, but we have other classes that
use this same syntax that aren't generating the error...

Is there any reason we shouldn't do this, or is there another, more
acceptable way to accomplish what we're trying to do here?

public class DataTypes extends ArrayCollection
{
public function DataTypes(){
}

[Deprecated]
override public function addItem(item:Object):void{
}

public function addItem(item:DataType):void{
super.addItem(item);
}
}



RE: [flexcoders] Binding Question - ArrayCollection/ResourceBundle

2008-12-12 Thread Alex Harui
You are defining dynamic objects and they are not bindable.  If you had a class 
that dispatched an event when the locale changed then it should work.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of securenetfreedom
Sent: Friday, December 12, 2008 9:39 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Binding Question - ArrayCollection/ResourceBundle


Is it possible to have an ArrayCollection value updated by a resource bundle 
value.
[Bindable]
public var cbDP:ArrayCollection = new ArrayCollection();
cbDP.addItem( 
{label:ResourceManager.getInstance().getString('myResources','NAME') });

When changing locales at runtime, all label fields of flex components update 
but the ArrayCollection does not.

Is the ResourceManager binding ignored on AC's? Is there another solution?

Thanks,

Jeff



RE: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Alex Harui
In theory, if you take the VBox and its innards and put them in their own MXML 
file it should work.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Michael Prescott
Sent: Friday, December 12, 2008 11:17 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Restrictions on non-visual component placement


It still seems to be true.

Yes, I can see that before repeaters are involved, but the detail popup creates 
a relationship between a pair of components - so once I get to an array of such 
pairs, it seemed like I'd need a detail popup for each pair.  It's stateful, 
and it would get muddled up if one detail popup was trying to coordinate 
multiple pairs of controls.  (Basically, I wanted the repeater to manage 
instances of the detail popup as well.)

Michael
On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt 
mailto:tspr...@lariatinc.com>> wrote:

It IS, or at least was, the case that non-visual components must be at the root 
mxml scope.  I will try to find it documented.



If the component is non-visual, then it does not matter, functionally speaking, 
where in the DOM it goes.



Tracy





From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On 
Behalf Of Rick Winscot
Sent: Friday, December 12, 2008 1:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Restrictions on non-visual component placement



It's difficult to determine what your problem is without knowing a little more 
about what your DetailPopUp does/is. If you post some code it would be far 
easier to determine why one context works and another doesn't. Generally... I 
wouldn't recommend mingling non-visual and visual components in mxml.

Your error basically says that your non-visual component doesn't have an 
appropriate interface for the context you are placing it in. e.g. It should be 
a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
http://michael.r.presc...@gmail.com>> wrote:



Short version:

I have a non-visual component that I'm trying to declare in a repeater, but it 
seems that MXML doesn't allow this.  Is this true?  How do you get around this, 
create a visual component to wrap the non-visual component?

Long version:

I have an ActionScript non-visual component whose declaration looks like this:

public class DetailPopup extends EventDispatcher implements IMXMLObject

I've used this successfully inside an inline, MXML item renderer, like this:

 

  


  

  


  

  


Now that I'm switching from a DataGrid to a Grid, the code ought to look like 
this:

 


  

(X)   


  

..except that I'm getting an error, "Component declarations are not allowed 
here. (Note: visual children must implement IUIComponent.)"

After trying out a bunch of scenarios, it looks like non-visual components can 
only be declared in the outermost scope of a component or application.  Is this 
true?  This is rather awkward, as I need a DetailPopUp for each griditem.

Any tips would be very helpful!

Michael






[flexcoders] Re: ASDoc for main MXML document?

2008-12-12 Thread oneworld95
Found this: http://blogs.adobe.com/flexdoc/2008/11/

-Alex

--- In flexcoders@yahoogroups.com, "oneworld95"  wrote:
>
> How do you use the ASDoc tool to generate documentation for the main
> application file? For example, if you've got MyApp.mxml and it
> contains a ton of ActionScript code (with the /** */ comments), how do
> you generate documentation from that? Thanks.
>




Re: [flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-12 Thread Pedro Sena
Ops,

I forgot to say:

In windows XP.

Regards,

Pedro Sena

On Fri, Dec 12, 2008 at 4:46 PM, Pedro Sena  wrote:

> I'm running Eclipse 3.4 + FB 3.0.2 w/o problems.
>
> Regards,
>
> Pedro Sena
>
>
> On Fri, Dec 12, 2008 at 4:33 PM, Dave Kong  wrote:
>
>>   From here:
>>
>> http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_fb.html#install_plugin_win
>> Install Flex Builder Plug-in on Windows
>>
>> *NOTE*: Flex Builder is only supported on Eclipse 3.2.2 or Eclipse 3.3.
>>
>> where as:
>>
>> *Install Flex Builder Plug-in on Mac OS X*
>>
>> *NOTE*: Builder is only supported on Eclipse 3.2.2, Eclipse 3.3 and
>> Eclipse 3.4.
>>
>> So, the plugin supports 3.4 on Mac ONLY? Is this a doc error?
>>  
>>
>
>
>
> --
> /**
> * Pedro Sena
> * Systems Architect
> * Sun Certified Java Programmer
> * Sun Certified Web Component Developer
> */
>



-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


Re: [flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-12 Thread Pedro Sena
I'm running Eclipse 3.4 + FB 3.0.2 w/o problems.

Regards,

Pedro Sena

On Fri, Dec 12, 2008 at 4:33 PM, Dave Kong  wrote:

>   From here:
>
> http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_fb.html#install_plugin_win
> Install Flex Builder Plug-in on Windows
>
> *NOTE*: Flex Builder is only supported on Eclipse 3.2.2 or Eclipse 3.3.
>
> where as:
>
> *Install Flex Builder Plug-in on Mac OS X*
>
> *NOTE*: Builder is only supported on Eclipse 3.2.2, Eclipse 3.3 and
> Eclipse 3.4.
>
> So, the plugin supports 3.4 on Mac ONLY? Is this a doc error?
>  
>



-- 
/**
* Pedro Sena
* Systems Architect
* Sun Certified Java Programmer
* Sun Certified Web Component Developer
*/


[flexcoders] Does Flex builder 3.0.2 eclipse plug-in work in Eclipse 3.4?

2008-12-12 Thread Dave Kong
>From here:
http://www.adobe.com/support/documentation/en/flex/3/releasenotes_flex3_fb.html#install_plugin_win
Install Flex Builder Plug-in on Windows

*NOTE*: Flex Builder is only supported on Eclipse 3.2.2 or Eclipse 3.3.

where as:

*Install Flex Builder Plug-in on Mac OS X*

*NOTE*: Builder is only supported on Eclipse 3.2.2, Eclipse 3.3 and Eclipse
3.4.

So, the plugin supports 3.4 on Mac ONLY? Is this a doc error?


[flexcoders] Re: Best practice for calling asynchronous functions?

2008-12-12 Thread Amy
--- In flexcoders@yahoogroups.com, Alex Harui  wrote:
>
> I think Amy's point is that, w/o a reference to the anonfun, you 
can't call removeEventListener on it.  If I do:
> 
> someObj.addEventListener("foo", function (e:Event) { ... } );
> 
> someObj will release the anonfun when it gets garbage collected.  
However, until that time, all objects in the scope chain won't be 
collectable.  I don't know if that's the case in Java.

Yes, that's what I meant.  I guess it depends on how you're setting 
up someObj as to whether someObj would be eligible for garbage 
collection itself.  But the event listeners can't be released 
independently, except if the thing Ralf suggested works (interesting 
suggestion, Ralf...I use arguments.callee for other things sometimes 
myself...never thought of using it that was).

Honestly, the reason I don't use anonymous functions is that they 
don't "feel" like good coding practice to me.

-Amy



[flexcoders] ASDoc for main MXML document?

2008-12-12 Thread oneworld95
How do you use the ASDoc tool to generate documentation for the main
application file? For example, if you've got MyApp.mxml and it
contains a ton of ActionScript code (with the /** */ comments), how do
you generate documentation from that? Thanks.



Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
It still seems to be true.

Yes, I can see that before repeaters are involved, but the detail popup
creates a relationship between a pair of components - so once I get to an
array of such pairs, it seemed like I'd need a detail popup for each pair.
It's stateful, and it would get muddled up if one detail popup was trying to
coordinate multiple pairs of controls.  (Basically, I wanted the repeater to
manage instances of the detail popup as well.)

Michael

On Fri, Dec 12, 2008 at 2:18 PM, Tracy Spratt  wrote:

>It IS, or at least was, the case that non-visual components must be at
> the root mxml scope.  I will try to find it documented.
>
>
>
> If the component is non-visual, then it does not matter, functionally
> speaking, where in the DOM it goes.
>
>
>
> Tracy
>
>
>  --
>
> *From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] *On
> Behalf Of *Rick Winscot
> *Sent:* Friday, December 12, 2008 1:25 PM
> *To:* flexcoders@yahoogroups.com
> *Subject:* Re: [flexcoders] Restrictions on non-visual component placement
>
>
>
> It's difficult to determine what your problem is without knowing a little
> more about what your DetailPopUp does/is. If you post some code it would be
> far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>  
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>  
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>   
>


[flexcoders] Re: Best Practices: ArrayCollection of custom objects?

2008-12-12 Thread burttram
Is this such a trivial question that people are passing up replying
in lieu of bringing light to my ignorance, or are there really no best
practices to speak of here?

The only way I've found so far to do this is to deprecate the
overridden method, but even then from time to time we'll get a strange
error (this doesn't happen all of the time):

1021: Duplicate function definition.

Seems pretty obvious what's causing it, but we have other classes that
use this same syntax that aren't generating the error...

Is there any reason we shouldn't do this, or is there another, more
acceptable way to accomplish what we're trying to do here?

public class DataTypes extends ArrayCollection
{
public function DataTypes(){
}

[Deprecated]
override public function addItem(item:Object):void{
}

public function addItem(item:DataType):void{
super.addItem(item);
}
}



RE: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Tracy Spratt
It IS, or at least was, the case that non-visual components must be at
the root mxml scope.  I will try to find it documented.

 

If the component is non-visual, then it does not matter, functionally
speaking, where in the DOM it goes.

 

Tracy

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of Rick Winscot
Sent: Friday, December 12, 2008 1:25 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Restrictions on non-visual component placement

 

It's difficult to determine what your problem is without knowing a
little more about what your DetailPopUp does/is. If you post some code
it would be far easier to determine why one context works and another
doesn't. Generally... I wouldn't recommend mingling non-visual and
visual components in mxml. 

Your error basically says that your non-visual component doesn't have an
appropriate interface for the context you are placing it in. e.g. It
should be a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
 

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
wrote:


 

Short version:

I have a non-visual component that I'm trying to declare in a
repeater, but it seems that MXML doesn't allow this.  Is this true?  How
do you get around this, create a visual component to wrap the non-visual
component?

Long version:

I have an ActionScript non-visual component whose declaration
looks like this:

public class DetailPopup extends EventDispatcher implements
IMXMLObject

I've used this successfully inside an inline, MXML item
renderer, like this:

 

  


  

  


  

  


Now that I'm switching from a DataGrid to a Grid, the code ought
to look like this:

 


  

(X)   


  

..except that I'm getting an error, "Component declarations are
not allowed here. (Note: visual children must implement IUIComponent.)"

After trying out a bunch of scenarios, it looks like non-visual
components can only be declared in the outermost scope of a component or
application.  Is this true?  This is rather awkward, as I need a
DetailPopUp for each griditem.

Any tips would be very helpful!

Michael
 


 



Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
I think that might be a distraction, I was asking a question about the rules
of MXML, rather than asking for debugging help for my non-visual component.

But just for fun, I'll explain!  I was looking for a way to reuse the nice
way that PopUpButton manages its pop-up, so I created a non-visual component
that you could use to orchestrate "popping up" on rollover or on focus.



  



This works really well, and we use it in a few places so we can use ad hoc
detail pop-ups.  We've even used it inside a datagrid item renderer:


  


  


  


When we switched to a grid with a repeater, I discovered the prohibition on
nonvisual components that weren't parent of the root tag.

  
  
  

  
(x)   
   

So the solution appears to be to take the guts and put it in its own
component definition, and then do this:


  


Michael

On Fri, Dec 12, 2008 at 1:25 PM, Rick Winscot wrote:

>It's difficult to determine what your problem is without knowing a
> little more about what your DetailPopUp does/is. If you post some code it
> would be far easier to determine why one context works and another doesn't.
> Generally... I wouldn't recommend mingling non-visual and visual components
> in mxml.
>
> Your error basically says that your non-visual component doesn't have an
> appropriate interface for the context you are placing it in. e.g. It should
> be a IUIComponent.
>
> http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html
>
> Rick Winscot
>
>
>
> On 12/12/08 12:49 PM, "Michael Prescott" 
> wrote:
>
>
>
>
> *Short version:
> *
> I have a non-visual component that I'm trying to declare in a repeater, but
> it seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
>
> *Long version:
> *
> I have an ActionScript non-visual component whose declaration looks like
> this:
>
> public class DetailPopup extends EventDispatcher implements IMXMLObject
>
> I've used this successfully inside an inline, MXML item renderer, like
> this:
>
>   
> 
>   
> 
>
>   
>
>   
>
> 
>   
> 
>   
>
>
> Now that I'm switching from a DataGrid to a Grid, the code ought to look
> like this:
>
>   
> 
>
>   
>
> (X)   
>
> 
>   
>
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
>
> After trying out a bunch of scenarios, it looks like non-visual components
> can only be declared in the outermost scope of a component or application.
>  Is this true?  This is rather awkward, as I need a DetailPopUp for each
> griditem.
>
> Any tips would be very helpful!
>
> Michael
>
>
>
>  
>


Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Ralf Bokelberg
You can use arguments.callee to let a anonymous listener remove itself.

Cheers
Ralf.



On Fri, Dec 12, 2008 at 7:23 PM, Alex Harui  wrote:
> I think Amy's point is that, w/o a reference to the anonfun, you can't call
> removeEventListener on it.  If I do:
>
>
>
> someObj.addEventListener("foo", function (e:Event) { … } );
>
>
>
> someObj will release the anonfun when it gets garbage collected.  However,
> until that time, all objects in the scope chain won't be collectable.  I
> don't know if that's the case in Java.
>
>
>
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
> Behalf Of Mark Carter
> Sent: Friday, December 12, 2008 6:28 AM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Best practice for calling asynchronous functions?
>
>
>
> So are you saying that, in general, anonymous functions should not be used
> as
> listeners?
>
> If its anything like in Java, (once the calling method returned) the
> anonymous function would only be referenced by the event dispatcher and so
> (assuming weak references are not used) would only be garbage collected when
> the event dispatcher is garbage collected. At least, that's how I understand
> it.
>
> I posted a question about this a few weeks ago, but didn't get a reply.
>
> Amy-28 wrote:
>>
>> My understanding is that anonymous functions _cannot_ get garbage
>> collected unless you use weak references when you add them. Which
>> means there's a really good chance they'll get garbage collected
>> before they get called.
>>
>
> --
> View this message in context:
> http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20976648.html
> Sent from the FlexCoders mailing list archive at Nabble.com.
>
> 



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

<*> 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:flexcoders-dig...@yahoogroups.com 
mailto:flexcoders-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
flexcoders-unsubscr...@yahoogroups.com

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



Re: [flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Rick Winscot
It¹s difficult to determine what your problem is without knowing a little
more about what your DetailPopUp does/is. If you post some code it would be
far easier to determine why one context works and another doesn¹t.
Generally... I wouldn¹t recommend mingling non-visual and visual components
in mxml. 

Your error basically says that your non-visual component doesn¹t have an
appropriate interface for the context you are placing it in. e.g. It should
be a IUIComponent.

http://livedocs.adobe.com/flex/201/langref/mx/core/IUIComponent.html

Rick Winscot


On 12/12/08 12:49 PM, "Michael Prescott" 
wrote:

>  
>  
> 
> Short version:
> 
> I have a non-visual component that I'm trying to declare in a repeater, but it
> seems that MXML doesn't allow this.  Is this true?  How do you get around
> this, create a visual component to wrap the non-visual component?
> 
> Long version:
> 
> I have an ActionScript non-visual component whose declaration looks like this:
> 
> public class DetailPopup extends EventDispatcher implements IMXMLObject
> 
> I've used this successfully inside an inline, MXML item renderer, like this:
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
> Now that I'm switching from a DataGrid to a Grid, the code ought to look like
> this:
> 
>   
> 
> 
>   
> 
> (X)   
> 
> 
>   
> 
> ..except that I'm getting an error, "Component declarations are not allowed
> here. (Note: visual children must implement IUIComponent.)"
> 
> After trying out a bunch of scenarios, it looks like non-visual components can
> only be declared in the outermost scope of a component or application.  Is
> this true?  This is rather awkward, as I need a DetailPopUp for each griditem.
> 
> Any tips would be very helpful!
> 
> Michael
>  
> 



RE: [flexcoders] BadPaddingException using RTMPS

2008-12-12 Thread Jeff Vroom
Are you running the released version of 2.6?   There was a bug in RTMPS in that 
version which is fixed in a hotfix or in 2.6.1 that might cause this type of 
error intermittently.

Jeff

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of taze170171
Sent: Friday, December 12, 2008 5:52 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] BadPaddingException using RTMPS


Hello!

We are using AIR, LCDS (running on a JBoss) and an RTMPS connection.
Sometimes we get the following exception, when the AIR client tries
to connect to the server:

[Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed to
read Connection 'xxx' or process the data; Connection is in
the 'Handshaking' state and will be forced closed.
javax.net.ssl.SSLHandshakeException: Invalid padding
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:150)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1417)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:874)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
(SSLEngineImpl.java:787)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
(SSLEngineImpl.java:663)
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566)
at flex.messaging.socketserver.SSLConnection.handshake
(SSLConnection.java:301)
at flex.messaging.socketserver.Connection$ConnectionReader.run
(Connection.java:761)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.runTask(ThreadPoolExecutor.java:665)
at
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:595)

Caused by: javax.crypto.BadPaddingException: Padding length invalid:
244
at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
(CipherBox.java:442)
at com.sun.net.ssl.internal.ssl.CipherBox.decrypt(CipherBox.java:290)
at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
(InputRecord.java:153)
at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
(EngineInputRecord.java:238)
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:856)
... 8 more

Can anybody help?

Thanks in advance,
Taze

<><>

RE: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Alex Harui
I think Amy's point is that, w/o a reference to the anonfun, you can't call 
removeEventListener on it.  If I do:

someObj.addEventListener("foo", function (e:Event) { ... } );

someObj will release the anonfun when it gets garbage collected.  However, 
until that time, all objects in the scope chain won't be collectable.  I don't 
know if that's the case in Java.

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Mark Carter
Sent: Friday, December 12, 2008 6:28 AM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Best practice for calling asynchronous functions?


So are you saying that, in general, anonymous functions should not be used as
listeners?

If its anything like in Java, (once the calling method returned) the
anonymous function would only be referenced by the event dispatcher and so
(assuming weak references are not used) would only be garbage collected when
the event dispatcher is garbage collected. At least, that's how I understand
it.

I posted a question about this a few weeks ago, but didn't get a reply.

Amy-28 wrote:
>
> My understanding is that anonymous functions _cannot_ get garbage
> collected unless you use weak references when you add them. Which
> means there's a really good chance they'll get garbage collected
> before they get called.
>

--
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20976648.html
Sent from the FlexCoders mailing list archive at Nabble.com.



RE: [flexcoders] Re: AS ResourceBundle Keys with Args?

2008-12-12 Thread Alex Harui
Pretty sure it is just:

rb.content["DISTANCE_FORMAT"] = "{0} miles"; //?? does not like {0}

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of securenetfreedom
Sent: Friday, December 12, 2008 10:01 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: AS ResourceBundle Keys with Args?


Let me clarify. I am trying to use argument placeholders in my ActionScript 
created Resource Bundle.

In a .properties file, you would write:
DISTANCE_FORMAT={0} miles

So how would you do the same in ActionScript? The compiler does not like the 
curly braces {}?
rb.content["DISTANCE_FORMAT"] = {0} miles; //?? does not like {0}

Thanks,
Jeff



--- In flexcoders@yahoogroups.com, "securenetfreedom"  wrote:
>
> I am creating ActionScript ResourceBundles.
> Is possible to create a resource key/value via AS that allows arguments
> like:
>
> rb.content["DISTANCE_FORMAT"] = {0} miles;
>
> I am getting key/value pairs from a database so I will be creating the
> RBs at runtime. So will be looping thru the r! esult set with something
> like:
>
> rb.content[record[i].key] = {0} record[i].value;
>
> Thanks,
>
> Jeff
>



[flexcoders] Re: AS ResourceBundle Keys with Args?

2008-12-12 Thread securenetfreedom
Let me clarify. I am trying to use argument placeholders in my
ActionScript created Resource Bundle.

In a .properties file, you would write:
DISTANCE_FORMAT={0} miles

So how would you do the same in ActionScript? The compiler does not like
the curly braces {}?
rb.content["DISTANCE_FORMAT"] = {0} miles; //?? does not like {0}

Thanks,
Jeff



--- In flexcoders@yahoogroups.com, "securenetfreedom" 
wrote:
>
> I am creating ActionScript ResourceBundles.
> Is possible to create a resource key/value via AS that allows
arguments
> like:
>
> rb.content["DISTANCE_FORMAT"] = {0} miles;
>
> I am getting key/value pairs from a database so I will be creating the
> RBs at runtime. So will be looping thru the result set with something
> like:
>
> rb.content[record[i].key] = {0} record[i].value;
>
> Thanks,
>
> Jeff
>



[flexcoders] Restrictions on non-visual component placement

2008-12-12 Thread Michael Prescott
*Short version:*

I have a non-visual component that I'm trying to declare in a repeater, but
it seems that MXML doesn't allow this.  Is this true?  How do you get around
this, create a visual component to wrap the non-visual component?

*Long version:*

I have an ActionScript non-visual component whose declaration looks like
this:

public class DetailPopup extends EventDispatcher implements IMXMLObject

I've used this successfully inside an inline, MXML item renderer, like this:

  

  


  

  


  

  


Now that I'm switching from a DataGrid to a Grid, the code ought to look
like this:

  


  

(X)   


  

..except that I'm getting an error, "Component declarations are not allowed
here. (Note: visual children must implement IUIComponent.)"

After trying out a bunch of scenarios, it looks like non-visual components
can only be declared in the outermost scope of a component or application.
Is this true?  This is rather awkward, as I need a DetailPopUp for each
griditem.

Any tips would be very helpful!

Michael


[flexcoders] Binding Question - ArrayCollection/ResourceBundle

2008-12-12 Thread securenetfreedom
Is it possible to have an ArrayCollection value updated by a resource
bundle value.

[Bindable]
public var cbDP:ArrayCollection = new ArrayCollection();
cbDP.addItem(
{label:ResourceManager.getInstance().getString('myResources','NAME') });

When changing locales at runtime, all label fields of flex components
update but the ArrayCollection does not.

Is the ResourceManager binding ignored on AC's? Is there another
solution?

Thanks,

Jeff




RE: [flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-12 Thread Tracy Spratt
Just change the word "php" to "cold Fusion".  The rest of the solution
is the same.

Tracy

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Friday, December 12, 2008 8:14 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: flex login popup help needed please

 

hi tracy i dont know php. i use coldfusion. a coldfusion remedy would
be good. thanks

 



Re: [flexcoders] How to Connect flex To java...

2008-12-12 Thread Vivian Richard
  Please go through this link :

http://coenraets.org/blog/2008/11/my-max-lcdsblazeds-sessions-materials-available/




On Thu, Dec 11, 2008 at 11:37 PM, jayapalkasarla
 wrote:
> i am using Tomcat web server(my Tomcat integrated with LCDS).
>
> can u Give the Folder Structure of my web application using Java...
>
> what are the jar are required and also xml files
>
> and configuration of xml Files.like web.xml,config.xml,services.xml
>
> 


Re: [flexcoders] Screen Resolution

2008-12-12 Thread Jules Suggate
Yep, and don't forget constraint-based layouts

http://livedocs.adobe.com/flex/3/html/help.html?content=size_position_5.html

On Sat, Dec 13, 2008 at 03:37, narayana e  wrote:
>
> Hi
>
> i know your problem. u can use percentage values for flex compents
> width,height
>
> and one more option is  horizontalScrollPolicy="off" ,
> verticalScrollPolicy="off"
>
>
>
> example
>
>
>  verticalScrollPolicy="off">
>
>
> 
>
>
> u can get result
>
> --- On Fri, 12/12/08, kotha poornima  wrote:
>
> From: kotha poornima 
> Subject: [flexcoders] Screen Resolution
> To: "flexcoders" 
> Date: Friday, 12 December, 2008, 9:27 AM
>
> Hi all,
> I am developing a flex application in adobe flex2, my application get
> displayed on my monitor(17") correctly, however when I try running same
> application from different computer or a laptop of 14" wide screen display
> is different as monitor screen is short I need to scroll down to view
> complete page. how can I make sure that the application should look uniform
> across different platform/different browsers and different monitors with out
> changing any widths and heights manually.
>
> Thanks in Advance.
> Poornima
>
>
> 
> Add more friends to your messenger and enjoy! Invite them now.
> 



-- 
Cheers,
Jules
--
Jules Suggate
Owner and Technical Lead
Uphill Sprint Limited

+64-21-157-8562


Re: [flexcoders] Screen Resolution

2008-12-12 Thread narayana e

Hi 

i know your problem. u can use percentage values for flex compents width,height

and one more option is  horizontalScrollPolicy="off" , 
verticalScrollPolicy="off"



example








u can get result
        
--- On Fri, 12/12/08, kotha poornima  wrote:
From: kotha poornima 
Subject: [flexcoders] Screen Resolution
To: "flexcoders" 
Date: Friday, 12 December, 2008, 9:27 AM











Hi all,

I am developing a flex application in adobe flex2, my application get
displayed on my monitor(17") correctly, however when I try running same
application from different computer or a laptop of 14" wide screen
display is different as monitor screen is short I need to scroll down
to view complete page. how can I make sure that the application should
look uniform across different platform/different browsers and different
monitors with out changing any widths and heights manually.



Thanks in Advance.
Poornima



  
  




 

















  Add more friends to your messenger and enjoy! Go to 
http://messenger.yahoo.com/invite/

Re: [flexcoders] Best practice for calling asynchronous functions?

2008-12-12 Thread Mark Carter

So are you saying that, in general, anonymous functions should not be used as
listeners?

If its anything like in Java, (once the calling method returned) the
anonymous function would only be referenced by the event dispatcher and so
(assuming weak references are not used) would only be garbage collected when
the event dispatcher is garbage collected. At least, that's how I understand
it.

I posted a question about this a few weeks ago, but didn't get a reply.


Amy-28 wrote:
> 
> My understanding is that anonymous functions _cannot_ get garbage 
> collected unless you use weak references when you add them.  Which 
> means there's a really good chance they'll get garbage collected 
> before they get called.
> 

-- 
View this message in context: 
http://www.nabble.com/Best-practice-for-calling-asynchronous-functions--tp20930596p20976648.html
Sent from the FlexCoders mailing list archive at Nabble.com.



[flexcoders] Screen Resolution

2008-12-12 Thread kotha poornima
Hi all,
I am developing a flex application in adobe flex2, my application get
displayed on my monitor(17") correctly, however when I try running same
application from different computer or a laptop of 14" wide screen
display is different as monitor screen is short I need to scroll down
to view complete page. how can I make sure that the application should
look uniform across different platform/different browsers and different
monitors with out changing any widths and heights manually.

Thanks in Advance.
Poornima



  

[flexcoders] How to Connect flex To java...

2008-12-12 Thread jayapalkasarla
 i am using Tomcat web server(my  Tomcat   integrated  with LCDS).

can u Give the Folder Structure  of my web application using Java...


what are the jar are required and also xml files

and configuration of xml Files.like web.xml,config.xml,services.xml









[flexcoders] Re: Lazy loading trees

2008-12-12 Thread Amy
--- In flexcoders@yahoogroups.com, "Johannes Nel"  
wrote:
>
> those classes were just random stuff i was using from where i copied 
the
> code.

OK, but it doesn't look like a very informative post.  In fact, it just 
looks like a page of errors to me...but I know nothing about java.  I 
was trying, maybe in an overly ironic way, to let you know your posting 
wasn't successful so that you could fix it and post back when you did, 
or let it go if that's your style.

HTH;

Amy



[flexcoders] Re: Best practice for calling asynchronous functions?

2008-12-12 Thread Amy
--- In flexcoders@yahoogroups.com, Mark Carter  wrote:


> Amy-28 wrote:
> > 
> >> As you can imagine, it keeps the implementation
> >> much simpler. No need for the ASyncToken. Just add new listeners 
> > each time a
> >> call is made. Everything is garbage collected. Oh, hang on, 
> > what keeps a
> >> reference to the HTTPService?
> > 
> > Good question.  What did you do with all the old eventListeners 
you 
> > were complaining about in your original post?
> > 
> 
> My current implementation has something like:
> 
> function save(xml:XML, successFunc:Function, 
failureFunc:Function):void {
> var service:HTTPService = new HTTPService();
> ...
> service.addEventListener(ResultEvent.RESULT,
> function(evt:ResultEvent):void {
> trace("Successfully saved XML");
> successFunc();
> });
> service.send(); // called after the event listeners have been 
added :)
> }
> 
> That's it. The successFunc and failureFunc are only scoped to the 
calling
> code's method and so should be garbage collected when the service 
is garbage
> collected.
> 
> What I don't know is when the service is garbage collected? I'm 
assuming not
> before the result or fault event is fired!

My understanding is that anonymous functions _cannot_ get garbage 
collected unless you use weak references when you add them.  Which 
means there's a really good chance they'll get garbage collected 
before they get called.

HTH;

Amy



[flexcoders] BadPaddingException using RTMPS

2008-12-12 Thread taze170171
Hello!

We are using AIR, LCDS (running on a JBoss) and an RTMPS connection. 
Sometimes we get the following exception, when the AIR client tries 
to connect to the server:

[Flex]Thread[my-rtmps-SocketServer-WorkerThread-88,5,jboss] failed to 
read Connection 'xxx' or process the data; Connection is in 
the 'Handshaking' state and will be forced closed. 
javax.net.ssl.SSLHandshakeException: Invalid padding 
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException
(Alerts.java:150) 
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.fatal
(SSLEngineImpl.java:1417) 
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:874) 
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readNetRecord
(SSLEngineImpl.java:787) 
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.unwrap
(SSLEngineImpl.java:663) 
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:566) 
at flex.messaging.socketserver.SSLConnection.handshake
(SSLConnection.java:301) 
at flex.messaging.socketserver.Connection$ConnectionReader.run
(Connection.java:761) 
at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.runTask(ThreadPoolExecutor.java:665) 
at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Work
er.run(ThreadPoolExecutor.java:690) 
at java.lang.Thread.run(Thread.java:595)

Caused by: javax.crypto.BadPaddingException: Padding length invalid: 
244 
at com.sun.net.ssl.internal.ssl.CipherBox.removePadding
(CipherBox.java:442) 
at com.sun.net.ssl.internal.ssl.CipherBox.decrypt(CipherBox.java:290) 
at com.sun.net.ssl.internal.ssl.InputRecord.decrypt
(InputRecord.java:153) 
at com.sun.net.ssl.internal.ssl.EngineInputRecord.decrypt
(EngineInputRecord.java:238) 
at com.sun.net.ssl.internal.ssl.SSLEngineImpl.readRecord
(SSLEngineImpl.java:856) 
... 8 more

Can anybody help?

Thanks in advance,
Taze



[flexcoders] Re: Problems with locale different to en_US when building an swf file using Ant

2008-12-12 Thread taze170171
Hello!

The problem had to do with the automation_agent resource bundle. See 
also http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?
forumid=60&catid=585&threadid=1394162&enterthread=y

Best regards,
Taze

--- In flexcoders@yahoogroups.com, "taze170171"  
wrote:
>
> Hello!
> 
> We have a problem when building the swf file with a locale 
different 
> to en_US. We use the following ant code for building:
> 
> additional.compiler.arguments=-services ".../services-config.xml" -
> locale=de_AT -source-path=./locale/{locale}
> 
> 
>   failonerror="true">
>   
>   
>   
>   
> 
>   
>   
> 
>   
> 
>   
>   
> 
>  
> 
> When using the locale en_US everything works fine. If we change the 
> locale within the additional.compiler.arguments to de_AT no swf is 
> created. But there is also no error message!
> 
> We are using SDK 3.2.0. Locale de_AT has been created by calling:
> copylocale en_US de_AT
> 
> Within Flex Builder the build works with the de_AT locale!
> 
> Can anybody help?
> 
> Thanks in advance,
> Taze
>




Re: [flexcoders] Re: Setting up and connecting a simple CSS file with Flex 3

2008-12-12 Thread Fotis Chatzinikos
It seems that your site is down...

the 500 error appears even in the root of the site cftips.net

On Fri, Dec 12, 2008 at 2:03 AM, Amy  wrote:

>   --- In flexcoders@yahoogroups.com ,
> "johngag6969" 
> wrote:
>
> >
> > I consider myself a developer with limited design skills. I decided
> > this weekend that I wanted to change that by learning some simple
> > design techniques for flex 3. Check out my blog post about setting
> up
> > and connecting a simple CSS file with Flex 3.
> >
> > http://www.cftips.net/post.cfm/setting-up-and-connecting-a-simple-
> css-file-with-flex-3
> >
> Not sure what:
> 500
> ROOT CAUSE:
> java.lang.NoClassDefFoundError: Could not initialize class
> cfEvent2ecfm1002780577
> at sun.reflect.GeneratedConstructorAccessor4866.newInstance
> (Unknown Source)
> at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
> (DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance
> (Constructor.java:513)
> at java.lang.Class.newInstance0(Class.java:355)
>
> has to do with the topic. But thanks ;-)
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com,


[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-12 Thread stinasius
hi tracy i dont know php. i use coldfusion. a coldfusion remedy would
be good. thanks



RE: [flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-12 Thread Tracy Spratt
Your next steps:

*   Create a simple php page that takes an http request, reads the
UserId and Password request parameters.  Allow for either form(POST) or
querystring(GET) parameters.  Keep the authorization logic simple to
start with, by hardcoding a userid and password to match.  Have the php
page return an xml response, something like:   Make status="fail" if the user/pwd do  not match.
Test this page in a browser.
*   Declare an HTTPService tag in your main app.  Set
resultFormat="e4x".  Declare result and fault handlers. Set the url to
the tested php page above 
*   Define a tryLogin function that takes user and password as
arguments.  In that function, build a request object with userId and
password properties and assign the values passed into the function.
Invoke send on the HTTPService.
*   When user clicks the login button, call the tryLogin function,
passin in the values entered by the user.
*   In the result handler, read the event.result as XML, and look at
the @status.  If success, set the ViewStack.selectedIndex to show the
Admin view

 

Tracy

 

 



From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Friday, December 12, 2008 5:08 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: flex login popup help needed please

 

Hi Tracy you asked hw far i was, well i decided to redo it from
scratch so that i can get guidance. now i have 4 mxml files. one is
the main application(login_example.mxml) and there is the Home.mxml
which is the default view, the Admin.mxml which requires one to login
in order to view it and a login.mxml which is the popup login form.
now from there all a ask 4 is a simple cfc that will do the
authentication and also how to use it in my flex app. here is my code.

"login_example.mxml"

http://www.adobe.com/2006/mxml
 "
layout="absolute" xmlns:view="components.*">











 


"Home.mxml"


http://www.adobe.com/2006/mxml
 " width="100%"
height="100%" backgroundColor="#ff8000">



"Admin.mxml"


http://www.adobe.com/2006/mxml
 " width="100%"
height="100%" backgroundColor="#40">



"login.mxml"


http://www.adobe.com/2006/mxml
 "
layout="absolute" title="Login Form"
creationComplete="PopUpManager.centerPopUp(this)">

















please guys this would mean alot to me. thanks for sticking up to this
point.

 



Re: [flexcoders] Connecting Flex 3 to ASP.NET Using LINQ

2008-12-12 Thread Fotis Chatzinikos
Your friend's site is down ;-)

On Thu, Dec 11, 2008 at 9:53 PM, johngag6969  wrote:

>   A friend of mine over at http://19Nates.com made a great post for
> beginners on how to connect flex 3 to ASP.NET. I would recommend it
> to anyone that wants to venture to .NET or anyone who just wants to
> learn some basics.
>
> http://www.cftips.net/post.cfm/connecting-flex-3-to-asp-net-using-linq
>
>  
>



-- 
Fotis Chatzinikos, Ph.D.
Founder,
Phinnovation
fotis.chatzini...@gmail.com,


Re: [flexcoders] Getting NULL Object Reference while deleting last element of the list

2008-12-12 Thread Marco Catunda
Anuj,

I think there is something wrong with this structure. Why make it into for loop?
The _addToAssociatedDevicesArr is received the same value

for(var i:*=0;i<_addDevicesLen-1;i++)
{
_addToAssociatedDevicesArr=nvrsInPoolList.selectedItems;
}

The last loop has the same problem. The index variable t is never used.
Why it is in for loop?

for(var t:*=0;t<_addToAssociatedDevicesArr.length;t++)
{
if(nvrsInPoolList!=null)
{

IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex);
}
}

About the problem you complain

I think one of this variable is null value:

camerasInPoolList
arrAddToPool
arrRemoveFromPool

--
Marco Catunda

On Thu, Dec 11, 2008 at 7:33 PM, anuj181  wrote:
> Hi Guys
> I am trying to implement the delete entries of the list box. The code
> works fine till the last entry, when i am trying to delete the last
> item after selection it is throwing error TypeError: Error #1009:
> Cannot access a property or method of a null object reference.
> I have seen this error so many times but I am not sure how will i fix
> this in the following code. Please help me in fixing this error
> Thanks
> Anuj
>
> /*CODE*/
>
>  click="addToAssociatedDevices(event)"/>
>
> private function addToAssociatedDevices(evt:MouseEvent):void
> {
> var _addDevicesLen:int=devicesInList.length;
> var _addToAssociatedDevicesArr:Array;
>
>
> for(var i:*=0;i<_addDevicesLen-1;i++)
> {
> _addToAssociatedDevicesArr=nvrsInPoolList.selectedItems;
>
>
> }
> if((_addToAssociatedDevicesArr is
> Array)&&(_addToAssociatedDevicesArr!=null))
> {
> var removeIndex:int = 0;
> for each (var addItemVal:* in _addToAssociatedDevicesArr)
> {
> if(addItemVal!=null)
> {
>
> IList(camerasInPoolList.dataProvider).addItem(addItemVal as Object);
> //Adds a device to the Add To Camera Pool list
> arrAddToPool.push(addItemVal);
> //Removes a device from the Remove From Pool list
> removeIndex = arrRemoveFromPool.indexOf(addItemVal);
> if(removeIndex > -1) {
> arrRemoveFromPool.splice(removeIndex,1);
> }
> }
> }
>
> }
> for(var t:*=0;t<_addToAssociatedDevicesArr.length;t++)
> {
> if(nvrsInPoolList!=null)
> {
>
> IList(nvrsInPoolList.dataProvider).removeItemAt(nvrsInPoolList.selectedIndex);
> }
> }
> }
>
> 


Re: [flexcoders] how do you blur smoothly between two states?

2008-12-12 Thread Flex Noob
I know I'm answering my own questions but hope someone has gone down the same 
path as me, can tell if I'm overlooking something obvious or wants to learn 
from my mistakes. . . 

My previous idea didn't work thanks to 
transition>blur>BlurInstance>TweenInstance>Tween.endTween.

endTween sets the tween to whatever state it should be at in the final 
position. In this case whatever blurXTo and blurYTo is.

to work around I'm listening for an update event and reset the blur to the last 
known value after it gets set to the end value on effectEnd. HOWEVER, this 
causes a noticable flicker as the endTween state is briefly displayed because 
BlurInstance.onTweenEnd.calls the private setBlurMethod.

so it now seems that i need to override the endTween method in my own class to 
prevent the tween from setting its to values. Unless of course I'm missing 
something painfully simple.

?









From: Flex Noob 
To: flexcoders@yahoogroups.com
Sent: Friday, December 12, 2008 12:51:22 AM
Subject: Re: [flexcoders] how do you blur smoothly between two states?


just dug into the AS3 classes and it by default  fromX/fromY has a default 
value of 4 and in the BlurInstanceClass it doesn't save the current blurX/BlurY 
values. I could create an event that listens for the update, the only time the 
value are sent, but then that adds extra overhead for each update.

Instead what I'll do is call a function to iterate the filters list, grab 
blurX/blurY.

Just wished they would have exposed a blurX and blurY prop on the Blur the 
wiring is there, just failed to provide a stub.





From: Flex Noob 
To: flexcod...@yahoogro ups.com
Sent: Thursday, December 11, 2008 11:34:01 PM
Subject: [flexcoders] how do you blur smoothly between two states?


hrmm, I don't get it

Say I have this on rollover:



and this on roll out:


works, cool, rock on. however if I mouse off at say 500ms the blur JUMPs to the 
to value and then works it way back. kind of sucks.

I've tried ommiting blurfrom or setting the value to *, "" and even 
blurXFrom="{ blur.blurXFrom} " blurYFrom="{ blur.blurYFrom} "but no dice.

what gives?





  

[flexcoders] Re: flex login popup help needed pleaseeeeeeeee

2008-12-12 Thread stinasius
Hi Tracy you asked hw far i was, well i decided to redo it from
scratch so that i can get guidance. now i have 4 mxml files. one is
the main application(login_example.mxml) and there is the Home.mxml
which is the default view, the Admin.mxml which requires one to login
in order to view it and a login.mxml which is the popup login form.
now from there all a ask 4 is a simple cfc that will do the
authentication and also how to use it in my flex app. here is my code.

"login_example.mxml"

http://www.adobe.com/2006/mxml";
layout="absolute" xmlns:view="components.*">











 


"Home.mxml"


http://www.adobe.com/2006/mxml"; width="100%"
height="100%" backgroundColor="#ff8000">



"Admin.mxml"


http://www.adobe.com/2006/mxml"; width="100%"
height="100%" backgroundColor="#40">



"login.mxml"


http://www.adobe.com/2006/mxml";
layout="absolute" title="Login Form"
creationComplete="PopUpManager.centerPopUp(this)">

















please guys this would mean alot to me. thanks for sticking up to this
point.



Re: [flexcoders] how do you blur smoothly between two states?

2008-12-12 Thread Flex Noob
just dug into the AS3 classes and it by default  fromX/fromY has a default 
value of 4 and in the BlurInstanceClass it doesn't save the current blurX/BlurY 
values. I could create an event that listens for the update, the only time the 
value are sent, but then that adds extra overhead for each update.

Instead what I'll do is call a function to iterate the filters list, grab 
blurX/blurY.

Just wished they would have exposed a blurX and blurY prop on the Blur the 
wiring is there, just failed to provide a stub.





From: Flex Noob 
To: flexcoders@yahoogroups.com
Sent: Thursday, December 11, 2008 11:34:01 PM
Subject: [flexcoders] how do you blur smoothly between two states?


hrmm, I don't get it

Say I have this on rollover:



and this on roll out:


works, cool, rock on. however if I mouse off at say 500ms the blur JUMPs to the 
to value and then works it way back. kind of sucks.

I've tried ommiting blurfrom or setting the value to *, "" and even 
blurXFrom="{ blur.blurXFrom} " blurYFrom="{ blur.blurYFrom} "but no dice.

what gives?




  

Re: [flexcoders] Re: speed of the "for each" looping

2008-12-12 Thread Rick Winscot
Sometimes it makes sense to compare the total effect of one approach to
another... like comparing your favorite cereal to a competing product.
Nothing speaks better than hard and fast facts like... It would take over
two and a half million bowls of your oat bran cereal to equal the fiber
content of one bowl of Super Colon Blow.

Yes... Arrays/Collections are like Frosty Coated Sugar Lumps and
Dictionaries and Associative Arrays may rock your insides so hard that
you¹ll have to take stock in depends. When all else fails ­ cereal metaphors
provide crystal clarity.

http://www.nbc.com/Saturday_Night_Live/video/clips/colon-blow/229046/
http://www.insideria.com/2008/04/dictionaries-and-associative-a.html

Rick Winscot


On 12/11/08 6:19 PM, "Alex Harui"  wrote:

>  
>  
> 
> You have too much time on your handsŠ
>  
> I would expect collections to iterate much faster by using getItemAt or
> cursors instead of array indexers or for..in.  I swear someone published a
> comparison once.
>  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Josh McDonald
> Sent: Thursday, December 11, 2008 2:57 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Re: speed of the "for each" looping
>  
> 
> I've spent a lot of time poking around inside the collections stack (it's just
> interesting), and I can't find a situation where you'll get a different order
> for for each..in over indexed looping at the moment (Fx 3). That could of
> course change without notice, but for now I think that where speed isn't
> important, you can safely pick the one that produces the prettier or more
> comprehensible code :)
> 
> -Josh
> 
> On Fri, Dec 12, 2008 at 5:32 AM, Alex Harui  wrote:
> 
> Funny.   I didn't realize we were talking about iterating arrays with for..in
> until just now.  I don't think we do that in Flex code.  If the docs say
> arrays will iterate via for..in in index order then I'd probably trust that,
> especially if you stuff your arrays in index order
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Dave Cragg
> Sent: Thursday, December 11, 2008 3:08 AM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Re: speed of the "for each" looping
> 
>  
> 
> Could you clarify this? Does this non-guarantee apply to numerically indexed
> arrays and ArrayCollections too? Or just to associative arrays and object
> properties?
> 
>  
> 
> The docs imply that the order is maintained by for...in with numerically
> indexed arrays. It would be a big change if that were not the case.
> 
>  
> 
> Cheers
> 
> Dave
> 
>  
> 
> On 10 Dec 2008, at 23:00, Gordon Smith wrote:
> 
>  
> 
>  
> 
> So don't use for..in or for eachŠ in if you care about the enumeration order.
> It could very possibly change in future versions of the Flash Player.
> 
>  
> &nbs! p; 
> 
> Gordon Smith
> 
> Adobe Flex SDK
> 
> 
>