Pmolaro
Snippets
-
"Dump" an Actionscript Custom Object by pmolaro
In ColdFusion you can "trace" out any variable or object by using the <cfdump> tag. I wanted to do something similar with my Actionscript objects I created for my Flex projects. Below is a nice solution. Be aware I have read that this sometimes crashes your apps with super complicated objects, but I have not encountered that myself.
Save as Favorite | Tags: actionscript, Flex, air, object oriented, objectUtil, utils, trace, toString, dump
-
Creating an Array of Objects in Actionscript by pmolaro
This is pretty basic stuff, but I use it all the time. This is an example of how to load an Array of Objects; the benefit is that when you want to reference them, you can just call MyArray.ObjectName
Save as Favorite | Tags: array, object, push, array.push, actionscript
-
Determining the Number of Days in a Month by pmolaro
Actionscript's Date object has many useful attributes like "FullYear", "Month", "Day" and so on. However it doesn't have a way to tell you how many days there are in the month that date is in. This is something that you may find useful, as you may need to loop over the days of a month for various reasons. While Actionscript doesn't provide a built in to give you this value, its easy enough to use what it does offer to get the information you need. First, it seems that Actionscript treats the days in a month like a list of numbers in a circle. In other words, if AS counted out loud starting at 1, when it got to the end of the month, it would automatically start back over at 1 (the first of the month). Now look at the code: First, we create a new variable with a type of number. In the end, we want to know the number value of the last day of the month. ...
-
Flex Alert box by pmolaro
Cheat sheet of settings you can use to customize your Alert boxes in Flex 3.
Save as Favorite | Tags: Alert, Flex, Alert.show, actionscript


