Bensmeets.com

Rich Internet, Interaction design and User Experience

Archive for August, 2004

Your own ultimate library setup?

  • Filed under: RIA
Tuesday
Aug 31,2004

I am busy creating a blank project for future use in all of my projects (and available through here for download). I wonder what kind of library folders people are using in their projects. Any ideas about how to choose the lib dirs in such a way that they are useable and convenient in almost every project type? I am trying to create a jsfl file which will do the standard creating for me. Curious about your thoughts.

The list i have so far for my default index.fla is as follows:

- _Animations
- _Buttons
- _Sounds
- _Graphic elements
- _Bitmaps

Runtime configuring your flash app

  • Filed under: RIA
Monday
Aug 30,2004

Developing flash is not only drawing nifty graphics and creating killer scripts (although it is a lot of fun). It’s also about delivering your end result and making sure it fits in the overall developing cycle.

One of the problems that arise when creating apps, is the need to be able to configure your app realtime, without the need to recompile the movie each time you want to eg. alter a destionation url.

I am constantly trying to find the perfect way to develop in such a way that this is possible. My latest solution, making use of a ConfigurationManager Class (CConfig).

update, 4 September 2005
Wow, the guys at communitymx found this an interesting topic i guess.

The main idea behind the CConfig class, is that it loads a XML file containing configuration data when the movie starts. During the running of the movie, the data should be globally available, whenever you find it usefull.

The first thing i do when building a CConfig rich (wow) app, is create a standard XML file eg. ‘_config.xml’. This XML contains one or more key/value pairs, where the keys are for identifying and the values are for…. well defining the value for the current key :).

Take a look at this example config.xml file:

<config site="MyConfigFlash">
	<var key="loadUrl" assign="http://www.myurl.com/" />
	<var key="authorEmail" assign="me@me.com" />
</config>

This tiny little piece of data, becomes useable through CConfig. What we do in our flashMovie,is create a new Manager:

import nl.flashZone.CConfig
var gConfig = new nl.flashZone.CConfig("http://www.myurl.com/_config.xml");

Now here comes the funny thing. What CConfig does, is load the given xml file in the constructor, parse it, and makes the data easy to acces. In my personal version, it pauses the root until the xml data is loaded. This should be smarter, since the movie would fail completely if no xml could be loaded, but for this example it’s enough.

The Config class loads all data and stores their values in an internal Array collection.

For example, if i want to add a button on my stage and give it an url which i do not know while building the app, I could give it a dynamic url by providing the CConfig value of the key ‘loadUrl’ to the on release action of the button.

Data inside the ConfigManager is accessed through two public methods of this class:
- getValue(string key)
- getIntValue(string key)
Where getIntValue is identical as getValue, only making sure you get a number back instead of a string.

Using this in my example, the onrelease action of my button could look like this:

on(release) {
    getUrl(gConfig.getValue("loadUrl"));
}

What CConfig does when this mouse is pressed, is loop throug it’s internal data until it finds the key ‘loadUrl’ and return the ‘value’ part of the pair.

The huge advantage of this way of loading variables is that every time a user accesses the swf file, new configuration data is loaded. You could even let an ASP/PHP script generate the xml config file for you. That way you could even store your config in a database.

The classes used in this example are available in the new Fzone_classes.zip together with a new an improved version of the LogManager.

Try to find out how it works by looking at the code, any questions/feedback are more then welcome.

Flash in a QuestForTheRest

  • Filed under: RIA
Wednesday
Aug 18,2004

The guys at Ultrashock , pointed me in the direction of Questfortherest.com . A great (and high quality) flash based internet game.

Great use of magnificant graphics and widgets make this game fun to play. Keep trying after you see the first page though, it’s not clear what you are supposed to do in a second, so keep trying :)