Including ActionScript File in Flex

I have a MXML file (auto.mxml) referring to an ActionScript File.(

The Auto package also includes a Source Path to another package called "Code Library". This package contains reusable CSS, MXML and etc. I would like to include the AS file, but I'm receiving an error.

If I put the following code in the <mx:script> auto.mxml, I receive an error:

include "scripts/";

Error Received: 1068: Unable to open included file: ..........

It can't find "scripts/" in the Auto package, because It's located in the Code Library. All other references to the Code Library work fine.

If I put the file into Auto under a scripts folder, all work fine.

Is the resolution I need to have this in the main source file and can't use the Source Path ?

FYI....Using Flash Builder 4, SDK 3.5

Hope I explained this correctly.

Thanks in advance
Michael WilliamsApplication DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
you may like to try this

But in Flex we generally use import to get in a as3 script.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Michael WilliamsApplication DeveloperAuthor Commented:
I'm very new to Flex development.

Why is import generally used ?
Siva Prasanna KumarPrincipal Solutions ArchitectCommented:
import is the way to refer external action script code inside the mxml file, inside a <mx:script> tag.

see this tutorial for better explanation
import <<yourclassname>>
Michael WilliamsApplication DeveloperAuthor Commented:
I have multiple Flex Projects associated to one big business project. I use a Code Library for shared components and resources.

I needed to ass the AS to a shared component for this to work.

Thanks for your help
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.