My Flex 3 main.mxml code is getting very messy, is there a "include" in flex3 so I can seperate my code in several files?

My Flex 3 main.mxml code is getting very messy, is there a "include" in flex3 so I can seperate my code in several files?

Like php INCLUDE.
OctalysAsked:
Who is Participating?
 
Gary BenadeCommented:
Or you can move your actionscript into external files and include like
<mx:Script source="Box.as" />

0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
0
 
Gary BenadeCommented:
include "[path]filename.as"
0
 
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
As Far As I know there is nothing like include in Flex 2.

The only way to achieve such thing is to use custom components check

http://www.adobe.com/devnet/flex/quickstart/building_components_in_mxml/
0
 
VypeCommented:
You can save your code elements as components in flex, to do this select the code snippet you want to separate and goto File> new Flex Component and copy the code in and then save as whatever you want the component to be named as, for instance Form.mxml.

to include you component you just use the keyword 'import' and then your file name (depends on where its stored)

so for example if your components where stored in a folder called forms your import would be

import forms.myform;


I hope this helps.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.