# Need some help loading dynamic variable properly

**URL:** <https://forum.kirupa.com/t/need-some-help-loading-dynamic-variable-properly/319719>\
**Category:** flash\
**Created:** [March 2, 2011, 3:17pm UTC](https://forum.kirupa.com/t/need-some-help-loading-dynamic-variable-properly/319719 "2011-03-02T15:17:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![idias](https://avatars.discourse-cdn.com/v4/letter/i/7c8e57/32.png) [@idias](https://forum.kirupa.com/u/idias)\
**Post date:** [March 2, 2011, 3:17pm UTC](https://forum.kirupa.com/t/need-some-help-loading-dynamic-variable-properly/319719/1 "2011-03-02T15:17:43Z")

</div>

Hi guys, 1st time posting. I am having some trouble learning AS3. Here’s my case, I am trying to load an external php variable into Flash and I have no idea how to store the variable’s value properly.

In php, I have the following variables  
$chance = 3;  
$segment\_value1 = 25;  
$segment\_value2 = 25;  
$segment\_value3 = 50;

By using the URLVariables method, I know that I can load those values into Flash, but whenever I declare it dynamically, it display me the string.

var chance:Array = new Array;  
for (var i = 0;i \< URLVariables.chance;i++) {  
chance.push(“URLVariables.segment\_value”+(i+1));  
}

The result gives me chance[0]=segment\_value1. The actual value I want is to make chance[0] to be 25, chance[1] to be 25, and chance[2] = 50 but my result is still strings instead. Is there a proper way to do this? Thanks

```
	  		  		 		  		  		  		  	   	 		[IMG]http://board.flashkit.com/board/images/statusicon/user_offline.gif[/IMG] [[IMG]http://board.flashkit.com/board/images/buttons/quote.gif[/IMG]](http://board.flashkit.com/board/newreply.php?do=newreply&p=4279994)
```
