flex4 sdk in flexbuilder3, debugger partially works - apache-flex

If I changed used in one of my project sdk to current sdk4 beta, set breakpoint and stop on them every occurrences of mx.* packages are labeled "[no source]". Is known any trick to fix this issue?

Not sure why Flex Builder isn't figuring it out by itself, but you can manually set the source path of any swc on the library path (you have to do this for each project):
Right-click on the project, Properties
Flex Build Path property page
Library Path tab
Expand the "Flex 4.0" node at the top, then expand the swc that you want to attach source to
Double-click the "Source attachment" line, and specify the root dir of the source, e.g. C:\...\mysdk\frameworks\projects\framework\src

Related

Reduce size of swf from Flash Builder

I have created a simple Flash Builder 4.6 project containing a simple button, and i have exported the project with release option, with mx namespaces.
The problem is that the file size is aboud 266 kb with the compile option: Merged into the application. I use only a simple button. My question is there is a way to remove any reference to mx library that i don't use in my code in order to reduce the swf size.
The option "Merged into code" will actually already figure out what needs to be compiled into the application and strip out code that you don't use. As a test, try adding another different component and create another release build. You'll notice that the filesize is bigger.
The best way to reduce the swf size is to use Runtime shared libraries (RSLs). This is the default linkage option of the SDK.
http://livedocs.adobe.com/flex/3/html/help.html?content=projects_7.html
try this:
Project -> Properties -> Flex Build Path
Make sure the combo "Framework linkage" is selected with the value: 'Merged into the code'.
Below you should have a tree named "Build Path Libraries".
Expand the first node. Then try to remove the libraries by selecting the relative node and clicking on the Remove Button on the right

Adding a library into Flex 4 (flex iframe)

I am trying to use flex iframe with an Adobe Flex project in Flash Builder, and I've added the library through Project -> Properties -> Library Path -> Add SWC Folder but I am still getting the error The prefix "flexiframe" for element "flexiframe:IFrame" is not bound, as if I haven't linked it.
<flexiframe:IFrame id="googleIFrame"
label="Google"
source="htp://google.com"
width="80%"
height="80%"/>
I am extremely new to Flex, and I cannot find any good resources on it.
You are probably missing the namespace definition on top of your file:
<s:Application xmlns:fx=“http://ns.adobe.com/mxml/2009”
xmlns:s=“library://ns.adobe.com/flex/spark”
xmlns:mx=“library://ns.adobe.com/flex/mx”
xmlns:flexiframe="http://code.google.com/p/flex-iframe/">
[...]
</s:Application>
You can see this in the user's guide.
First download SWC folder from http://code.google.com/p/flex-iframe/downloads/list.
Then set this Project->Properties->Flex Build Path->Add SWC.
Link .swc from build folder. Include this also xmlns:flexiframe="http://code.google.com/p/flex-iframe/"

Exporting release build - Flex through Intellij Idea

How do I generate release build of my Flex Application
through IntelliJ Idea, like I do in Flex Builder?
Right click on any project and select module setting.
Select tab "Flex compiler setting"
Last field on this tab is "Additional compiler options:"
add "-debug=false" without double quotes to it.
Do this for all the subprojects. (From this form only you can choose different projects).
do a project Rebuild and you will get a smaller swf.
Only problem is you need to keep separate project files for debug and release build, but thats ok, as you release builds are done rarely.
Alternate answer:
Instead of creating a Flex Module, create a Java Module, and add 2 Flex Facet's to it. One facet will be configured as the debug facet, the other as the release facet. This process will create 2 swf files, debug and release versions.
Create a java module, for example "FlexHelloWorld". Do not add a flex facet yet.
In the project view, right click on the project and select module setting
Under the Modules option, select the "FlexHelloWorld" module
Click the "+" symbol, add Flex Facet
Rename facet to "Debug"
Enter your main class name
Enter "debug.swf" as the output file name
Click apply
Click the "+" symbol, add Flex Facet
Rename facet to "Release"
Enter your main class name
Enter "release.swf" as the output file name
Under additional compiler options, add "-debug=false -optimize=true"
Click ok
Build the module. In the output directory, you will have "debug.swf" and "release.swf" files.
Note: In your HTML wrapper, you will have to call either debug.swf or release.swf. Or you could create 2 wrappers.
Does IntelliJ support Ant? Maybe not the answer you're looking for, but you could use the Flex Ant Tasks to build outside of FB.
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

How can I access data from a .fla file using Actionscript 3, Flex 4 SDK, and FlashDevelop?

Someone sent me a .fla file containing several art assets, with instances all configured to be displayed properly and in the right positions. However, since I'm using FlashDevelop with the Flex 4 SDK, I have no idea how to access these instances in code. Some of the objects are MovieClips that I need to modify the size of, and others are Dynamic Text objects that I need to change the display strings of at runtime.
If you have access to Flash (as in the development tool) you can right-click on a MovieClip in the library and select "Export SWC file".
The SWC file will contain all of the elements that have the "Export for ActionScript" property enabled. Place this SWC file on your classpath and FlashDevelop will tell the Flex SDK to link against it when building your final SWF.
If you don't have access to Flash to export the SWC you will need to get the other person to export the SWC file for you - you can't link against the FLA directly.
There's no obvious solution to this. basically, you will have to traverse the display list to find them, using numChildren, getChildAt etc. if you're lucky, they are named and you can use getChildByName.
greetz
back2dos

FlashDevelop - Why does code-completion not work with mx.controls

Today's my first day with Flex and FlashDevelop. In my ActionScript file, I have this line.
import flash.display.SimpleButton;
FlashDevelop is aware about this and Code-completion works fine.
But, when I have this line.
import mx.controls.Button;
Then code-completion doesn't work.
Works perfectly well for me w/o doing anything special. But maybe your project's properties got borked. Do this:
Open Project Properties
Go to Compiler Options tab
In Advanced -> Intrinsic Libraries add the following
Library\AS3\frameworks\Flex3
I had the same problem. Your AS3 class path is pointing at a directory to low in the flashdevelop library folder structure to pick the mx class prototypes.
1.) Within Flashdevelop press F10 to open the 'Settings' window.
2.) In the list on the left click on the 'AS3Context' option.
3.) Imediately Under the group title of 'Language' on the right hand side of the window, find the 'AS3 Classpath' option. Its value is typically set to 'Library\AS3\Intrinsic'. Change the the 'AS3 Classpath' value to read 'Library\AS3'.
4.) FIXED. Flashdevelop should now be aware of the mx libraries, thus autocomplete should now also work.
To include any swc to code complete, add it's parent folder to the swc libraries option. Some people claim that using intrinsic libraries works, but it didn't for me. Here's the paths to both settings:
ProjectSettings->CompilerOptions->SWCLibraries = {path to FOLDER containing swc's}
ProjectSettings->CompilerOptions->IntrinsicLibraries = {path to same FOLDER containing swc's}
It seems like you are missing the Flex framework in your build path. Have you looked at the libraries being included?

Resources