# Passing dynamic content to the next frame

**URL:** <https://forum.kirupa.com/t/passing-dynamic-content-to-the-next-frame/273996>\
**Category:** Uncategorized\
**Created:** [October 23, 2008, 3:29pm UTC](https://forum.kirupa.com/t/passing-dynamic-content-to-the-next-frame/273996 "2008-10-23T15:29:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![datzun](https://avatars.discourse-cdn.com/v4/letter/d/c77e96/32.png) [@datzun](https://forum.kirupa.com/u/datzun)\
**Post date:** [October 23, 2008, 3:29pm UTC](https://forum.kirupa.com/t/passing-dynamic-content-to-the-next-frame/273996/1 "2008-10-23T15:29:54Z")

</div>

Morning everyone.

I have a flash banner that I’m creating that pulls dynamic content from a database. It’s basically a URLRequest to a PHP file, the PHP file calls the database, returns the values, and brings them into Flash. Using URLVariables, I split it out and put certain values into certain textfields. Pretty basic stuff.

The problem I’m having is this banner runs over and over again (as I want it to). In doing so, it makes the call to the database on each iteration (which I don’t want to). I’m trying to find a way to store the variables I pull in and pass them on. At first I was hoping to just get to the end of the clip and do a gotoAndPlay(2) to get it to loop and not include the database call. However, doing so gives me empty fields. This made me realize that anytime I reference the data after the first frame, I get null results.

Here’s my code snippet:

```auto

var req:URLRequest = new URLRequest(theURL);
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);

loader.load(req);

function onComplete(event:Event):void{
	var vars:URLVariables = new URLVariables(event.target.data);

        price_mc.price_txt.text = vars.data1;
	cb_mc.cb_txt.text = vars.data1;
	tcb_mc.tcb_txt.text = vars.data1;

}

```

Any thoughts on how I can get the dynamic data in these text fields passed on without doing the database call each iteration?

Thanks.
