Cannot find sparkskins_xxx.swf - apache-flex

I am trying out to deploy a flex application in one of our servers. I was able to deploy it but running it causes some problems like missing swfs.
One of these missing swfs is the sparkskins, which I am not sure where to get from.
Any ideas?

Maybe you should change framework linkage to "Merged into code" for you project.
In FlashBuilder this option is here: Project Properties window -> Flex Build Path list item -> Library Path tab -> Framework linkage combobox.
After this your sdk swfs will be compiled into your flash app.

Related

Flash Builder: how to get flex project framework into ActionScript project?

If I create a new flex project with flashbuilder, these are the libraries that get included by default through the Flex SDK:
http://neo.cycovery.com/flex_problem4.gif
If I create a ActionScript project, then the Flex SDK framework with the exact same path includes much less swc files:
http://neo.cycovery.com/flex_problem5.gif
how do I get the full flex framework into an ActionScript project?
If I try to add for example aircore.swc manually, i get a
Description Resource Path Location Type
An internal build error has occurred. Right-click for more information. mvp Unknown Flex Problem
error
Erm, you can't. Flex is a framework that brings more functionality to the table, which Actionscript cannot comprehend (and if I remember correctly, you AS project will be sprite based while Flex's is UIComponent based). You can only load a Flex application in Actionscript using the Loader.
Can I ask why are you creating an Actionscript project if you want the capabilities of Flex? Why not just create a Flex project?
In Flash Builder's new Project wizard, you need to create a new "Flex Project" and then select "Desktop" as the application type. In next screen, it asks for default main class, just specify your main .as (ActionScript) class file here.

Flash Builder 4 Release Build multiple files

When i make a release build the folder is populated with a number of swfs. Are all these swfs necessary? Is there a option to generate one swf?
Thanks in advance
EDIT
The files I see are:
framework_4.5.0.18623.swf
osmf_1.0.0.16316.swf
rpc_4.5.0.18623.swf
spark_4.5.0.18623.swf
sparkskins_4.5.0.18623.swf
textLayout_2.0.0.200.swf
playerProductInstall.swf
I assume you're using Flash Builder 4 and/or Flex 4 SDK and see a bunch of SWZ files is that correct? These are framework files which can be cached by the player across multiple domains. Through this caching, the download size of your app is smaller because all these dependencies are left out.
If you want to combine everything to one SWF, in Flash Builder 4 open up the project properties and choose Flex build Path. You'll see a framework linkage option. Change it from "Runtime shared library" to "Merged into code. This default value was changed when moving from Flex 3 to Flex 4.
I'm not sure how to do it via command line, but I'm sure similar options exist.
Be warned, though, this will make your SWF bigger and you won't take advantage of the framework caching options.
Update:
The files you're seeing are definitely Flex Framework files. The reason they are SWFs instead of SWZs is because you are using a prerelease SDK (4.5 ) and the SWZs are not available for caching yet.
Here's what I found:
With Flex closed navigate to:
{Your Flex installation}\sdks\4.1.0\frameworks\flex-config.xml (where 4.1.0 is your latest version)
open flex-config.xml and scroll down until you see 6 items for "runtime-shared-library-path" it will look similar to:
<runtime-shared-library-path>
<path-element>libs/textLayout.swc</path-element>
<rsl-url>http://fpdownload.adobe.com/pub/swz/tlf/1.1.0.604/textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</policy-file-url>
<rsl-url>textLayout_1.1.0.604.swz</rsl-url>
<policy-file-url></policy-file-url>
</runtime-shared-library-path>
Edit the "rsl-url" tag to place the swz file where you'd like:
<rsl-url>myrsl/textLayout_1.1.0.604.swz</rsl-url>
Do this for the remaining "runtime-shared-library-path" tags. Save it and launch Flex, your release build should now dump those .swz files into a folder called myrsl (or whatever you named it)

Flex Library Project: NativeMenu vs. ContextMenu

