I would like to include the MXML file in my MXML file the same way you can include an external file in AS3 using include . Using the include directive leads the code from an external file to the source file at compile time, placing it in the same area.
For instance,
Application.mxml:
<Application>
<source="external.mxml"/>
</Application>
External.mxml:
<Styles/>
<Declarations>
<Object id="test"/>
</Declarations>
I need to save this code / mxml / xml in an external file in the area with the original. Do not ask me why I want to do this.
Another example. Here is my current code (simplified) in just 1 mxml file:
...
File1.mxml
<Button click="clickHandler()"/>
<Script>
public function clickHandler():void {
}
</Script>
...
Here is what I want:
...
File1.mxml
<Group>
<source="File2.mxml"/>
<Button click="clickHandler()"/>
<Group>
File2.mxml
<Script>
public function clickHandler():void {
trace(this);
}
</Script>
...
I want to split my code into a separate file ...
~~ Update ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
, "code behind", , . MXML, MyGroup.mxml MyGroup.as , clickHandler.
, , , . , , , MXML, , - .
, , . , / , , , , . . , Code Behind, ( styles.as ). , .
,
MyGroupBehind.mxml:
<Group>
<Script>
public function clickHandler():void {
trace(this);
}
</Script>
</Group>
MyGroupAhead.mxml:
<MyGroupBehind>
<Button click="clickHandler()"/>
</MyGroupBehind>