Getting Type not found error implementing source in as3 - actionscript-3

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

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).

When using a swc with embeded files the files are missing but the swc compiles with out errors?

I am making a swc file with code that I have made in actionscript and it works correctly. However after I take all the code and put it into a swc library and it creates the swc with out any compile errors. I go to use the swc and it gives me warnings and want run spaying that
"Description Resource Path Location Type The definition Arrow.Right_png$c7cf89b0fd8fa396e54e299a767d2beb1814885492 depended on by plus.assetsClass in the SWC D:\Adobe Flash Builder 4.7\as3Test\bin\as3Test.swc could not be found projectName line 0 Flex Problem"
Does anyone know why it is doing this or what is going on?
So i figured out what i was doing wrong so what i was trying to do is build some Actionscript into a swc file for reuse in other project.
In side the swc I had some as3 files that had some embed codes in them such as...
[Embed(source="Botton Arrow Down.png")]
public static var buttonDown:Class;
Witch works when it is in a project but when you use the above code in a swc the spaced cause it to not be able to find the embeded file. After the swc is compiled. BUT this does not cause a compiler error in the swc it just causes a warning saying that it can't find the file on the project that you are using the swc in. To fix this just remove all of the spaces.
[Embed(source="Botton_Arrow_Down.png")]
public static var buttonDown:Class;
With the spaces removed it work fine. I don't know about this but it is something to remember when using swc to hold embed assets. Hopefully someone will be able explain why.

mxmlc load-externs is ignored

I develop an ActionScript 3 project using FlashDevelop 4.
I have a main SWF holding all the code.
I want to export some of the main SWF code into modules.
I created a module to hold the separated logic (by extending ModuleBase).
I don't want the module SWF to reference anything that is available in the main SWF so i ran the main SWF compilation with -link-report and got a report.xml file holding all the main SWF references.
I tried to compile the module (mxmlc) while excluding any class or library in the main SWF using the load-externs=report.xml option.
The compilation gave me an error saying that some libraries references are missing, but the error message referenced classes that are suppose to be included only in the main SWF.
I checked the report.xml file and it does show that these classes are referenced.
I tried to run the compilation in 3 different ways and always got the same result:
Using the build current file in FlashDevelope and giving the file a header of the command that should be ran.
Using command line (windows).
Using Ant build script.
Does anyone have any idea why this could happen?
I would be happy to supply more information about my problem if it helps anyone guide me to a solution.
Thanks for the help!
It turns out that it did not ignore the load-externs.
The load-externs excluded some of the libraries and therefor these libraries were not found during compile time.
I solved the problem by adding the libraries path to the compilation.
This was done by addind the flag: -l+=lib\

The definition of base class ByteArrayAsset was not found

I'm using FlashDevelop4.0.0 RC1 to create AS3 library project, in which I want to import Away3D library. I follow this tutorial to set up my FD.
http://www.mclelun.com/blog/2011/08/flashdevelop-stage3d-away3d/
However, FD generate error message when I use ExportSWC4.2 plugin to compile the project, I got error message said that
at away3d\materials\methods\TerrainDiffuseMethod_NormalizeKernel.as(10): The definition of base class ByteArrayAsset was not found
Can anyone help me with that? Thanks!
p.s.
I also have issue like the following link
http://sourceforge.net/tracker/index.php?func=detail&aid=3401191&group_id=252536&atid=1127375
not sure if it's related to my problem.
Are you downloading the zip package from http://away3d.com/download/ or accessing via SVN / GIT?
http://away3d.com/images/uploads/releases/away3d_4_0_110915.zip
Not sure about their GIT, but I found the SVN repo dated.
I did not see ByteArrayAsset anywhere in the inheritance chain within my version:
away3d.materials.methods.TerrainDiffuseMethod
away3d.materials.methods.BasicDiffuseMethod
away3d.materials.methods.LightingMethodBase
away3d.materials.methods.ShadingMethodBase
mx.core.ByteArrayAsset is an Adobe class.
There's a NormalizeSplats Pixel Bender linkage, but I did not see any Normalize Kernel.
I'd recommend grabbing the Broomstick ZIP package - I had no issues building the SWC with Flash Builder targeting Flash Player 11.