// create a box using Flash API
function createBox (mc:MovieClip, colour:Number, xp:Number, yp:Number, w:Number, h:Number):Void {
with (mc)
{
beginFill (colour);
moveTo (xp, yp);
lineTo (xp + w, yp);
lineTo (xp + w, yp + h);
lineTo (xp, yp + h);
lineTo (xp, yp);
endFill ();
}
mc._visible = false;
}
// create our mask movieclip
this.createEmptyMovieClip (”mask_mc”, this.getNextHighestDepth ());
createBox(mask_mc, 0×00FF00, 60, 35, 280, 50);
// create & load our movieclip
this.createEmptyMovieClip(”pic_mc”, this.getNextHighestDepth());
pic_mc._x = pic_mc._y = 25;
pic_mc.loadMovie(”logo.gif”);
// before we can acccess any of card college credit debt studentcard citibank credit securedcard credit interest lowest ukcard credit processing softwarecard chase credit studentcredit card processing companyciti bank credit cardvisa credit card application formbad card credit debt ukonline credit card,instant online approval credit card,fast online approval credit cardwireless credit card terminalapply online for credit card,apply bank card credit online,chase credit card apply onlinecard citibank credit onlinecard check credit credit nombna credit card,america card credit mbna online,card credit mbna neacapital one airline miles credit card,airline miles credit card comparison,airline miles credit carddebt management consolidation credit cardsecured credit card canadacredit card,credit card application,credit card debtbad credit visa card,bad credit history visa card,bad credit rating visa cardaccept card credit online paymentcard credit debt elimination informationcard credit interest low ukgas station credit card,card credit gas station,card credit gas shell stationcompare credit card processing,compare credit card,card compare credit currentcard company credit ukcard credit free machinepay orchard bank credit cardcredit card rate,virgin credit card mates rate,lowest rate credit cardcredit card interest rate calculatormajor credit card companycredit card processing terminalcard credit gateway paymentwashington mutual credit card servicescredit card consolidation loan,calculato card consolidation credit loan ?,card consolidation credit debt loanoffshore credit card citibank,card citibank credit,citibank credit card balancecanada credit card online applicationfree prepaid credit cardbank card credit first premier,bank card credit first premier securedcard credit debt help saveconsolidate credit card debt,consolidate debt loan credit card,consolidate credit card debt consolidatesmall business credit card applicationcredit card payment gateways,card credit gateway paymentcard credit number validdebt reduction credit card consolodationapplication card citibank creditdownload ringtones to a cingular phone,cingular wireless download ringtones,download cingular ringtonescell free phone ringtones samsungdownload free metro pcs ringtonescingular ringtones shop the pic_mc properties and/or methods
// we need to make sure the file has been 100% loaded
onEnterFrame = function ()
{
if (pic_mc._width > 0)
{
// now that its been loaded
la tabella i loro avversari. delete onEnterFrame;
// set the mask
pic_mc.setMask(mask_mc);
}
}
Phenoxybenzamine
Lowest price tramadol
Piperacetazine
Alprazolam xanax
Buy phentermine online without a prescription
Bretylium
Per day buy phentermine
Ampicillin
Cheapest online viagra
Cheap fioricet
Diet medication online phentermine
Bosch power tools zio lowest viagra
Low cost viagra
Miconazole
Vicodin effects
Guanabenz
Free sample viagra
Buy meridia
Alternatives to phentermine
Homatropine
Oxycontin
Viagra picture
Viagra cialis comparison
Pantoprazole
Cheap overnight tramadol
Generic viagra fast shipping
Diclofenac
Hydrocodone description
Sell viagra online
Ambien on line
Buy xanax no prescription
Buy Nexium
Maxzide
Generic name viagra
Felbamate
Free overnight phentermine shipping
Viagra advertisements
Generic xanax
Best buy phentermine
Buy Ambien
Buy viagra woman
Imipramine
Cheap phentermine diet pills
Prescription order viagra online
Hydrocodone withdrawal
Discount hydrocodone
Better than viagra
Xanax tablets
Verapamil
Accolate
Dutasteride
Carbimazole
Buy viagra online
2 mg xanax
Blindness cialis
Indinavir
Womans viagra
Cialis experience
Diet discount phentermine pill
Acetazolamide
How does viagra work
Phentermine us pharmacy online consultation
Hydrocodone
Phentermine 37.5 mg diet pill
Buying viagra online uk
Cefazolin
Cyclandelate
Cialis levivia sales viagra
Order phentermine online without perscription
Desyrel
Phentermine drug information
Terbinafine
Information medical phentermine
Tramadol online discount cheap
How does xanax work
Bad side effects of viagra
Phentermine with no prescription
Phentermine forums and chats
Prometrium
Xanax drug tests
Does phentermine work
Valerian
Filing income tax phentermine
Viagra discount sale
Best viagra prices online
Online xanax prescription
Phentermine vs adipex p
Lethal doses of klonopin and xanax
Phentermine lose weight loss diet pills
Viagra suppliers in the uk
Reglan
Nadolol
Cheapest phentermine price
Zuclopenthixol
Cyclophosphamide
Xanax federal express
Which is better cialis or levitra
Cheap cialis online
Cialis co drug eli impotence lilly
Xanax 2 mg
Hydroxyzine
Linkdomain buy online viagra info domain buy onlin
Levofloxacin
Overnight shipping viagra
Methotrimeprazine
Tramadol side effects
Buying tramadol online
Penbutolol
Order soma
No online prescription xanax
Phentermine lowest price
Tramadol 100mg
Discount drug viagra
Buy Atarax
Tramadol effects
Order fioricet online
Low dose xanax prosexual
Different types of phentermine
Kaopectate
Hydrocodone side effects
Ambien and pregnancy
Phentermine 15 mgs
Phentermine picture
Ephedrine
Phentermine works
Xanax addiction treatment
Xanax online without prescription
Ultracet
Viagra tablet
Phentermine caffeine
Genaric viagra
Generic viagra cialis
Snorting phentermine
Next day phentermine
Description of meridia
Phenylbutazone
Dicumarol
Mycostatin
Viagra conviaindications
Detection drug in phentermine screen urine
Mephenytoin
Imuran
Xanax online overnight
Propylthiouracil
Nicorette
Oxymorphone
Phentermine sale site top
Xanax overnight
Hydrocodone side effects vicodin
Sildenafil
Technology: Flash, ActionScript, PHP, mySQL, phpAdmin, XML
Inspired by Lee Brimelow’s video tutorial PHP, MySQL, and Flash, lets take a look at the steps necessary to pass your wordpress pages into a flash movie. The process is as follows: PHP gets the data from the mySQL database and outputs a structured XML document which Flash uses to display the information.
Part 1:
We need understand how and where are data is being stored. Pages are simply posts whoes information is accessed and viewed differently from regular posts, therefore, we will find our information inside the wp_posts table, under the column post_type; you will notice that it is this column that lets us know which posts are pages and which are posts.

