Jesus, this took me a bazillion hours to figure out.
$str = <<
and then my variable would contain the multi-line string with line breaks and all. Sweet, that's what I wanted to do. Turns out AS3 doesn't support heredoc syntax. So that sucks.
You can use the same method in Actionscript 3. So your AS code would look like:
private var myString:String = (
It's easier in MXML, in that case all you need to do is something like:
So that's how you simulate the heredoc syntax in AS3.
- UPDATE: The test app has been updated to include two more tests: one for a hash table based approach, and one that uses a ByteArray approach. Looks like the ByteArray approach is the fastest, followed by the hash table, followed by the bitmap method. They're all pretty close when you're…
- While doing some research for my decompiling session at Flash on the Beach, I came across this gem of a post on the Adobe ActionScript 3 message board. Someone posts a block of code and asks "I’m getting 3 compiling errors when I test my flash movie: could you guys…
- UPDATE: The test app has been updated to include a third test that uses a ByteArray approach. Looks like the ByteArray approach is the fastest, followed by the hash table, followed by the bitmap method. They're all pretty close when you're working with 10k or 100k records, but once you…