Including ActionScript File in Flex

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

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/standard.as";

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

It can't find "scripts/standard.as" 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
LVL 1
Michael WilliamsApplication DeveloperAsked:
Who is Participating?
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

http://troyworks.com/blog/2008/05/30/flash-error-1068-unable-to-open-included-file/

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

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 ?
0
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

http://www.adobe.com/devnet/flash/quickstart/creating_class_as3/
0
halfbloodprinceCommented:
import <<yourclassname>>
0
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
0
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.

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.