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

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.

Related

Customize Adobe File

I have a problem with my Flex Builder Plug-in.
I'm using the Flex Builder 3 Plug-in in my Flex application (in Eclipse).
Now I want to customize the MessageResponder.as File in the Plug-In. I found the ActionScript File without any problems, but the point is, that my changes doesn't cause anything because the file is allready compiled. (That's my guess)
Now my question:
How can I compile the file after editing it? Is there a possibility at all?
Thanks for your help!!
What you want to do is called "Monkey Patching." What you need to do is create your own version of the file in the same package location, and yours will be used in preference to the one from the swc.
The MessageResponder.as class is a file in the Flex Framework. You can modify it if you want, and--in essence--create your own version of the Flex SDK. However, you will most likely have to re-buld the entire framework for this to work. You're best bet for doing this is to get the source for the most current Apache Flex SDK; modify your class and then build the framework from scratch. After that you can use the Flash Builder "multi-SDK feature" to use your modified SDK in a Flex Project.
I'm not sure if Flex Builder 3.x supports multiple SDKs.
This may be a time consuming process. The alternative is to extend the MessageResponder and add your changes. Then you'll have to make sure that your new MessageResponder class is used instead of the old MessageResponder class. This could difficult due to many private methods used in the Flex Framework.

Cannot find sparkskins_xxx.swf

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.

Flex Builder Plugin in Eclipse - Some Controls not available !

I downloaded Flash Builder from here : Download
I recently started writing some small programs in Adobe Flash Builder Plugin for Eclipse.
I am trying out those programs by reading out the Adobe book : Training from the source.
But, I found that some of the controls mentioned in the book for some e.g, such as ApplicationControlBar doesn't appear in the Adobe Flash Builder 4. That control is mentioned in the book, but unable to find in the Builder.
What should I do ? Any suggestions ?
I suppose you've created project using Flex 4 SDK which is default in Flash Builder 4. And the book covers Flex 3. So Flash Builder created spark Application container (from Flex 4) where ApplicationControlBar isn't actual anymore and replaced with controlBarContent property which allows to skin Application more flexible way.
So I can recommend you the following 3 solutions how to use Flex 3 (to be compliant with the book) in your project:
The easiest way to switch existing Flex 4 project to use Flex 3 is the following. Open project properties then Flex compiler > Flex SDK version > Use a specific SDK and select Flex 3 SDK which should be available there. Then you need to create new application in your project, select it as default using context menu, copy old application context to the new one and delete old application file. But I suppose it is better to create new project as far as you are dealing with sample apps from the book.
So just create new Flex project and select the right SDK version on the New Project master's first page.
If you plan to use only Flex 3 for your book's playground workspace you can set Flex 3 SDK as default so you won't need to select the right version on project creation. Just go to the Preferences > Flash Builder > Installed Flex SDKs and select the default version. You can go there right from the new Flex project wizard by clicking Configure Flex SDKs…
Hope this helps!
I've never seen or heard of an ApplicationControlBox. Perhaps they were referring to the ApplicationControlBar and that it's just a typo.
Adobe has some great documentation out there on each of its packages and classes. It's a great place to start if you ever have a question about one of the components.

Upgrading Flash AS3 project to CS5 and using Flash Builder 4 as IDE

I have been working for quite some time with the Flex Builder (3) as the development IDE,
and used Flash CS3 to compile my flp file (all the actionscript I wrote in the Flex Builder).
I don't use any of the Flex components. Pure AS3 and FLA for symbols.
I want to upgrade to CS5, and I read that there is a new Flash builder IDE so I thought I'll give it a try. But In the Flash builder I see that they have tighten the Flex SDK relation (which is kinda stupid since they change the name from Flex to Flash?) so I am a bit stuck with how to migrate my project.
Furthermore, is there a way to download the Flash 10 compiler/SDK or whatever to make it compile from the Flash builder, and not use Flash CS5 for it?
Thanks a lot.
Chen
You can create pure AS3 projects with the FlashBuilder IDE without worrying about the Flex framework. Simply create a new Actionscript project. You can then compile your project in FlashBuilder and strictly use CS5 for your graphic assets.
In order to migrate your project , you only need to add your classes folder to your project source library.
With Flash CS5 , export a SWC and add it to the project's library path. All this is accessible via your project Properties.
From that point on, you should be able to access both your project classes and your symbols by declaring your variables with the relevant classes.
Edit
Start simply, first create a new Actionscript project in FlashBuilder.
http://help.adobe.com/en_US/flashbuilder/using/WS6f97d7caa66ef6eb1e63e3d11b6c4d0d21-7ff7.html
After you successfully created a project and tested it, you can then add the code from Login.swf.
If you've been using a Document Class, you could create an instance of that class and add it to the stage, you could also simply copy the code in your Main class.
If Login.swf doesn't use any graphical assets, you should be good to go, without the need to load any SWCs.
You could also refactor your code so that each concern is encapsulated within its own class. For instance, if Login.swf serves as user login and loads a bunch of SWFs, it may be a good idea to create a Login class and an AssetsLoader class.

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.

Resources