I have a Flex Library Project which has both Flex specific classes, and Air specific classes.
When I reference the library in an Air project, the compiler complains about an overriding contextMenu in mx.containers.Panel, saying that the param should be of type NativeMenu (instead of ContextMenu). If I switch it over to NativeMenu then it compiles fine.
The issue is when I reference the library in a Flex Project. This time it complains that it doesn't know the type NativeMenu. If I try to change it back to ContextMenu, then I get the same error as above.
I've searched google to no avail (found that someone else encountered the exact same problem: http://forums.adobe.com/thread/598791?tstart=-1 )
The docs don't help too much either, except stating the above: http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObject.html#contextMenu
I'm thinking that its just not possible to do the mixing of Flex vs Air SDKs that I want, but I was hoping that maybe someone has figured this out.
Thanks!
You can't really target the web Flash Player and the desktop Player using the same project.
I would recommend encapsulating out as much functionality as possible into a library project. Then create a single Flex project and a single AIR project, both using the same library project.
Each respective project can extend, or replace, the different functionality.
I am not sure if this is the exact same problem, but I was having an issue with being able to reference the AIR libraries in a Flex Library project and found the (rather simple) solution.
Using Flash Builder 4.5, when creating a Flex Library Project, (right-click .. New.. Flex Library Project) there is a checkbox for "Include Adobe Air Libraries" at the bottom. This must be checked or AIR libraries will not be included.
When you select the version of SDK/AIR you are using in the dropdown, the message should also indicate what the minimum version of AIR required is for your application.

Creating Flex 3.5 components with Flash CS5

Is there a way to create components compatible with Flex 3.5 by using Flash CS5? I'm stumped. Whenever I run the "Convert Symbol to Flex Component" command and then try to use the resulting .swc file in a Flex 3.5 app, I get multiple instances of the following error:
1046: Type was not found or was not a
compile-time constant: Matrix3D.
1046: Type was not found or was not a
compile-time constant: Vector3D.
Any help or suggestions?
I had the same problem. I found a work around, though. You need to create the component using Flash Builder by dragging a Flash Professional Component onto your application. (You must be in Design Mode to do this.) Then, in the properties sheet, there will be a button labeled "Create In Flash Professional..." Clicking this button will create a Flash Document with all the correct frameworks and sdks and launch Flash Professional.
The errors you are seeing are usually brought on by a version mismatch between the Flex SDK that the SWC was compiled against and the Flex SDK of your project.
When creating SWCs using the Flash Pro interface, I'm not sure if they can be used in Flex. Generally SWCs are not sharable between Flex and Flash. People either recompile the source code or generate a SWF and embed it or load it using a SWFLoader.
If you're using the Flex Component Kit for Flash make sure you're using the same kit that came with the SDK you plan to target.

Unit Testing Flex/Flash Libraries in FlashBuilder

For a normal Flash/Flex application I would include my Unit Tests in my application project (perhaps in a tests source folder alongside my main src folder). I'd then have two application entry points: the app, and it's tests.
How are people doing this for their Flex Library Projects? You know, the kind that produces a SWC file. As far as I can tell, you can't set an executable entry-point for these projects (to run the tests).
Normally, Flash Builder only allows you to use the debugger from a Flex/AIR application, not a library project. So best thing to do here is load the library into a Flex application and write+debug tests there.
Here are step-by-step instructions to be able to test your library project, with debugging/stepping enabled:
Create a Flex Library project that you want to test + debug
Create a normal, empty Flex Application. We will write the tests in this dummy Flex Application so we can utilise the debugging features.
Set the library's build-path to the 'libs' folder of the Flex Application so it builds most recent code into a swc loaded by the Flex Application.
Optionally, set the
Flex Application to 'reference'
the library project in Project
Properties->Project References, this
ensures the library code is built first.
Write your tests in the Flex
Application
Debug and run your tests: you
should be able to step through your library
source code! Nice.
Optionally, once you're satisfied your tests are all good
copy your tests back into the
library project to keep all the library's associated code together in one project. Make sure you're not including the test classes in the actual library swc.
This is how I do it anyway.
If we assume that you need an mx:Application entry point to run the unit tests, then it would seem to make sense to generate a separate application project solely to run the tests.
Would you really want to include the unit tests in the compiled SWC anyway? (For an application this wouldn't be a problem since they're, presumably, not referenced, but for a SWC library I think they'd be compiled in if they're in the folder hierarchy somewhere)
In Flash Builder Beta 1 onwards itself, you can write and execute Flexunit tests from a library project.
You can use the IDE integration feauture of FlexUnit, and select the project, folder , class or method from the context menu and use "Execute Flex Unit Tests". This will create the application file of the required syntax, run the application and show the results in the FB. You can even select from the result and run the tests are requried.
There isn't currently a way to test a library project. You must have an application as the entry point to the tests. This would be a great feature request for Flash Builder 4.

Resources