Thursday, June 26, 2008

Of things that bind

Bindables, bindables...

I wanted to take the next step with using code behind and tried to bind a combobox to dynamically loaded list in the code.

although i'm quite uncertain that this is indeed the only way to do it, what i managed to be doing is the following:

added to the MXML <mx:ComboBox id="cboOptions" dataProvider="{items}" />

then in my binded application class added:
[Bindable] public var cboOptions:ComboBox;
[Bindable] public var items: Array = new Array();

and in the constructor added:
items.push('nimrod');
items.push('shelly');

it works, nothing more nothing less...

one more thing i found out about flash/flex during the process:
It doesn't like me defining my class as extends canvas as i saw in an example, and yields "no resource manager".
apparently, extending Application is the correct way to start it without getting this error.
couldn't find any documentation that will elaborate on that.

bye.

Find the link

A short appology to self (who else reads this?) : Hectic days means less time to play :-)

back to where we were: In my last post I've shown a way to have some code behind style development using MXML to design layout, and classes to do the code work.

I've found another example, curtesy of blogger called tripu:
http://blog.tripu.info/item/2008/03

marvelous, now that this is behind us, we can start develop properly, no more inline scripting ugliness :-).

Wednesday, June 18, 2008

On thing did troubles me lately - how would one do code-behind like development with Flex.
I see mxml, i see script tag, but i can't find any link between the mxml, and the action script classes.

luckily, I've found today an article that pures light on that shadow:
http://blog.vivisectingmedia.com/2008/04/the-flex-code-behind-pattern/

it seems that this is a very important read, although i didn't manage to operate it today.

must be the hour :-)

night chaps.

Friday, June 13, 2008

object model to give you a sense of where you live

one of the first recommended reads i encountered in FlashDevelop's community forum, and with all merits, was the display object model.
http://www.actionscript.com/Article/tabid/54/ArticleID/ActionScript-3-0-Display-Lists-and-Display-Object/Default.aspx
it gives you a sense of how display works. I needed that when i tried Silverlight, i still need it here.
Think I'm going to stick around, see what this Tibi guy has to say...
ok, let's just dive right into it.

what did i do so far?

downloaded FlashDevelop environement - current version is 3.0.0 b7
http://www.flashdevelop.org/downloads/releases/FlashDevelop-3.0.0-Beta7.exe
quite reasonable installation process, good'ol next, next, next.

and the Flex 3.0 sdk, which is also necessary:
http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+3
notice this is a zip file, all that is required is to save it as a directory somewhere in my
HardDrive.

A few additional prerequisites:
1. The flex sdk is built in Java, I have Java runtime environment 6 update 5, they seem to get along just fine.
2. FlashDevelop is built using .Net framework 2.0.

I run FlashDevelop - nice and familiar IDE. seem to be stable and cousy. great!

next what i had to do (read it somewhere) was to let the IDE know where the SDK is:
just hit F10 (tools->Program settings), selected "AS3Context" and set the property "Flex SDK location" to the directory i saved the SDK to.

that's it. I'm all set up, lets try to create a test project.

created a new project, and a new class - test1.as
one thing to notice - naming the class differently than the file name is forbidden.
additionally, I had to right click that new class in the project tree and mark the "Always compile", otherwise, the class is simply ignored.

now it's time for some syntax and language building blocks.
another thing that bugs me is how do we debug in Flash...

more to come.
-n/

prologue - very short - the how and why...

Hi,
I'm Nimrod Cohen, and this blog will entail how i started developing flash components.

Everything in computer science is about divide and conquer. It is the sanest way to overcome those fears of new starts, and the real way to solve a problem and stay alive.
The strategy is simple: developing a new NASA rocket is...well, is rocket science. finding the first screw driver for that rocket, then worry about the next task - that is easy.
And so it will be with my will to learn flash.

One thing about me, I'm just an open source freak. the freakiest part is that i work with Windows OS. I have ubuntu (Hardy) installed on my old laptop, but i can't kick that habit, instead, i find open sources that work on windows.

lately my brother in law (Yossi Taguri), pointed out FlashDevelop, and i immediately got the tickle, had to give it a go!

brb with the details of the first run...