Flex/Actionscript: Unable to add archive file - apache-flex

I have an Flex 4 application that I am developing in Flash Builder 4. I'm trying to use a library developed by a coworker, which was delivered as an SWC.
I added the library to the Library Path in the project properties. Component set: MX + Spark, Framework linkage: Merged into code.
When I attempt to instantiate a component from this library, I get the following error:
unable to add archive file: [library].swc$locale\en_US\..\..\resources\images\AcceptButton.png (The system cannot find the path specified)
When I unzip [library].swc, the image does exist in .\resources\images\AcceptButton.png as I would expect.
Any suggestions to go about resolving this would be much appreciated.

Your best bet is probably to get the uncompressed source code and see if you're having the same problem. It's difficult to guess at what's going wrong inside a swc file. It should function the same way as the SWC.

Related

Cannot find correct file called qtnetwork4.dll

Guys I've written app in qt and when trying to run it (double click on *.exe) I'm getting error that this application cannot start because qtnetwork4.dll isn't available. I've searched my drive and I found few files with this name (and copied one by one every time trying to run my app) but none of them seems to work. How can I solve it?
place into your *.exe - folder appropriate dll-s from %QT_PATH%\bin\
There is an app called Dependency Walker that will let you know what functions in qtnetwork4.dll are being used in your program. It can be found at the following:
http://www.dependencywalker.com/
All of the DLLs your program use will be from the same installation as the qmake.exe that is used to compile the program. If you are using Qt Creator you can see where the qmake.exe your using is located by going to:
tools->options->Qt4
Get the DLLs that are located at the path displayed here to make sure they will work with your program.
On windows, DLL are looked for in folder where executable lies, then using "PATH" environenment variable.
In your case, you want to put your dll along your executable, taking them from the sdk you're using to compile
The following page provides a lot of additional information on the subject (example, plugins, strategy for building installers)
To force using QtNetwork and linking it, you have to put
QT += network
in your poject file.
If you're sure you're not using it, you can use
QT -= network

Imported flash builder project unable to open swc

I wanted to import an older FB project into the flash builder on my new pc, but I only have the filestructure. So I used 'import>existing projects into workspace'.
The files seem to be intact still, but the project now gives me an error regarding an swc in the bin folder: 'unable to open \'something'\bin\'something'.swc
I have no idea how to solve this, or what this even means. Can somebody lend me a hand here?
This would be referring to an old library project that you forgot to include in your workspace (or open). In Eclipse, when you specify a path as /your-library-project/some/path, it automatically resolves the real path to whatever you're trying to reference.
In this particular case, you were referring to the swc created by this library project and linking to it directly. To fix this issue, you'll need to find the library project and import it into your workspace.

Compiling with Flex4 SDK

I'm trying to compile an existing Flex3 project with the Flex4 SDK. I'm getting this error:
Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.
The resulting file is roughly the same as my old Flex3 compiled .swf file. Playing the resulting .swf file in the Flash Player also gives the following errors:
An Actionscript error ocurred: VerifyError: Error #1014: Class spark.core::SpriteVisualElement could not be found
If I set the compiler attribute static-link-runtime-shared-libraries to true, then the error disappears and all is well. However, the size of the resulting .SWF is a couple of 100K's bigger. And that's not what I want.
I don't fully understand the concept of runtime shared libraries, but it seems that with the option to statically link them set to true, the libraries are included in the .swf. However, I like to exclude them from the .swf and only load the needed library at runtime, as my project seemed to do with Flex3 (I didn't know that by the way).
If I understand correctly, playerglobal.swc should hold all the necessary code for the external libraries that my .swf has to load. Do Flex4 compiled files need more libraries? Should I do something with the factoryClass in the Frame metadata tag?
I think my question boils down to this: How do I compile a Flex4 .swf that is the same size as my previous Flex3 compiled .swf?
You have to add [Frame(factoryClass="path.to.your.preloader")] to the main class (the one you set in the compiler options).
Flex3 did not use rsls by default but you could enable them. Flex4 rsls are enabled by default, see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7add.html
The concept of runtime shared libraries is: splitting of a part of your application that is (re)used by other apps as well, thereby only requiring the user to download it once. This won't save anything on the first download but will save on later downloads. You could possibly make your own rsl, but it's mostly the ones provided by adobe that are meant to make the difference: Since 'everybody' will use them there will be a bit chance the library you need is already present on the user's system, thereby speeding up the download-time of your app.
playerglobal.swc never contained any flex framework classes, most of them are in flex.swc and framework.swc (a standard flex 3 project also includes rpc.swc and utilities.swc - I didn't check but these probably contain some flex parts as well)
Looks like you might have project migration problems. You might want to read up on the process on:
http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html
It's a really good article with overview of different possibilities for migration, depending on the amount of Flex4 stuff you want to use.

Runtime error when compiling flex application with ANT

I'm using a licensed version of Flex Builder Pro to develop an application.
I compiled the swc and generated swf successfully using ANT tasks.
It contains an Advanced Data Grid also. When this application is accessed, I get a runtime error and it fails to load.
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.controls::AdvancedDataGridBaseEx/getSeparator()
at mx.controls::AdvancedDataGridBaseEx/createHeaderSeparators()
at mx.controls::AdvancedDataGrid/createHeaderSeparators()
at mx.controls::AdvancedDataGridBaseEx/drawSeparators()
at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()
at mx.controls::AdvancedDataGrid/updateDisplayList()
at mx.controls.listClasses::AdvancedListBase/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()
I'm adding datavisualization.swc and datavisualization_rb.swc in the build paths.
How can I successfully compile the application without any runtime errors?
Please help.
Include the swcs in the library path as shown here.
Maybe this helps: http://kb2.adobe.com/cps/403/kb403121.html
By coincidence I had the same error a couple of days ago. The source of this problem was a library against I built, which was linked statically against an older version of the datavisualization libraries. Normally libraries should only be compiled against other libraries using the external-library-path compiler option, but this library was compiled incorrectly.
So that library contained older parts of datavisualization that were referenced by code in the library, while my code referenced newer parts from the datavisualization library itself. The result was a mix of older and newer datavisualization classes at runtime.
So check the SWCs that you include in your library path. You can extract these with a ZIP tool. You will then find a catalog.xml file in there. Search for mx/controls/AdvancedDataGrid in this file. In case you can see it included in the catalog, you've found the bogus library.

Flex drawing example error

I am new to flex and i am trying to run the code for flex drawing application example given at following path:
http://www.flashcomguru.com/components/flex_whiteboard/whiteboard_demo/srcview/index.html
But I get the following error at the compile time:
''Unable to locate specified base class 'Whiteboard.WhiteboardManager' for component class 'Whiteboard.Whiteboard'.''
Please someone suggest me that why it is coming and how i can overcome this.I am using Flash player version 10 and flex 3.0 sdk for the project.
Please help.
Thanks in advance.
You need to include the WhiteBoard.swc library in your project. If you're using Eclipse/Flex Builder go to project properties -> flex build path -> library path -> add swc. Or moving it to the libs folder should be enough.
The sources for the component are not included in that demo as it is not a free component. I didn't see a demo version either, so unless you buy it, you probably won't be able to run those sources locally.
Sounds to me like your source paths aren't set up correctly. Have a read of this article to see how source paths are set up
http://www.cove.org/ape/quickstart_fb.htm

Resources