# Dynamic text from DB?

**URL:** <https://forum.kirupa.com/t/dynamic-text-from-db/18537>\
**Category:** Uncategorized\
**Created:** [April 17, 2003, 6:32pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537 "2003-04-17T18:32:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Uli](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@Uli](https://forum.kirupa.com/u/Uli)\
**Post date:** [April 17, 2003, 6:32pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/1 "2003-04-17T18:32:31Z")

</div>

Hi there,  
i was wondering if there’s a way to connect to a DB like AXS or SQL to display within flashMX some dynamic text that would be in the DB.  
Anyone know if it’s possible?

---

<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:** [April 17, 2003, 7:04pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/2 "2003-04-17T19:04:20Z")

</div>

Yeah, It’s not too hard. You’ll have to use some kind of server-side scripting to obtain the stuff from the database… like PHP, or ASP, etc. Since I need some practice, I’ll post how to do it.

Stefan

---

<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:** [April 17, 2003, 7:06pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/3 "2003-04-17T19:06:10Z")

</div>

First, make a PHP or ASP, or some type of file that outputs info from your database in the method:

field=field contents&field2=field contents2

Second, you’ll have to code your AS to retrieve the new variables from your PHP or ASP file.  
[AS] //create the new object to hold your variables, I’ll call it dyntext  
var dyntext = new loadVars();  
//next load the variables from the PHP or ASP, etc, file to your new object  
dyntext.load(“[http://mydomain.com/myphpfile.php](http://mydomain.com/myphpfile.php)”);  
//then, once it’s loaded, we’ll assign a text box with the value from field2 gotten from the PHP file  
dyntext.onLoad = function() {  
mytextbox.text = dyntext.field2;  
}  
[/AS]

And that’s it… It can be much more complicated than that, but that’s kinda like the basics. Of course you can load variables from any type of file, as long as it’s in the “&field=field contents&field2=field contents2” from.

Hope that helped

Stefan

---

<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:** [April 17, 2003, 7:14pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/4 "2003-04-17T19:14:38Z")

</div>

Thanks a lot for your quick reply, that really helped 🙂

---

<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:** [April 17, 2003, 7:28pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/5 "2003-04-17T19:28:08Z")

</div>

no problem! I’m new here, but this forum is really helpful, so I might as well be helpful back, right? 🙂  
-Stefan

---

<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:** [April 18, 2003, 6:01pm UTC](https://forum.kirupa.com/t/dynamic-text-from-db/18537/6 "2003-04-18T18:01:14Z")

</div>

welcome then! 😉
