6.7.1 ProblemYou want to convert an array to a string. 6.7.2 SolutionUse the join( ) method. 6.7.3 DiscussionActionScript provides you with a built-in way to quickly convert arrays to strings (assuming, of course, that the array elements themselves are either strings or another datatype that ActionScript can automatically cast to a string) using the join( ) method. You should provide the join( ) method with a parameter that tells Flash which delimiter to use to join the elements: myArray = ["a", "b", "c"]; trace(myArray.join("|")); // Displays: a|b|c If you don't provide a delimiter, Flash uses a comma by default: myArray = ["a", "b", "c"]; trace(myArray.join( )); // Displays: a,b,c
6.7.4 See AlsoRecipe 6.6 |