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

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.

Related

Away3d SWC: some classes are missingg

I downloaded the built version of Away3D 4.1.6 and imported to my Flash Pro CS6. But there some classes are missing:
away3d.entities.Mesh
away3d.entities.Camera
away3d.entities.Sprite3D
maybe other classes, too. (I've not compared).
There are no errors when compiling this code:
var mesh:Mesh = new Mesh(new CubeGeometry());
but, I cannot view the available properties and functions, when I put a dot after the variable mesh.
After this I downloaded source files of away3d, but compiling takes about a minute. So, it gets boring to work. What should I do?
I found this bug too. I solved this problem by generating SWC of their own. Just download source files and create a lib project (FB).
PS. my SWC file is 20% less than default. I don't now why.

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

how to share a component in as3

I have a custom component(eg. MyButton) used in several swfs. I'd like to share the component in runtime, thus once our designer change the button's visual effect, we need not publish all flas that uses this button.
In as2, I can put this button in an asset fla(eg. lib.swf) and check the "export for runtime share" in symbol property. Then copy the button to a fla(eg. main.swf) and check the "import for runtime share", this works fine. However in as3, after doing above, if I put a button instance on stage and modify its inspectable property, i'll get a compile error "1046:Type was not found or was not a compile-time constant".
I searched the web and found this http://www.kirupa.com/forum/showthread.php?317257-Runtime-Shared-Library-woes. Then I tried the swc approach, but it seems swc will be compiled into swf, it doesn't share at all.
the shared component must be put on the stage, because all fla will be modified by our designer while he knows nothing about programing.
we can not use flex, all operation must be done in Flash CS5.
1: Placed on Library all of your components to .fla as follows: my fla names BrushClip.fla the components wrapped a MovieClip. and be ActionScript Linking export to ActionScript Class.
2: File - Publish Settings check SWC format and publish as follows:
3: check, created swc file in your project. now you can using a swc other project you must linking to SWC library in File-ActionScript Settings-Library Path. and later if you change a components design, re-publish. and copy and paste swc file. automatically will change restart swf file. BrushClip.swc has a all components.
you can access as follows:
var brushClip0:MovieClip = new BrushClip0();
addChild(brushClip0);
var brushClip10:MovieClip = new BrushClip10();
addChild(brushClip10);
I've found the solution.
Give the Sprite that holds the imported components a binding class
Edit the class file, declare the components yourself regardless of whether checked the "auto declare instance on stage"

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

flash cs5: compiling fla with huge internal library takes YEARS !

by using flash cs5 with a huge internal image library (over 300+ small png-files) i need more than 90seconds for each compiling action! the as code is pretty well, also my computer (quad core, 4gigs of ram). i've found out, that by exporting the files to "stage 1" (bild 1 in my screenshot) flash starts to hang around, but i don't know why...
.
how to speed this process up ?
__________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________
my solution did not work:
so i've played around and ended up creating *.as-files for each single bitmap, but the speed-result is the same (maybe 10% - 15% faster than before)...
package
{
import flash.display.*;
dynamic public class MY_BITMAP_NAME extends BitmapData
{
public function MY_BITMAP_NAME(width:int = 500, height:int = 135)
{
super(width, height);
return;
}
}
}
i can not work fast enough to debug my project files :-(
The solution would be to move your assets inside a precompiled SWC library that you will only recompile when they change.
Building the library:
create a new FLA and move in your Bitmaps,
each image needs to have a linkage class name and be exported in first frame; you don't have to create an AS class, Flash will generate them,
in the publish settings, "Flash" tab, check "Export SWC",
this SWC library will be published in the same location as the SWF; in CS4-5 you can't prevent the SWF creation.
Using the library
in your main FLA publish settings, "Flash" tab, open the Advanced Actionscript 3 settings dialog,
in the "Library path" tab you can add the assets library SWC; make sure the "Link Type" is "Merged into code",
SWC content will be available in your main FLA as if they were in the library.
It is worth noting that:
you must instantiate these assets by code (ie. new AssetName): they will not appear in your main FLA's Library panel and you can not drop them on the timeline,
only assets you explicitly reference in your code will be available at run time; if you are using getDefinitionByName() you must still import the assets somewhere in your code. For instance you can declare an Array containing all your assets classes (ex: var assets:Array = [AssetClass1, AssetClass2,...]).
if these 300+ images don't change too often, you could create a second .fla, where you only put the images in the library. Then you publish that .fla as a swc file (You can set this in the publish settings).
And you use that swc in your original .fla (that now has no images anymore), where you have your code (using the swc means, in the publish settings -> actionscript settings, you set the swc as a library reference).
This way, Flash only has to compile your code and simply takes the already compiled images from the swc. It then should compile much faster.
ctrl+enter, that will compile all things in library and the AS code.
most situation that use just change little things, and then compile it.
it would waste much time that no need to waste.
you can export some thing that would not always be changed to SWC file, and to to publish setting,
add SWC file into your Fla. or move you Fla project to Flash build, compile use less time more than in flash ide.