Flex Chronicles: Part 3 – childrenCreated & show

When you have a component inside a TabNavigator (I believe this applies to a ViewStack as well) (ViewStack’s show DOES get called it seems the first time… or maybe it’s because the TabNavigator is inside a ViewStack ::shrugs::), you can use the tried and true childrenCreated event to do initialization, since just like onLoad in Flash, it runs a frame after everything is setup, allowing you access child components. However, it only gets fired once. In the case of a component you want to reset itself each time it gets shown in a TabNavigator, you can use the “show” event. It gets fired once when the component is shown. The cool thing is, it does not get fired the first time the component is shown.

I had a component that shows blog entries. Upon being initialized, it’d call a webservice. However, this was only getting called once; I couldn’t call it remotely, because the call wouldn’t work the first time… since the component isn’t initiliazed the first time. Sooo, I was like…uh…wtf. Initialize called too early. Now, I just put my getEntries function call in both childrenCreated and show, and it works great!

Flex Chronicles: Part 2

Was there a part 1? Yeah dude, when I used it before. I didn’t make it through many tutorials, though, only the walkthrows and videos. Last night and this morning, I went through that 56 page PDF tutorial (you can also see it LiveDocs). I’ve been digging around in the samples, LiveDocs, and pinging peeps on AIM and email for help when I run into a brick wall.

All in all, Flex is pretty hot. The speed at which you can develop form based apps seems like it’ll be faster than what you can do in Flash. It’s slow for me because I’m still learning, but I’m digging the layout tools the most; reminds me a lot of XUL …only, it’s Flash. The direct linking of CSS stylesheet props like you do with HTML is just rad.

As I hit weird hurdles, I’ll document them here. Even though most are probably newb, green, cut your teeth types of problems, I’d much rather be the newb who can go on Google, type in his/her issue, and find my site lamenting about how I already went through the problem, and posting a solution.

Without further adu(sp?), I was having problems with Flex finding my external script. I’m making my GUI in an MXML component, and referencing the class code out (well…like, just functions and properties, that’s how Flex makes classes associated with an MXML component; weird concept (weird cause it’s new to me)). It kept complaining it couldn’t find it. I tried all kinds of filepaths after reading about how import/include work in the LiveDocs, and finally foobarred it enough to cause a Java nullpointer excepion. Reading the exception, the full filepath was on the server, not my site folder. Turns out my frikin’ file wasn’t on the server. When you run an MXML file, Flex Builder’ll upload it to your test server. However, it didn’t upload the dependant file, Login_script.as. I uploaded the scirpt, and she runs fine. Dar dar dar… so, if you have a similiar problem with your external as files, now you know; just upload them.

…I’m just worried about 60 days from now; I’m not sure how I’m gonna pay for Flex Builder and Flex. Flashcom’s easy; you just get a server with a few amount of users from an ISP who hosts it for you. Not sure about Flex, though. Maybe I can qualify as one of those not-for-profits or something. :: shrugs :: Anyone know someone who knows someone who knows what I could do?

Flex Writing Opp

Anyone who is capable interested in writing a book on Flex covering any/some of the following topics?

– Flex in JSP environs
– Flex apps created with IBM WebSphere
– Accessibility Best Practices
– creating apps
– using Flex overall
– extending with Flash
– app development (more advanced than creating apps)

If interested, or know someone who may be qualified, please email me/forward them my email, thanks!