Holy flashy codeless uploaders, Batman!

June 14, 2007 at 4:08 am (Megalomania)

Yeah, the title of the post was catchier in the spanish version… creativity shortage is on the weather forecast.

This is a special preview release of a small portion of something I’m working on. What’s included in this is something a fellow student needed, an uploader tool with progress bar without having to code any of it, and having total control over the design. They are a few classes in ActionScript 2.0 which, when used properly, can turn any movieclip into an uploader component, and still be able to modify the design afterwards without having to edit external skin or themes files.

They work a little different than usual Flash components, but this is done so that the designer still retains the ability to change the design at whim. The zip file containing the required .as files and an example .fla can be downloaded here:

http://www.martinalterisio.com.ar/imf/imf-uploader.zip

Shortly I’ll post a video in youtube, or similar, a video showing step by step how to make a movieclip that acts like uploader with a progress bar. Well, a video wasn’t the most adequate media after all, so here there is a slide presentation with as much steps required to setup an upload with just a bar representing how much of the file has been uploaded:

A little extract from code documentation on how to use the component:

How to use

If you want to show a progress bar, you have to include a movieclip which _xscale is 100 at completion. This movieclip has to be named `progressbar_mc`.

If you want a button which loads the system browser for selecting the uploaded file, include either a button or movieclip named `browse_bt`.

Also, you may call browse() on this component to activate the uploaded file selection.

If you want a button for canceling the upload, include a button or movieclip named `cancel_bt`.

Also, you may call cancel() to cancel the upload.

If you want to show a text with information on the upload, include a textfield named `progress_field`

The information on this textfield can be customized changing the property `formatProgress`.

If you want to change appearance during upload, have a frame label named `uploading` and another `normal` for each state of the component.

Component Properties

url: where to upload the file

description: text used to describe which files to browse

extension: the extension(s) of files to look for separate with semicolons (;)

formatProgress: a format for how information is shown in `progress_field` (see below)

Special strings used in `formatProgress`

{bytesLoaded} – replaced with the bytes uploaded

{bytesTotal} - replaced with the total bytes of the file.

{kbytesLoaded} – replaced with the kilobytes uploaded.

{kbytesTotal} – replaced with the total kilobytes of the file.

{name} – replaced with the name of the file.

Events

error: any error that may have happened and made the upload fail. Check the `message` property of the event, using arguments[0].message if inside an on() handler.

cancel: user cancelled the upload either by canceling the browse, before the upload even started, or pressed the cancel button, or the cancel function was called, during upload.

start: the user accepted the upload.

complete: the upload finished.

Permalink Leave a Comment

Mea Culpa

June 14, 2007 at 3:13 am (Voyage Journal)

I forgot to translate 3 posts from the spanish version. Even if this is not a good excuse as I want it to be, I haven’t had any time at all (yes! you damn teachers, I blame you!). Anyway, there was an article about another article on EA success on videogame marketing, another short one that refers to an article on using failure as part of the game design rather than a terminal condition from which the player cannot continue, and one that I would really like to translate, which was about videogames as a form of art, a recurring subject, in which my opinion really matters nothing at all, but nothing stops me from saying it anyway (unless tomorrow they decide that freedom of speech should be completely banned).

These are the 3 posts in their spanish version:

http://mundogris.wordpress.com/2007/04/22/electronics-arts-una-empresa-construida-gracias-a-la-buena-experiencia-de-promocionar-videojuegos/

http://mundogris.wordpress.com/2007/04/22/la-vida-te-da-revancha-los-videojuegos-tambien-deberian-darte-revancha/

http://mundogris.wordpress.com/2007/04/22/la-cruzada-por-el-octavo-arte/

Permalink Leave a Comment