I want to recommend you a great open source plugin I’ve encountered and used:
FlexSpy
It’s basically a FireBug for Flash, but that really works and does the work without choking your browser.
One of the popular complaints about flash developing is that you have to compile in order to see the results of layout and styles.. With this you don’t !
Really Great plugin…
Hey guys,
I was in a Yakov Fain lecture about modularization of flex applications yesterday and it was great, the lecture was organized by Almog Koren, so Almog, Thanks!
As a matter of fact, I already saw this lecture on the internet, but this time I took notice of several new discoveries I wanted to share with you.
Few Tips from the presentation
When loading modules -
you don’t have to load RSL in the main app, only link it as such to the module itself
Merge into Code -
Yakov reminded us that in this linkage option, only classes I used will be compiled into the swf, for more information read my post on Flex linkage types: Merge into code, RSL and External
Fonts slow the compilation –
so always compile your css which embed the fonts as a separate SWF file, and load it dynamically.
Shared Events between modules -
When working with modules, apparently you can listen to and dispatch events from systemManager.loaderInfo.SharedEvents from the main Application.
And on the Module you can listen to and dispatch events from loaderInfo.ShareEvents
That way you can create a simple communication layer between modules and other modules, and between modules and the main application which loaded them.
Preloader as a flash content –
In his book “Enterprise flex application
” he gives and example of using a flash preloader swf who looks like the initial login page in your application, and on the background he loads the rsls while the user verify his details.
It’s a nice concept to think of, especially when you have lots of rsls to load in the preloading of the Application.
That’s is what I gathered from the lecture, here are the slides
Hope it helps someone out there….
Shai
Do you know the “Open Type” command (ctrl+shift+T) command in Flash Builder?
No? well.. you should!
It lets you open up framework source types like Button, Label etc…
Well, sometimes Flash Builder gets a little crazy and don’t let you open the Open Type
I’ve searched a lot on the web to find a solution for this problem in Flash Builder 4, but no luck…
So after a few trials and erros, I’ve managed to restore this useful shortcut, but… I did a mistake and didn’t check after each of my last steps I took if it is fixed… so you’ll have to tell me which one did it for you..
The steps I did were:
- Open Window -> Preferences.
- Open General -> Keys
- Clicked “Restore Defaults“
- Clicked “Apply” and “OK“
- Back To the same keys screen
- filtered the keys by “open type” string, so I will get only those 2 commands
- Changed the shortcut to something else like “ctrl+shift+ A”
- Clicked “Apply” and “OK“
- Back To the same keys screen
- Changed the shortcut back to “ctrl+shift+ T”
- Did a restart to the Flash Builder
This is the part that I didn’t check if it worked right away, so now its a good point to stop and check it (maybe that’s all you need)
If it doesn’t work, try:
- Opened Window -> Perspective -> Customize Perspective
- In “Command Groups Availability” -> Checked the “Java Navigation“
- Clicked “OK” and then clicked “Cancel“
- Went back to the Customize Perspective -> “Command Groups Availability” -> Unchecked the “Flash Navigation“
- Clicked “OK” and then clicked “Cancel“
And please tell me when it started working for you, so I’ll update this post…
Hope this is helpful…
I was searching the web for some time try to find how I can install easily and quickly ANT on Flash Builder 4.
Luckily I ran into this blog post about Installing Ant On Flash Builder 4
Thanks again to zoltanb (the blogger).
Quick and easy, Enjoy!
Problem:
I’ve encountered a strange problem since I’ve updated my builder.
For some reason the profiler didn’t work and showed me this error:
“Unable to connect to the application to fetch profile data”
Solution:
Well, after countless of hours search for a solution, I arrived to this forum and did what the suggest at the end of the conversation – Uninstalling flash player 10.1 and installing flash player 10 instead.
It worked… finally !
I’ve encountered a strange error:
“unable to export SWC oem”
I’ve found that it’s a problem in the .flexLibProperties’s tags.
The solution is to do the following steps:
- Open flexLibProperties (you can open using ctrl+shift+r)
- Delete all the <resourceEntry> tags under <includeResources>
- Go to properties->build-path->assets and select all
- Recompile your project
That should do it…
In my last post about Working With Flex Library Projects, I’ve wrote about the importance of dividing your project into different libraries so you could share common elements between different applications or modules.
Today I wanna talk about the different types of linkage options you have when linking an external library project or swc to your flex project / library.
As you know or may not know, you have 3 different linkage types in flex:
- Merged Into Code
- External
- RSL (Runtime Shared Library)
So, what is the difference?
While googling on this subject I came across this post: Working with Large Applications which explains quite deeply the whole concept of RSLs and linkage, although a bit long for someone who was looking for a quick answer.
So I thought I would write a simple straight forward explanation:
A library in it’s deployment is a SWC.
A SWC combines of a Library.swf with a xml of all the class definitions of the library, called: “Catalog.xml”
When you link a library to a project or another library, you sometimes load the actual Library.swf depending on the linkage type, but you always load it’s catalog.xml file into the main application’s ApplicationDomain.
“ApplicationDomain” is the storage of all the class definitions of an application, and all of the classes it is allow to refer in build and in runtime.
So, here is a summery of the difference between the linkage types:
Merged into code: loads the library’s catalog.xml to the ApplicationDomain and compiles it’s library.swf into the main application swf. BUT , And this is a big one – Only the classes you use in the library will be compiled !!
That means that if you don’t use a certian component, it won’t be included in the catalog.xml and you can’t call it at runtime.
RSL: loads the library’s catalog.xml to the ApplicationDomain (unlike “merge into code”, this one includes all the classes) and also loads the swf into memory only at the start of the runtime , so you could reach a class definition at runtime, and create an instance.
External: loads the library’s catalog.xml to the ApplicationDomain and doesn’t load the swf of the library at runtime, this option expects a preloading of the library swf into the ApplicationDomain.
Lets say you have 3 projects:
- MainProject (Flex Project)
- Lib1 (Library Project)
- Lib2 (Library Project)
If Lib1 is linked to Lib2 via External Linkage, Lib2 must be loaded into memory by MainProject before MainProject loads Lib1, using RSL linkage for example.
If not, on runtime you will get an error of missing or undefined class definitions, when you try to load classes from Lib2.
Linking as external between library projects saves you both compiling and loading time, just remember to preload them as RSLs in your main application first…
Hello one and a half users !
Today’s topic is Flex Library Projects… and why should you be interested in using them..
Well, libraries have several use cases:
Reduce Download Time
You divide your code into logical library struture, for example:
- CommonComponents Library
- CoreArchitecture Library
Now lets say, several projects share the same common components,
if you compile the libraries as RSL the client will download the compiled RSL (swf) only once,
And next time he downloads any projects which uses this RSL it will be much faster.
Reducing Build time
When you’re building large applications, you have to keep in mind that the larger the app SWF file, also the longer it takes to build it in Flash Builder.
So when you are working on smaller specific library projects, and you make changes to code in one project, only that one is being complied again and not all of the others.
Reuse of Components
When sharing common components over several projects / libraries, it is a best practice to export all of those recurring components into a library project, and share that SWC over all the relevant project.
Also, when you’re working on a team, or maybe sharing code with another team at your company, library projects makes a great solution for reducing the conflicts, and for easier testing.
So if you aren’t working with Flex library projects via RSL or External linkage, start rethinking your strategy… It will probably save you a lot of compiling and developing time, and it will save your client downloading time.
If you have other advantages to add, please feel free to comment.
Shai
When I first started writing Flex applications, I had no idea about the MVC concept and it’s importance.
You see, I made a transition from the old HTML/ javascript/ ASP to the exciting world of RIA, and felt very confused when my applications got larger.
If you are a beginner, or don’t know about MVC, it is important the you read about it, and than try to implement it when you are coding new components in actionscript.
Try to think about your application in the following way:
Views (components like comboBox and List), can change applications like old T-shirts, so you write them with no knowledge about the data or logic of a specific application
Controller (usually commands) – Is the logic of the application, and usually specific to that application, it contains all of the actions on the model (data) and the views (change states and such).
Model (the data of the app) – Usually stays the same and is application specific.
So, the major thing you want to take out of this concept is the usability of views.
Write components and views with clear interfaces so they will know only what to render information to the user, but not where the data is stored and how to manipulate it.
to read more about this pattern, here is a good article.
Hope this helps,
Shai
Welcome random visitor who just were curious enough to check out what was on the first post…
Obviously no one knows this blog exists right now, but maybe in a few months it will attract some readers.
I will try to write tiny bits of useful info I stumble upon while working on flex.
In order to be productive, I’m going to keep this posts short and useful (I hope).
So welcome again, and see ya soon.
Shai