PDA

View Full Version : Loading External Scripts


Ghost3313
05-25-2008, 09:35 PM
Hey all,

I am tring to load my scripts from another mxml document as the application has to many, and I wanted to sort everything. Its causing issues.

Currently trying to use the xmlns:custom="add.*" but that does not seem to work.

How can my main application load its scripts from another *.mxml file? Any ideas?

Thanks,

Ghost3313

drkstr
06-02-2008, 11:01 PM
Do you mean like this?

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

Although just some kindly advice. I used to do this myself and found it to be more of a pain then it's worth. It's good to keep encapsulated code together in the same file. It also makes documentation generation a lot easier if you decide to do this down the road.


Best Regards,
~Aaron

**EDIT**
Sorry, I just saw you were trying to load a script from a different mxml. Even if this were possible, it would be a BAD idea. If you must, create a standalone Actionscript file that has the script code and import it into both mxml. Refer to previous warning.