Wednesday, October 19, 2005

Flex builder 2.0 thoughts

Ok, so today was my intro into Flex builder 2.0.
Where to start?

I started programming when i was 11 in 1981 on my sweet old Commodore 64.
I've done an education in computer science, programming in assembly, pascal... you name it.
But i slowly drifted away from it. I can't tell you exactly why, but it happened anyway.
And then there was Flash. And with it all my passion for developing was back!
For my work i have done some stuff in Visual Basic, but it didn't touch me at all.
So what does this have to do with Flex?
I get the same effect. Don't get me wrong, i think the whole Flex idea is great and i am impressed with the quality of it. But it doesn't touch me.
After a day of trying things and following a couple of tutorials i've had it with Flex. The rest of the evening i've spend working on a new site that's in the pipeline... in Flash 8. And i enjoyed every minute of it!
I love the mix of visual work, combined with scripting, with the versatility with which i can tackle things, with the looseness of it all.
So for me, i'll stick with Flash for now... (allthough i am still mad about the getNextHighestDepth vs Components v2 BUG!!)
Pretty soon we'll be discovering ways to use the new 8.5 player features as well.
Like "Sound.computeSpectrum()" ... :)

Here is a nice page about some of these features : FlashGuru � Actionscript 3 - New Capabilities

I'd love to hear some arguments against (or in favor of) mine...

Tuesday, October 18, 2005

Macromedia Labs - Flex Builder 2 Tutorials

Macromedia Labs - Flex Builder 2 Tutorials

Today i started looking at the new Flex builder from Macromedia.
So far it looks very nice indeed! I still have to figure out in which situations i'd want to use flex instead of just Flash, but in any case i enjoy learning this stuff...
I'll post my findings when i have something to tell :)

Monday, October 03, 2005

How recursive are you?

Something different this beautiful morning :)

A few days ago I spend an evening with a good friend. He is diagnosed with ADHD.
If you don't know what that is, have a look here.
In any case, it stands for "Attention Deficit Hyperactivity Disorder".
We were talking about something which he described as "displacement", where you feel a separation of yourself in some form.
I told him I recognize this effect with some mind games I play sometimes.
One of those for instance, is to imagine infinity.
What helps with that is to look at the night sky. Start from where you are, inside your head, first person view. Then start traveling upwards, keep going, all the while realizing how far you've gone, and how far you still have to go.
If you think about this process from a programmers point of view, and you'd define the situation, you could come up with recursion. In a program, a recursive function, is a function which, once initiated, starts a loop in which it calls itself, thus exponentially increasing the number of loops that are running.
In a program, you can crash the system with recursive loops. So you have to be careful, to build in detection methods for stopping the loop if it tends towards infinity.
If I do the experiment above, my goal is to keep it up for as long as I can, but everytime try it, I can't keep it up for too long. I can almost feel the recursion building up exponentially, and then something inside me decides to let go, and I am back on earth :)
Now imagine you do not have these detection tools, and that in situations like this you get into a recursion... the system crashes!


Recursion is everywhere around us. Even, or maybe especially, in nature. If you're unaware of this and lack the natural ability to stop these loops, I can certainly imagine that life would not be a pleasant experience...

At the same time, I am playing games with it, because I like the experience. I also think it trains my mind to be more flexible and focused.
I don't know if this has anything to do with adhd or anything else, but I thought it at least interesting enough to write it down...

I would love to hear your thoughts about this...

Sunday, October 02, 2005

site builder update

Hi site-builder fans! :)

A small update.
I have decided to go for the "webcenter" alternative (see previous post)

I keep running into issues with flash's security settings.
An example :

Imagine you want to add an image to an item in your database.
If i want to load that image into flash from your local system, i first have to send it to a webserver (php script), then let flash know where i've put it on the server, then load it from the server back into flash... to load an Image!!
And that goes for anything you want to load from your local system.
So if we make this whole thing a webcenter, we skip one step in this load/save process.

This means that you can only use this by uploading the store-builder to your server.
Which is not too much to ask i suppose.

The sad thing with all this is the absurd strictness of flash's security.
There definitly are ways around this. Either with javascript or a server side language.
But it's such an annoying hasle... not to mention problems with diverse browsers and settings.
And all i need is a path...

The decision has been made. Webcenter it will be.

I am now working on the item editor. With dragging items you can easily fill your database and design the templates for your items.
As soon as i have finished with converting the application to "web-center" status, i'll make the files available for download. Right now it directly uses my own server, without any security settings...

Flash actionscript editor, no errors, no autoformat

I had a script that had this piece of script :


function loadLink(link) // when file is defined, load path&XML
{
...

When i checked this code's syntax, flash reported no errors.
But when i wanted to Autoformat it, it did report errors.. but offcourse with no details.
Eventually found this page :

kirupaForum - Macromedia Flash 8 Bugs and Emerging Issues

which led me to this solution :

// when file is defined, load path&XML ->>>>>> comment on a seperate line
function loadLink(link)
{
...

problem solved :)

Saturday, October 01, 2005

Datagrid refresh contents

First a complaint.
What is up with all these Flash components? They appear unstable and buggy, screw up my depths (MovieClip.getNextHighestDepth()) .. i had hoped these issues would have been addressed with flash 8, but no luck.
Today i ran into this one..,
I have a dataGrid on my Stage with two columns. 1st : name & 2nd : url
Then somewhere in my app i want to dynamically change the value of one of these 2.
This line does that :

myDataGrid.getItemAt(myDataGrid.selectedIndex).url=link;

But does it? When i tried this, at first i didn't see it! But then when i rolled over the item with my mousepointer... there it was... damn.
So i thought, ok... i need a refresh thing on it.
I tried :

myDataGrid.redraw() : doesn't work
myDataGrid.invalidate() : doesn't work

unbelievable no?
now here's your solution :

myDataGrid.dataProvider=myDataGrid.dataProvider;

et voila! there it is...
pfffffffffffff what a day....

ScrollPane, scrollbar and scroll to bottom

Today i made another one of those lovely discoveries... Maybe you recognize the situation, you know you did it right, but it just won't go.
Anyway, i was playing around with the Flash ScrollPane for the store builder. I want to use it for the "item editor" :)
So dynamically creating clips in a ScrollPane.
But then you also want the scrollbar to scroll to the bottom of the page where you newly placed item is.
After a while i figured it out.

This little line makes the Pane scroll to the bottom :
MyPane.vPosition = MyPane.maxVPosition;

But....
When you have just created a new clip in it's content. The *(%$%# doesn't update it's maxVPosition yet...
So, in order to make this work you need to use a setInterval (flash mx) and in flash 8 :
setTimeout(ScrollToBottom,100);

function ScrollToBottom()
{

MyPane.vPosition = MyPane.maxVPosition;
}

nice no? those undocumented thingys?

Hope it helps someone.

Oh, MyPane.invalidate(); helps with content masking stuff...