Archive for June, 2005



Variable Variables in PHP and Actionscript


h1 Thursday, June 30th, 2005

from: http://www.tutorialized.com/

I often make use of variable variables, because I generally use interpreted languages like PHP. Variable variables are not supported in compiled languages like C++ etc. The same applies for Actionscript. Because I make extensive use of variable variables in PHP, I had some difficulties solving specific problems in Actionscript. Fortunately I found a trick to solve my problem. But before I show you the sample script I will give a short introduction to variable variables in PHP.

Sample PHP script:

//my_var has a string value of “mirza”
$my_var = “mirza”;
//allocate a variable variable of the variable $my_var
$$my_var = 1;
//1st line of code now has the same meaning as $mirza = 1;

In words, with variable variables you can dynamicaly create variable names and give them values!!!

Actionscript

With eval() you can achieve similar results in AS.

//my_var has a string value of “mirza”
my_var = “mirza”;
//allocate a variable variable of the variable my_var
mirza = 1;
//has a value of 1
trace(eval(my_var));

Well, I know that this looks very strange. But I use this method in loops to dynamically create variables like pic1, pic2, pic3.

for(i = 1; i<=5; i++){
 //current variable
 curr_var = eval(pic + '' + i);
 //handle variable…pic1, pic1, etc
}

O’Reilly ActionScript: The Definitive Guide


h1 Thursday, June 30th, 2005

PHP/MySQL Membership system Tutorial


h1 Wednesday, June 29th, 2005

Scrollbar Colour Properties


h1 Wednesday, June 29th, 2005

Javascript Reference


h1 Wednesday, June 29th, 2005

Javascript enviromental vars


h1 Wednesday, June 29th, 2005

More Flash


h1 Tuesday, June 28th, 2005

Flash Bits


h1 Tuesday, June 28th, 2005

Letter sent to my MP


h1 Monday, June 27th, 2005

Setting Up a Wireless Entertainment Network


h1 Friday, June 24th, 2005

Getting round sp2 security


h1 Wednesday, June 22nd, 2005

Skype Stuff


h1 Wednesday, June 22nd, 2005

Vintage Reggae Graphics


h1 Tuesday, June 21st, 2005

PHP Tutorial


h1 Monday, June 20th, 2005

video conferencing software


h1 Monday, June 20th, 2005