This content has been marked as final. Show 3 replies
Sure is! Rather than explain, I'll let Adobe do the talking.
"To make your MXML code more readable, you can reference ActionScript files in your <mx:Script> tags, rather than insert large blocks of script. You can either include or import ActionScript files."
Hope this helps!
add all your <script> code minus the SCRIPT and CDATA tags to an actionscript file. Then in your application, you'll need to include your new actionscript file using <script source="path_to_script.as"/>
And that's it. I just tested on a small app of mine and works perfectly.
"New to AS3" <email@example.com> wrote in message
> I've just started using Flex, and although I love it, I hate having to
> up all the time to edit the AS3 code in the <mx:Script> tags.. so i was
> wondering if there was a way to save out all the AS3 code to a seperate as
> and tell the mxml file to use the code in that file.
You can include it.
Or, right click next to the first line of the script block (where the line
numbers are) and select Add Bookmark..
Then Window>Other Views...>General>Bookmarks
Thanks for the replies.. I knew about the stinking include, just haven't used it since AS2 (write classes most of the time, but didn't want to do it with this). So DUH to me :)
I did use bookmarks, but i really wanted to seperate out the different set of functions I had for each part of it into their own files.. which the include allowed me to do.
Thanks again :)