Solved

Parameters in flash

Posted on 2003-11-01
7
267 Views
Last Modified: 2010-04-03
I have flash-button that on click navigates to some url. But I want to pass a parameter (like user id, for example) to the url. How can I do it?
0
Comment
Question by:jalonsoa
7 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 250 total points
ID: 9663165
getURL("page.asp?userID=" + variable, "_self");

for example..
0
 

Expert Comment

by:zakaz
ID: 9760250
getURL("PAGE.ASP", "_self", "GET");
0
 

Expert Comment

by:zakaz
ID: 9760265
So if you pass a var:

var ID="ID22";

the url would be .... http://www.yoursite.com/PAGE.asp?ID=ID22

hope this helps
0
 
LVL 1

Expert Comment

by:Rohitmr
ID: 9833735
With the      getURL("page.asp", "_self", "GET")

All the form fields in the browser get sent. Be careful not to send unwanted data along with the userid. GET is also important as some browsers do not send data via the POST property properly. Flash plugin goof up.

If you have multiple variables in the form use

getURL("page.asp?" add variablename, "_self");
0
 
LVL 5

Assisted Solution

by:abdulqabiz
abdulqabiz earned 250 total points
ID: 11030185
Hi,

getURL(..) is ofcourse is mostly used method. But Flash MX has easier to do with LoadVars. We have control over the way we send data. We can choose which varaibles to send or not...


<code>

form_lv = new LoadVars();

//variables and their values to be sent to server
form_lv.variable1 = "somevalue";
form_lv.variable2 = "somevalue2";

//Use GET if you want to send it as query string..  
form_lv.send("http://your-site/script.asp", "_self", "POST");  
</code>

more help on this can be found at http://livedocs.macromedia.com/flash/mx2004/main/12_as301.htm#236883


Hope it helps,

Regards,
Abdul

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question