user109074
user109074

Reputation: 78

How I can split AS code and MXML in Flex

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?

Upvotes: 1

Views: 657

Answers (3)

Theo
Theo

Reputation: 132872

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.

Upvotes: 1

bkildow
bkildow

Reputation: 5153

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

Upvotes: 4

eduffy
eduffy

Reputation: 40224

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

 <mx:Script source="myactions.as" />

Upvotes: 2

Related Questions