# ||= Flash Dynamic Variables =||

**URL:** <https://forum.kirupa.com/t/flash-dynamic-variables/7686>\
**Category:** flash\
**Created:** [November 5, 2002, 9:28pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686 "2002-11-05T21:28:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![telekinesis](https://avatars.discourse-cdn.com/v4/letter/t/b5ac83/32.png) [@telekinesis](https://forum.kirupa.com/u/telekinesis)\
**Post date:** [November 5, 2002, 9:28pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/1 "2002-11-05T21:28:02Z")

</div>

I am having a problem with Flash and PHP:

[list][\*]I have a PHP script searching a directory for how many images are in it and putting the value into a variable.

[\*]That variable is imported into flash and is used to make a random number from that variable.

[\*]That random number chosen loads a random image from that directory.[/list]  
So lets say there are 5 images in that directory. Flash is suppose to get a random number in between 1 and 5. The problem I am having is that the imported variable cannot be traced as an integer. Does anyone know anything about this problem?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2002, 10:36pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/2 "2002-11-05T22:36:36Z")

</div>

in flash, all imported variables are strings.

convert it with:

Number(importedVariable);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 5, 2002, 10:40pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/3 "2002-11-05T22:40:24Z")

</div>

Thanks sbeener…you helped me again, like usual 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2002, 6:35am UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/4 "2002-11-06T06:35:12Z")

</div>

Number() is a leftover method from Flash 4 and will most likely be deprecated in later versions of Flash but I am sure that is unimportant to you now.

parseInt() is from ECMA script which is the standard that Macromedia has wisely switched to. It also makes more sense to developers. ECMA script came from JavaScript/Jscript.

so i recommend in using parseInt() more.

Hope you will find this post useful!

yours,  
h88

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 6, 2002, 6:39am UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/5 "2002-11-06T06:39:33Z")

</div>

I will take this into consideration, thank you H88!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 3, 2003, 3:10pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/6 "2003-06-03T15:10:12Z")

</div>

This might seem like a dumb question to most of you… but…

Is it possible to pass variables to Flash MX file directly from the page that is called. For example, I currently have an ASP page that pulls an image from a DB and then displays the image [http://www.playmoreconsoles.com/pic.asp?ID=2396](http://www.playmoreconsoles.com/pic.asp?ID=2396)

That page works fine and will remain intact.

I want to be able to open [http://www.playmoreconsoles.com/pic2.asp?=2396](http://www.playmoreconsoles.com/pic2.asp?=2396) and have it dynamically open that image. All of the supposedly dynamic image tutorials out there rely on hard coded flash.

All I need to do is grab the image number from the ASP page itself.

PLEASE HELP

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 3, 2003, 3:21pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/7 "2003-06-03T15:21:35Z")

</div>

yeah, you would use

loadVariablesNum(“aspPage.asp”, 0, “POST”);

and just have the variable printed out someone on the page so Flash can read it and load it into itself…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 3, 2003, 3:58pm UTC](https://forum.kirupa.com/t/flash-dynamic-variables/7686/8 "2003-06-03T15:58:12Z")

</div>

Is it not possible for me to use a parameter?

I can dynamically write the parameter using ASP… but how do I read the parameters in Flash?

Example :

PARAM NAME=PicID VALUE=2396
