I've recently be experimenting with AS3, and been absolutely delighted with it's capabilities in Flex 4 (coming from a web dev background). One thing that has me fairly confused though, is the relationship between MXML and AS3. I realise that at compile time the mxmlc will take the MXML and convert it to AS3, so there is a way to represent all MXML as AS3. Which brings me to my question:
Because I've been focusing on AS3 initially, I've found a lot of examples which are MXML based rather confusing. For example this scroller code block ( from http://www.adobe.com/devnet/flex/articles/flex4_viewport_scrolling_03.html ) - I have no idea how one would do that in AS3. If I create a Scroller object and try to 'addElement( new Group() )' I just get an error about this not being possible.
<s:Scroller left="1" right="1" top="1" bottom="1">
Is there anyway to view the AS3 that the compiler fires out, as I'm hoping this will help my understanding of AS3? I release of course that MXML is geared towards layout, and that is what is happening here - but I'm curious about how this is done in AS3.
To view the AS3 output code, add the following to the compiler option in preferences:
This is the first thing i found when googling. It tells you what to do
tinylion development & design
Doh - thank you very much! Lot of code to look through now :-)
Scroller will RTE when trying to use the IVisualElementContainer methods like addElement()/removeElement()/etc. Instead use the viewport property:
myScroller.viewport = myGroup;