Friday, September 30, 2005

Store/Site builder update v2

Another little update... mostly to get my thoughts straight on some issues and ideas. Constructive input is always welcome!
I ran into some problems with flash security concerning loading and saving files on a local system. This can cause some serious usability issues, but i am trying to find ways around it with php or maybe a concept change.
Let me explain concept change.
It's about how to perceive this application. Is it a standalone application that you run and use as any other program on your computer, or is it a "web-center" where you can handle the items/files/products on your site?
If the latter is preferred, the concept doesn't violate flashes security restrictions.
In any case support from a server side language is needed. My personal preference is PHP.
I am tending to go towards a "web-center" idea. Would be cool to see this grow from an easy xml editor to a complex webcenter where you can handle all things concerning your site. Be it a personal one or a small to medium size e-store...

Another issue i am now exploring, is deep-linking. If you think about it, a site consists of pages of information (say your product page), held together by a maze of links. So in it's basic form this means you should make the pages for your items and then create your site with links in such a way the item pages can be reached as easily as possible.
But these links can be part of the pages your are linking to. So it's a dynamic thing which you should be able to control with this application.
And with still keeping the flash option open, i am trying to keep enough flexibility...

The last thing i want to mention it, is the name of the whole thing. I mean how creative is "Store builder"? :)
So this is still an open issue. Maybe something like "Drag&Shop" ... if you have a better idea.. lemme know!

Tuesday, September 27, 2005

Ray Kurzweil's new book is out!

I was really waiting for this one...The Singularity Is Near : When Humans Transcend Biology
If you've read his other book : The Age of Spiritual Machines: When Computers Exceed Human Intelligence you will probably be as excited as i am!
Once you really get into the topic, your view on your future will be completely different...
Kurzweil writes in a loose manner while maintaining clarity on some very insightfull topics.
I really recommend these books! In 5 years you had definitly wished you read this :)

To conclude... i am always interested to start a discussion on this topic in particular, so if you're tempted, leave a comment or send me an email.

Store/Site builder update

I felt like talking a little about the progress i've made with the Store-builder so far.
I'm drilling down into the neccesary datastructure until i at least reach the phase where i can add items for my Flash-trial site. Since my output from the Store-builder is xml and i use xml for the content of my flash pages... once i get that far with this application, i won't have to make xml with notepad anymore :)
So at least we'll have a nice simple XML-editor.
Here is another shot to give you an idea.

Now you can load and save files, and make the primary structure for the site, with a cool drag and drop thing. Maybe you've heard of "the brain"?
(http://www.thebrain.com/products/personalbrain/default.html)
A little bit like that :)

Anyway, this blog hasn't been indexed yet, so i'll have to wait for reactions :)
When that happens i'll make this available...

Flash Datagrid double sort order

As you probably know, there are many examples in the Flash documentation, but sometimes you just want a little more.
Take the datagrid.
There is a nice example in the documentation to fill a datagrid with two colums. In this example you can click the headers to sort. But the sorting only goes one way (ascending). But in most cases you'd want a 2 way sorting.
This is the same example code, modified, so it works both ways :)


myDataGrid.addColumn("name");
myDataGrid.addColumn("score");
var myDP_array:Array = new Array({name:"Clark", score:3135}, {name:"Bruce", score:403}, {name:"Peter", score:25});
myDataGrid.dataProvider = myDP_array;
// Create listener object for DataGrid.
var listener_obj:Object = new Object();
listener_obj.headerRelease = function(evt_obj:Object)
{
if (evt_obj.target.columns[evt_obj.columnIndex].columnName == old_column)
{
old_column = null;
switch (evt_obj.target.columns[evt_obj.columnIndex].columnName)
{
case "name" :
myDP_array.sortOn("name", Array.CASEINSENSITIVE | Array.DESCENDING);
break;
case "score" :
myDP_array.sortOn("score", Array.NUMERIC | Array.DESCENDING);
break;
}

}
else
{
old_column = evt_obj.target.columns[evt_obj.columnIndex].columnName;
switch (evt_obj.target.columns[evt_obj.columnIndex].columnName)
{
case "name" :
myDP_array.sortOn("name", Array.CASEINSENSITIVE);
break;
case "score" :
myDP_array.sortOn("score", Array.NUMERIC);
break;
}

}
};
// Add listener to DataGrid.
myDataGrid.addEventListener("headerRelease", listener_obj);


You need a dataGrid in your Scene called "myDataGrid", for this to work...

Sunday, September 25, 2005

Flash XML Compressor

This is sooo cool !
In some cases your xml-files might get a little big... and in any case, small filesizes=good
This applies for xml files, but basically for any kind of data transfer in flash.
Here : http://www.strille.net/tutorials/FlashXMLCompressor/index.php you'll find detailed information on how to handle this in PHP and flash.
If you need help sorting it out for your particular needs, drop me a line...