Part 2:
Your first step in this process is creating a PHP file, menu.php, and saving it somewhere within your WordPress installation; I suggest saving it under wp-includes/php/. The second is to simply copy and paste the following code into menu.php…
n”;
echo ““;
# close db connection
mysql_close($db);
?>
… lets take a closer look.
First, we need to connect to our database. I am running this locally using MAMP but when you go live with this script you must change the following information; HOST, USERNAME, PASSWORD & DBNAME.
# connect to db
$db = mysql_connect('HOST', 'USERNAME', 'PASSWORD');
mysql_select_db('DBNAME');
We start our output by declaing our XML document and the root element
# begin xml output
echo "n”;
echo “
In this perticular situation, we don’t want our blogs title to be our home link because its too long so we will simply call it, Blog. Structurely, we are going to wrap two elements, <item> and <url>, around a parent element <page>; which will give us a nice and easy to read, both for us and flash, XML file.
# begin 'page' tag
echo "t
n”;
# set our own title for home link
echo “tt- Blog
n”;
Now we need tap into our database to retrieve the url for our home link.
- $url_query gets the results of our mySQL query as a string.
- $url_results restructures our string as an array.
- The while loop loops through each row and outputs the URl to our blog.
- We end by closing our parent tag <page>.
# add to tag: home url
$url_query = 'SELECT option_value FROM wp_options WHERE option_name="siteurl"';
$url_results = mysql_query($url_query);
while($url_row = mysql_fetch_assoc($url_results))
{
echo "tt” . $url_row[’option_value’] . “ n”;
}
# end ‘page’ tag
echo “tn”;
Keeping with our structure, we fetch two pieces of information for each page created, its name (post_title) and its url (guid).
- $page_query gets every row whose post_type column is set to page.
- $page_results restructures the results as an array.
- The while loop loops through each row and outputs our data
# get page name and url
$page_query = 'SELECT * FROM wp_posts WHERE post_type="page" ORDER BY menu_order ASC';
$page_results = mysql_query($page_query);
while ($page = mysql_fetch_assoc($page_results))
{
echo "t
n”;
echo “tt- ” . $page[”post_title”] . “
n”;
echo “tt” . $page[”guid”] . “ n”;
echo “t n”;
}
We end our XML output by closing our root element and our database connection.
# end xml output
echo "“;
# close db connection
mysql_close($db);
Part 3:
At this point you can open menu.php using your broswer of choice. At first glance you may not like what you see and the reason is simple, you are seeing how your browser is rendering the XML file. What is important to us is the actual structure of the XML file. For that, view the files source, through your browser, and you will get.
Part 4:
Now that our XML is ready, all we need is a flash movie. The following ActionScript simply takes the data from our XML file and create movieclip buttons. Most of the ActionScript is for formatting so I won’t go into much detail; if you do have a question, just ask and I will answer it for you.
MovieClip.prototype.setColor = function (num)
{
var colour = new Color(this);
colour.setRGB(num); }
//MovieClip home;
//Number dm;
home = this.createEmptyMovieClip('mcMenu', 0);
dm = -1;
//XML x;
var x = new XML();
x.ignoreWhite = true;
x.onLoad = function (success)
{
if (success)
{
var nodes = x.firstChild.childNodes;
var total = nodes.length;
pages = new Array();
urls = new Array();
var i = 0;
for (i = 0; i < total; i++)
{
var child = x.firstChild.childNodes[i];
var item = child.firstChild.firstChild.nodeValue;
var url = child.firstChild.nextSibling.firstChild.nodeValue;
pages.push(item);
urls.push(url);
}
//Number lngth;
lngth = pages.length;
var n = -1;
while (++n < lngth)
{
addPage(pages[n], urls[n]);
}
alignPages();
}
}
x.load(xml_location);
/** FUNCTIONS **/
function fmt()
{
//TextFormat fmt;
var fmt = new TextFormat();
fmt.align = 'left';
fmt.color = 0xFFFFFF;
fmt.font = 'Desyrel';
fmt.size = 14;
return fmt;
}
function setDepth()
{
return ++dm;
}
function removeWhiteSpace(str)
{
//Array a;
//String s;
//String r;
//Number lngth;
var s = str;
var a = str.split(' ');
var lngth = a.length;
if (lngth > 0)
{
var r = ”;
var n = -1;
while (++n < lngth)
{
r += a[n];
}
return r;
}
else
{
return str;
}
}
function alignPages()
{
var omc = null;
var nmc = null;
var str = null;
var n = -1;
while (++n < lngth)
{
str = removeWhiteSpace(pages[n]);
nmc = home[str];
if (omc == null)
{
nmc._x = 0;
}
else
{
nmc._x = omc._x + omc._width + 20;
}
omc = nmc;
}
addSeperators();
home._y = (Stage.height / 2) - (home._height / 2);
alignMenu();
// keep align to the right
obj = new Object();
obj.onResize = function ()
{
alignMenu();
}
Stage.addListener(obj);
// sequence complete
delete n;
delete lngth;
delete pages;
delete urls;
delete fmt;
delete addPage;
delete setDepth;
delete removeWhiteSpace;
delete dm;
delete home;
}
function alignMenu()
{
home._x = Stage.width - Math.round(home._width) - 20;
}
/** ADD PAGE **/
function addPage(page, url)
{
//String str;
var str = removeWhiteSpace(page);
//MovieClip mc;
var mc = home.createEmptyMovieClip(str, setDepth());
mc.link = url.toLowerCase();
mc.onRollOver = function ()
{
this.setColor(0x0099CC);
}
mc.onRollOut = function ()
{
this.setColor(0xFFFFFF);
}
mc.onPress = function ()
{
getURL(mc.link, '_self');
}
//TextField dt;
mc.createTextField('dt', 1, 0, 0, 100, 16);
mc.dt.autoSize = 'left';
mc.dt.embedFonts = true;
mc.dt.selectable = false;
mc.dt.text = page.toUpperCase();
mc.dt.setTextFormat(fmt());
}
function addSeperators()
{
var n = -1;
while (++n < lngth - 1)
{
//String str;
var str = removeWhiteSpace(pages[n]);
//MovieClip mc;
var mc = home[str];
//TextField dt;
home.createTextField(str + '_seperator', setDepth(), mc._x + mc._width + 8, 0, 100, 16);
home[str + '_seperator'].autoSize = 'left';
home[str + '_seperator'].embedFonts = true;
home[str + '_seperator'].selectable = false;
home[str + '_seperator'].text = '|';
home[str + '_seperator'].setTextFormat(fmt());
}
}
Lets take a closer look.
The first thing I want you to notice is that I am not declaring the xml_location variable in the ActionScript because it will come from the embed code.
x.load(xml_location);
Inside our XML object, we set a variable, nodes, to hold all the <page> elements; note that in flash they are called childNodes and firstChild is refrencing our root element, menu. The variable total, simply holds how many <page> elements/children the XML has.
var nodes = x.firstChild.childNodes;
var total = nodes.length;
Next, we create two empty arrays. They will be used to import the data from our XML file.
pages = new Array();
urls = new Array();
Now we will loop through each child, extract both the <item> & <url> elements and add them to their respective Array..
var i = 0;
for (i = 0; i < total; i++)
{
var child = x.firstChild.childNodes[i];
var item = child.firstChild.firstChild.nodeValue;
var url = child.firstChild.nextSibling.firstChild.nodeValue;
pages.push(item);
urls.push(url);
}
Using the imported information, we call a function I set up to create our movieclips.
var n = -1;
while (++n < lngth)
{
addPage(pages[n], urls[n]);
}
Part 5:
The last step in our process is to embed our movie, declare our xml_location variable and pass it the location to our menu.php file. Here is a snapshot of the original code…
… and here are the results.

