# Grabbing javascript variables and using in as3

**URL:** https://forum.kirupa.com/t/grabbing-javascript-variables-and-using-in-as3/273862
**Category:** Uncategorized
**Created:** [October 21, 2008, 8:33pm UTC](https://forum.kirupa.com/t/grabbing-javascript-variables-and-using-in-as3/273862 "2008-10-21T20:33:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![maximillion511](https://avatars.discourse-cdn.com/v4/letter/m/0ea827/32.png) [@maximillion511](https://forum.kirupa.com/u/maximillion511)
#### Post date: [October 21, 2008, 8:33pm UTC](https://forum.kirupa.com/t/grabbing-javascript-variables-and-using-in-as3/273862/1 "2008-10-21T20:33:30Z")

</div>

hey guys,

i have a project that i am experimenting with and i have no idea where to begin…  
on one of the pages in a shopping cart is a variable for the item being displayed (item\_id?12345).

what i am trying to do is grab this variable from the page and load it into my swf.  
once that is done, i am trying to go to my database and grab the image associated with that item\_id and display it in my flash app.

here is what i am thinking. if i am on the right track or not please let me know.  
the var (item\_id) is on a page where there will be a link to my swf. would i have to pass the (item\_id) over with the link for the flash app or can i grab it directly from the view cart page?

also i know that javascript and flash cannot directly talk to a data base so there would have to be a php page that would handle the server side stuff and pass that information back to the flash app? taking into consideration i know nothing about php, i wouldnt know how to get that data back to the flash app.

I know in the php there would have to be some mySQL query to get the data but how do you send it back once it’s retrieved?

if there is anything I am missing, please let me kno…