Store/Site builder


I have started working in my spare time on a little idea i have.
Or actually it's a lot of little ideas combined.
I am doing many experiments concerning Rich Internet Applications with Flash and PHP.
And as i mentioned in a previous post, i like simplicity.
So, i am putting it all together in a simple site/store builder.
Simple, yet powerfull and flexible.
With it you'll be able to :
  • Create the "structure" of your store.
  • Manage all the different items on your site, including your products
  • Generate code, which is easily installable (copy, paste -> it works) on any server running PHP.
  • Include a shopping cart.
  • Include Paypal options
  • Use your own templates.
  • ... Whatever else comes along

O! And it will be free...

The first idea is that this builder produces html/xml-pages.
So no flash.
The moment i type this i realize this needs some more explaining :)

In my opinion the largest issue with full-Flash sites (especially commercial ones), is that by definition you have a dynamic site, with content that can't be properly indexed by search engines.
Your flash movie can be somewhat indexed, and the new Flash 8 meta-tags help even more, but it's still not complete. All that product information that is loaded dynamically into Flash, is unreachable for Google or Yahoo or MSN Search... it only exists for the Flash movie.
And so you lose all the keywords and pages of information as means to more visitors...
Clear? :)
Ok, i know there are ways around this, with creating seperate html-pages with a redirect...
Who knows, maybe i'll do both :)

I've added a screenshot of the project as it is now. Once it gets a little interesting to use, i'll post a page...

Thursday, September 22, 2005

Save data to file with PHP

In order to save data from flash to a file on the users system, via a "save as" dialog, i made this little php script.
Most examples i found didn't work, or required a file on a server to download.
I wanted to be able to post a string to my php script and then raise the save as dialog box.
here's the code :

<?php
$myString = "Hello i am a string";
$content_len = count($myString);
$output_file = 'something.txt';
header("Content-Disposition: attachment; filename=" . $output_file);
header("Content-Type: text/html");
header('Content-Length: ' . $content_len);
echo $myString;
exit();
?>

I only tested this with IE6.0+

With Flash 8 there is another way to do this, probably more solid but a bit harder to implement.

Steps :

  1. Create a string in flash with whatever (xml?)
  2. Use LoadVars to send this string to a php script
  3. php script makes a temporary file on the server
  4. In Flash use : FileReference.download to download the temporary file from the server.

Example PHP code (sub3):

<?php
$storage = 'tmpUploads';
$uploadfile = "$storage/".$filename;//$filename is given by Flash LoadVars
$handle = fopen($uploadfile, 'w+');
fwrite($handle, $myxml);//$myxml is given by Flash LoadVars
fclose($handle);
echo ("done=1"); //Let flash know we have made the tmp-file
?>

complexity

I like to reuse things. Instead of reinventing the wheel, it's great to find similar code to what you need, change it to your liking and in such a way, have results quickly. I guess that is what the whole concept of object-oriented programming is all about.
But what i don't like is the 'overcomplexity' i encounter in this field.
Sometimes i have to really dig deep in a topic, only to discover that it's not as complicated as it seemed. Take XML. It took me a while to understand really it's simplicity... at least as it can be.
I know it's not just me. In my direct environment i hear a lot of signals indicating this.
So i have decided to continu to seek simplicity in my projects. Not only for my own benefit, but also for everyone like me who is trying to grow.
If you think about it, how complex really is a website? What is the subset of knowledge you need to build an average size site?

Tuesday, September 20, 2005

my Blog to Flash

Today i have been playing around with flash and php to get the feed from this blog into flash.->(atom feed)
After some intense searching for info and code about the atom feed, i now have a working version.
You can see it in action here : asjiLab (GoTo the Blog tab on the menu :: requires flash 8)
Page is work in progress... you could say my collection of flash 8 trials so far.

If someone wants more info, let me know and i will clean up the code or even make a tutorial out of this :)

Sunday, September 18, 2005

Transformation Matrix tutorial



I found this excellent tutorial.

"Understanding the Transformation Matrix in Flash 8"
http://www.senocular.com/flash/tutorials/transformmatrix/

There is really nothing else to add to this great piece!
I am amazed to the amount of information already available about flash 8! And of such high quality!
Good times people :)

Thursday, September 15, 2005

The beginning

Finally decided to start my own Flash blog. I guess now with 'the coming' of Flash 8, things started to itch again, and i see great things happening...
Flash has reached maturity, people are used to it, and bandwidth is growing exponentially.

So if you're interested in RIA's (Rich Internet Applications) and perhaps also some other thoughts of mine that come along, come around every now and then.
See you around!

asji