CFEclipse and Flex Builder 2
I just installed Flex Builder 2 as a plugin to Eclipse. Previously I was using it as stand-alone. That means it sits along side CFEclipse in the same IDE editor.
I must say, this is a big improvement over what I did yesterday ( with two IDEs opened side by side).
Although, it does look like I need separate projects for CF vs Flex. The ability to create a combined project that uses both technologies would be nice.
I've been experimenting with creating Flex 2 components (It seems like a natural way to build apps). I cannot figure out how create variables inside a component that are accessible from the application which contains the component.




You must define public bindable variables in your component
In your application you can use:
<mycomp myproperty="somevalue"/>
in mycomp:
[Bindable]
public var myproperty:myPropertyType;
I was trying to make an Actionscript variable accessible; but you are right the MXML components were accessible w/o problem.
(I discovered that right after I posted)
João,
Thanks that was exactly what I was trying to do. It seems like a much cleaner solution, to me, than creating invisible 'labels' to hold component data.
I did not know that existed. It seems like that is exactly what I was looking for. Thanks!
Quick question - in the declaration of "somevalue" at the application level, do you have to declare that as [Bindeable] too?
David
So in an Application, you could just put 'public var foo:Boolean = true;' (w/out any metadata tags) and reference it as 'Application.application.foo' elsewhere in the app.
Thanks for the tip - as a matter of interest, you have a double reference to "application" - as I'm new to Flex 2, I don't understand why that is - could you explain?
Thanks,
David
And if there were an hierarchy of Application objects we could traverse up.
If you want to avoid mx.core.Application.application all over your app, you should take a look at cairgorm. Cairngorm is a MVC framework for Flex. For now is still alpha (for flex2).
If you have any questions about Flex you can contact me anytime.