Incorrect Paths for an Imported Flex Project - actionscript-3

I'm trying to import someone else's Flex project folder into Flash Builder 4.5, and I'm having some problems with the paths. When I load everything up, I'm getting errors that say that the "Type was not found or was not a compile-time constant" for all the .as files living in src. It looks like based on the path settings, it cannot find those files.
So I went to the Package > Properties and tried to add the src folder to the Source Path list, but no luck there either.
One curious thing is that when I look at the error at the bottom, I see Path is set to /ProjectName/src/. Is that an absolute path? Certainly it wouldn't find them if it were.
Can anyone shed some light on getting my Flex project to find my src folder?
Thanks,
Whit

/ProjectName/foo/bar in Flash Builder would be resolved to the project's foo/bar directory, therefore it is not an absolute path.
The project you experience may also have to do with the libraries (SWCs) referenced by your project are not properly referenced. You may go to Project -> Properties -> Flex Build Path -> Library path (tab) and add reference to libraries similar to the fashion you add the Source Path.
Additionally, when source path is correctly added, you would also notice a "virtual folder" appearing in the referencing project, which allows you to directly load and edit the source code of the referenced project.

Related

adobe pro cc (AS3) not recognizing box2d classpath

I've tried to connect a box2d classpath I have to adobe pro cc via a source path in the actionscipt settings. I get a warning saying "A definition for the document class could not be found in the classpath, so one will be automatically generated in the SWF file upon export." When I do this the code still does not recognize the box2d commands. Any help is appreciated, thanks so much!
Edit: So I have now replaced the primary source folder thanks to Cadin's observation and the Box2d library commands are being recognized, however, I get several errors saying:
"Type was not found or was not a compile-time constant: b2World."
"Call to a possibly undefined method b2AABB."
and
"Definition Box2D.Collision:b2AABB could not be found."
I am extremely stuck and don't know what to do. I am fairly well versed with flashdevelop. But it has been a while since I've worked with flash pro. Thanks so much!
It sounds like the error is complaining about your Document Class, not Box2D.
When you added the source path to Box2D, did you add a new path, or replace the default one?
It's easy to accidentally replace the default path and get all kinds of class linking weirdness. Check the source path settings and make sure you still have a listing for "." That tells Flash to look in the current directory (where the FLA is) for source files. If your document class is in that directory, Flash won't find it without that source path.

Flash Builder and External Library

I have downloaded the as3syndicationlib library from here, but I am having trouble adding it to my project. I dragged the folder into my project > src folder, and when I started importing the files from it (com.adobe.xml.syndication.rss.RSS20) all seemed to be fine, until I hit save. Then I started to get error that say:
Multiple markers at this line:
-1084: Syntax error: expecting identifier before
import.
-The import RSS20 could not be found.
-adobe
-The import rss could not be found.
-The import syndication could not be found.
-The import xml could not be found.
-91 changed lines
I have never used an external library with Flash Builder/Flex/ActionScript3 before so I have no idea what to do. I know that this is probably very simple to do, but I am new at flash builder and flex.
Any help is highly appreciated!
Thanks,
Jacob
EDIT:
I got it to work. What I was doing wrong was I was added source code to my project when I should have added the xmlsyndication.swc file to my project.
You need to add it to a lib folder instead of src... if you don't have a lib folder just make one. Then right click the project in Flash Builder and hit properties, in the menu on the left select Library Path (or something like that), click the Add Folder button and type lib. Do a clean build (Build Menu -> Clean).

Sharing source between 2 projects?

I have a project containing a big package "global" of classes which is designed for Web, I need to share these classes with a new mobile project, but when i add them with :
Properties -> Flex Build Path -> Source path -> Add Folder
they start appearing with index [source path] before the package name, and since them Flash Builder start trowing error messages :
"A file found in a source-path must have the same package structure '', as the definition's package, 'global'."
How can i fix this issue ?
As we've discussed in the comments, I think it would be a better approach to compile your "global" classes into a library (.swc).
You were concerned about loading unnecessary classes: when you link to a library as 'merged', only the classes you use are actually compiled into the main application (and any classes they depend on), so there's no need to worry about that.
As a last argument I also think this is a more flexible approach. A compiled library is easier to reuse and version, so the code can more easily be distributed to other developers on your team.
Rename one of the packages with right click->refactor. Than is should work.
If not you can also try to have your two codes available at the same project, and then you can select which to run in Flash Builder, by right-clicking to that .as or .mxml file, and selecting set as ... (or something like that)
I guess if you will include 'src' fonder instead of 'src/global' that problem will disappear.

Getting Type not found error implementing source in as3

I am trying to just compile and run the demos from this article:
Flash talks to max msp via osc
I am using Flash Develop and Flex SDK with an up to date version of air.
When I run the demo: "as3_MaxFlashHarmony" I get an error I don't know how to fix. The source for the entire project is here:
the project
But specifically the error I am getting says:
col: 30 Error: Type was not found or was not a compile-time constant: OSCMessage.
here is the as3 file that it is specifically referencing:
//IHarmonyApp.as
package
{
import org.tuio.osc.OSCMessage;
public interface IHarmonyApp
{
function updateOSCData(msg:OSCMessage):void;
}
}
It uses the libraries Tuio, MinimalComps, and MonsterDebugger. The thing I don't get is that how can it not find OSCMessage if OSCMessage is properly imported? the IDE is making fine references to it and I can open it's declaration. OSCMessage is a public class. I don't get it.
To give some extra info for potential answers, the IDE flashdevelop can find the library org.tuio.osc.OSCMessage just fine, it gives the error regardless of if org.tuio... is a source path or not, and the overall path does not contain any special characters. I don't know if that might matter, but I feel like this is me making a stupid mistake somewhere. I can provide my project zipped if need be.
Thanks!
Edit 9:48, 8/25/12
I do have the file path org/tuio/osc/OSCMessage.as in my project, and the file OSCMessage exists. FlashDevelop can find it just fine and I can navigate to declaration at that location. This is why I got stumped.
Thanks again
In your AS3 folder apart of your de folder you would need to have org folder with relevant folders and classes.
For example to import org.tuio.osc.OSCMessage you would need a file:
../YourPackageRoot/org/tuio/osc/OSCMessage.as
The other way is including a SWC file (all folders and classes zipped into one swc file).
You can include the swc file in FlashDevelop by right clicking the swc file and selecting Add To Library

Adding Html2Xhtml library to project

I am trying to use HTML2XHTML but how can I include it into my project?
I am using VS2008 and I put the dlls into bin folder of my project and add Html2Xhtml to the refs, but it still does not recognize the "using Corsis.Html2Xhtml;" declaration. It gives the missing assembly compile time error.
I included the following dll in the refs: Html2Xhtml.dll
I also added libiconv-2.dll to my bin folder. as well as the XML file that I think is required.
Can anyone tell me what is going wrong?
How exactly do I add the library to my project?