# Need Help With Button Actionscript

**URL:** <https://forum.kirupa.com/t/need-help-with-button-actionscript/186331>\
**Category:** flash\
**Created:** [April 20, 2006, 3:59pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331 "2006-04-20T15:59:37Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmalex](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bmalex](https://forum.kirupa.com/u/bmalex)\
**Post date:** [April 20, 2006, 3:59pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/1 "2006-04-20T15:59:37Z")

</div>

Greetings Forum,  
Can someone tell my how to configure the actionscript for my flash button to load a php page into the browser??  
The way I have it now, when the button is clicked, it opens a new window and goes to my home page ???

Here is what I have…

on (release) {  
getURL(“jobseekeroptions.php”,“post”);  
}

I know I am supposed to load some variables somewhere, but where??

Oh and yes, I am a flash 2004 mx beginner.

Can anyone tell me what I am doing wrong here??

Thanks in advance

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 20, 2006, 4:45pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/2 "2006-04-20T16:45:12Z")

</div>

[AS]on (release) {  
getURL(“jobseekeroptions.php”,"\_blank",“post”);  
}  
[/AS]:cowboy:

---

<div class="post-metadata">

**Author:** ![bmalex](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bmalex](https://forum.kirupa.com/u/bmalex)\
**Post date:** [April 20, 2006, 5:25pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/3 "2006-04-20T17:25:12Z")

</div>

To BlueNar,  
Thanks for your response. I put that script in, saved and published the swf file and it is still opening the .com website instead of loading the php page.  
Any other suggestions ???

Is there another actionscript that would perform this task???

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 20, 2006, 5:35pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/4 "2006-04-20T17:35:38Z")

</div>

you can try:

```auto
var blah:LoadVars = new LoadVars();
blah.sendAndLoad("jobseekeroptions.php",0,"POST");

```

That would work but is not really for that purpose:) Comes in handy if you want to send some post variables to the php.

---

<div class="post-metadata">

**Author:** ![bmalex](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bmalex](https://forum.kirupa.com/u/bmalex)\
**Post date:** [April 20, 2006, 6:05pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/5 "2006-04-20T18:05:31Z")

</div>

Detective  
Is this how the actionscript should be written???

on (release) {  
var $s\_email:LoadVars = new LoadVars();  
$s\_email.sendAndLoad(“jobseekeroptions.php”,0,“POST”);;  
}

---

<div class="post-metadata">

**Author:** ![JoshuaJonah](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshuajonah/32/1775_2.png) [@JoshuaJonah](https://forum.kirupa.com/u/JoshuaJonah)\
**Post date:** [April 20, 2006, 6:12pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/6 "2006-04-20T18:12:21Z")

</div>

nope… you can add a variable like this:

```auto

emailaddress = "jimbob@whatever.com";
var blah:LoadVars = new LoadVars();
blah.email = emailaddress;
blah.sendAndLoad("jobseekeroptions.php",0,"POST");

```

Then in your PHP you could refer to that variable as “$\_POST[‘email’]”. The value of $\_POST[‘email’] would be [jimbob@whatever.com](mailto:jimbob@whatever.com)🙂

---

<div class="post-metadata">

**Author:** ![bmalex](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bmalex](https://forum.kirupa.com/u/bmalex)\
**Post date:** [April 21, 2006, 3:03pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/7 "2006-04-21T15:03:42Z")

</div>

To Defective  
Again thanks for your response. I am just not getting it!!!  
I tried your suggestion and the button doesn’t even respond. I really can’t understand why when I use…

on (release) {  
getURL(“jobseekeroptions.php”,“0”,“POST”);  
}

The result is a new window with the actual .com website. What is going on??  
I am in dire need of getting this button and code to work right. There is compensation available for anyone who will give me a hand. Just email me

Again thanks

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 21, 2006, 4:47pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/8 "2006-04-21T16:47:05Z")

</div>

the 0 isn’t supposed to in quotations. I think you need to post your jobseekeroptions.php code, as that seems to be the issue for you.

---

<div class="post-metadata">

**Author:** ![bmalex](https://avatars.discourse-cdn.com/v4/letter/b/34f0e0/32.png) [@bmalex](https://forum.kirupa.com/u/bmalex)\
**Post date:** [April 21, 2006, 5:08pm UTC](https://forum.kirupa.com/t/need-help-with-button-actionscript/186331/9 "2006-04-21T17:08:37Z")

</div>

OK BlueNar,  
Here is my php code. Where do I load the varibles for my button actionscript??

\<?php  
include ("…/config/config.inc");  
//include (“booth\_visit.php”);  
// validate data  
// start session and bring in session variables  
session\_start();  
// forward to login page if the session is not valid

if(!isset($s\_email))  
{  
header(“Location: logon.htm”);  
exit();  
}  
// get booths from database

@$link = mysql\_connect(SYSTEM,USERNAME,PASSWORD);

if(!$link)  
{  
echo “Database seems to be down”;  
exit;  
}  
mysql\_select\_db(DATABASE) or die( “Unable to select database”);

$query = “SELECT \* FROM booth where email = ‘$email’”;  
$result = mysql\_query($query);

if(!$result)  
{  
echo “Error - Could not get booth information from database.”;  
mysql\_close();  
exit;  
}  
$row = mysql\_fetch\_array($result);  
$resoption = $row[‘resoption’];  
header(“location:$resoption”);  
?\>
