0

I have this flex project.And the below mentioned is my directory structure (List1).Now if i want to use an external package which has the following directory structure as mentioned in List2 Where should i include it and how am i suppose to use it in the code

List1:Projectname : Dirtest

.settings
bin-debug
html-template
libs
src
.actionScriptProperties
.flexProperties
.project

List2: External project directory structure.

loyui/assests
loyui/bin
loyui/lib
loyui/src/fr/lab/test.as

Where to copy the above external project and how to use it in List1

    import mx.controls.Alert;
import flash.events.SampleDataEvent; 
import flash.media.Microphone;
import flash.net.FileReference;
import mx.controls.Alert;
import flash.net.FileReference; 
import flash.display.Sprite;
    //How to execute this statement successfully
    import fr.lab.test;
Rajeev
  • 44,985
  • 76
  • 186
  • 285

2 Answers2

0

It depends on the qualified class name of test.as. As your question suggests, it is fr.lab.test. In this case, you need to add loyui/src to the Flex classpath. The classpath lists all the directiories that should be searched for classes, whenever the compiler finds an unknown class. How to set this classpath depends on the development environment you're in, just google the name of your IDE and classpath and you should get what you are looking for.

Edit In case you want a more portable solution, you can pack loyui/src into an SWC library and easily reuse it in multiple projects.

Manuel Leuenberger
  • 2,327
  • 3
  • 21
  • 27
  • So what you are syaing is that to include the directory loyui in the class path rit?How to find the classpath? – Rajeev May 07 '12 at 08:37
  • The directory `loyui/src` to be exact (this is important because all the classnames in the directory have it relative to this root). Since you have a .project directory in your project, I assume you are using an IDE for programming. If you google tha name of it plus classpath, you should see how to set it. – Manuel Leuenberger May 07 '12 at 08:42
  • I amusing flex builder4.6 as the IDE – Rajeev May 07 '12 at 08:46
  • See [Modify the source path](http://help.adobe.com/en_US/flashbuilder/using/WSe4e4b720da9dedb524b8220812e5611f28f-7fe1.html) – Manuel Leuenberger May 07 '12 at 08:53
0

You don't need to copy it actually. You can however add a dependency in List1 project, for the List2 one.

Assuming you have the two projects imported in your workspace, you can just right click List1, then in the Flex Build Path settings, you can click Add Project, and select the List2 project folder. That's it.

Romi Halasz
  • 1,949
  • 1
  • 13
  • 23