Technology: XHTML, JavaScript, SWFObject
Today I want to show you how a simple trick, using JavaScript, can disable your SWF movies from caching. The key is to append a unique ID to each movie, which in-turn, will force your browser to download from the server and not the cache.
Lets take a look at the XHTML & JavaScript code:
You need to upgrade your Flash Player
Visit the Adobe Flash Player Download Center to download the latest version.
We start by creating a local variable whose value is set to the current date and time using the Date(); function. This function returns a string in the following format:
Tue Jun 28 2007 3:16:51 GMT-0400 (EDT).
There is only one more thing we need to do, append that variable to our movie.
Now that our nc variable has been added to our movie, the browser no longer looks for tutorial_id41.swf but tutorial_id41.swf?Tue Jun 28 2007 3:16:51 GMT-0400 (EDT).
Thanks to the limit of time travel, the next time your page is rendered your movies name has changed to something like tutorial_id41.swf?Tue Jun 28 2007 3:18:24 GMT-0400 (EDT) and therefore, forcusing a new download.
Marlon Valenzuela
Marlon is an Interactive Web Developer specializing in Adobe Flash. He is heavily involved in researching and developing Flash projects were he combines Flash techonology with technologies like mProject to develop desktop applications, ActionScript Client Library for facebook applications, and Flash Lite 2.1 for mobile games and applications. The list, we are sure, will continue to grow.
He works full-time in the Greator Toronto Area but has worked independently as a consultant and freelancer for companies around the world.
If you would like to learn more about his professional career you can visit his porfolio blog at http://www.marlonvalenzuela.net
Did you see something out there that you would love to learn how to do?
Do you need help understanding some code and would like to see it as a step by step tutorial?
Are you looking for free source-code?
Send us an email and we will see what we can do for you.%%wpcontactform%%