RE: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning
Well, the binding is going to work right? You’re just going to get the warning (which you can turn off in flex-config in production). Casting length to a number isn’t going to work, what you’d want to do to avoid the warning is cast the Array to something else (like Object). However if you do that you’re at risk of it not working at all because the binding mechanism will mess with the Array instance in unpredictable ways. So I think doing the variable declaration is probably your best bet if you want to keep warnings on but avoid the issue with your length function. Of course the other thing you could do is create a utility function getArrayLength that simply returns the array’s length. Then you could bind to the result of the function: function getArrayLength(arr:Array):Number { return arr.length; } Matt From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tracy Spratt Sent: Tuesday, June 21, 2005 6:44 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning Yes, that will work, plus one should always type their variables. But I would rather not have to create this extra var if I don’t have to. The Casting trick usually works, but not in this situation. Tracy From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Thijs Triemstra | Collab Sent: Tuesday, June 21, 2005 9:06 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning i usually make a var in actionscript and bind this to mxml.. // actionscript var binding = (Number(app.p('DrawingData').valuesarray.length) == 0); // in mxml i also would like to know if that is the best/only way to do it.. Thijs Op 22-jun-2005, om 2:41 heeft Tracy Spratt het volgende geschreven: I have a custom object, and in the example line below, an instance is returned by a function. The object has a property, “valuesarray”, which is typed as an Array. This is a case where I would like binding to correctly, but I am getting the binding warning. I tried casting the length to a Number: visible="{Number(app.p('DrawingData').valuesarray.length) == 0}" but I still get the same warning: “Changes to property, length, from built-in object, Array, will not be detected” I can code around this but I have it in several places, and would like to be able to make this solution work. I know Matt’s actually working, but does anyone else have any ideas? Tracy 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 the Yahoo! Terms of Service. 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 the Yahoo! Terms of Service.
RE: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning
Yes, that will work, plus one should always type their variables. But I would rather not have to create this extra var if I don’t have to. The Casting trick usually works, but not in this situation. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Thijs Triemstra | Collab Sent: Tuesday, June 21, 2005 9:06 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning i usually make a var in actionscript and bind this to mxml.. // actionscript var binding = (Number(app.p('DrawingData').valuesarray.length) == 0); // in mxml i also would like to know if that is the best/only way to do it.. Thijs Op 22-jun-2005, om 2:41 heeft Tracy Spratt het volgende geschreven: I have a custom object, and in the example line below, an instance is returned by a function. The object has a property, “valuesarray”, which is typed as an Array. This is a case where I would like binding to correctly, but I am getting the binding warning. I tried casting the length to a Number: visible="{Number(app.p('DrawingData').valuesarray.length) == 0}" but I still get the same warning: “Changes to property, length, from built-in object, Array, will not be detected” I can code around this but I have it in several places, and would like to be able to make this solution work. I know Matt’s actually working, but does anyone else have any ideas? Tracy 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 the Yahoo! Terms of Service. 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 the Yahoo! Terms of Service.
Re: [flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning
i usually make a var in actionscript and bind this to mxml..// actionscriptvar binding = (Number(app.p('DrawingData').valuesarray.length) == 0);// in mxmli also would like to know if that is the best/only way to do it..ThijsOp 22-jun-2005, om 2:41 heeft Tracy Spratt het volgende geschreven: I have a custom object, and in the example line below, an instance is returned by a function. The object has a property, “valuesarray”, which is typed as an Array.This is a case where I would like binding to correctly, but I am getting the binding warning.I tried casting the length to a Number: visible="{Number(app.p('DrawingData').valuesarray.length) == 0}"but I still get the same warning:“Changes to property, length, from built-in object, Array, will not be detected”I can code around this but I have it in several places, and would like to be able to make this solution work.I know Matt’s actually working, but does anyone else have any ideas?TracyYahoo! 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 the Yahoo! Terms of Service. 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 the Yahoo! Terms of Service.
[flexcoders] Casting not working to avoid "Changes to property, length...will not be detected" warning
Title: Casting not working to avoid "Changes to property, length...will not be detected" warning I have a custom object, and in the example line below, an instance is returned by a function. The object has a property, “valuesarray”, which is typed as an Array. This is a case where I would like binding to correctly, but I am getting the binding warning. I tried casting the length to a Number: visible="{Number(app.p('DrawingData').valuesarray.length) == 0}" but I still get the same warning: “Changes to property, length, from built-in object, Array, will not be detected” I can code around this but I have it in several places, and would like to be able to make this solution work. I know Matt’s actually working, but does anyone else have any ideas? Tracy 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 the Yahoo! Terms of Service.