Menu:

Sponsor

Place your advertising here
casininio casino online casino online Buy and sell flash files

Forum's topics

Latest Files

Archives

Top Rated

Categories

Photo Gallery


WDDX with Flash<

1. Introduction

1.1 What is wddx?

From www.openwddx.org: "WDDX is an XML-based technology that enables the exchange of complex data between Web programming languages, creating what some refer to as 'Web syndicate networks'. WDDX consists of a language-independent representation of data based on an XML 1.0 DTD, and a set of modules for a wide variety of languages that use WDDX. WDDX can be used with HTTP, SMTP, POP, FTP and other Internet protocols that support transferring textual data".
and also: "...WDDX solves critical problems in exchanging data between different Web application environments, such as JavaScript, ColdFusion, Perl, ASP/COM and Java. With WDDX, multiple applications can easily share complex data across language environments, systems and platforms. As a result, developers can now more easily build systems that exchange information between browsers and servers or between different application servers".

1.2 What do you need.

- PHP has built-in WDDX functions. "In order to use WDDX, you will need to install the expat library (which comes with apache 1.3.7 or higher) and recompile PHP with --with-xml and --enable-wddx". (from http://www.php.net )
- Flash has not a native support for wddx, since it is not a w3c standard, but Branden Hall, of figleaf software has built some prototype functions which will allow you to work easily with wddx. You can download the necessary file wddx_mx.as from here (actually version 1.0)

At least, since i will use a mysql database to create a pratical example you also need mysql installed on your server

Note: Mybe you're asking: "Yes, but why WDDX?".
Using WDDX, your php output will be formatted in a way (is an xml output) that will allow you to parse in a easier way all your data, without spending hours on xml prsing functions and without spending time to build arrays and object from the standard text/plain output (variable=value).
In fact the wddx lib that you've downloaded will do the parsing for you... :)

2. Start Up

2.1 create the mysql table

We want to get a list of values from MySQL and pass them to Flash without using the standard variable/value method, but using the wddx php serialization.
To build this example I used a pre existent mysql table present already on my server. That is the one which generate the prototype page (on my site).
This table has this structure:

- id
- categoria
- versione
- titolo
- data
- testo
- hits
- email
- online

To create the table you can use this sql query:

CREATE TABLE prototype (
  id int(20) NOT NULL auto_increment,
  categoria varchar(255) NOT NULL default '',
  versione tinyint(3) unsigned NOT NULL default '0',
  titolo varchar(255) NOT NULL default '',
  data datetime NOT NULL default '0000-00-00 00:00:00',
  testo text NOT NULL,
  hits int(20) NOT NULL default '0',
  email varchar(255) NOT NULL default '',
  online tinyint(2) unsigned NOT NULL default '0',
  PRIMARY KEY (id),
  FULLTEXT KEY testo (testo)
  ) TYPE=MyISAM; 

2.2 The example

Now take a look at the example to view what we are going to do. click here to view