tags:

views:

313

answers:

3

In Silverlight I can write XAML definition and script logic in different files and it is very convinient are there any way to do same stuff in Flex?

+2  A: 

Do you mean the Script tag? It's just:

 <mx:Script source="myactions.as" />
eduffy
This way has the advantage of not requiring you to re-declare all your MXML components inside the AS file
davr
+4  A: 

You could try using the code behind technique: http://www.adobe.com/devnet/flex/quickstart/building_components_using_code_behind/

bkildow
+1  A: 

Besides the techniques described by the other posters here there are more advanced that are not about in which file the code is stored, but how to organize the collaborators and logic of your views. The Presentation Model pattern works very well in Flex, but there are also others. I recommend reading Paul Willams introduction to presentation patterns.

Theo