Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Request "qwery String" variable ..?

Posted on 2003-12-08
9
Medium Priority
?
201 Views
Last Modified: 2010-04-03
Hi

Im a complete novice with flash and actionscripts etc ... i do have a background in ASP,VB etc though ...

In Flash MX how do I request a value pass via a URL eg:

www.mydomain.com/page1.asp?ref=1123

So pass ref into my swf file ??

Also How do i create a totally unique name in flash to use as a file name??
I good way iv found of doin this is asp is to count the files in a dir and add one to this number then use it for my file name ... is this poss is flash ???

Thanks

SILKI

0
Comment
Question by:silki
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 9

Expert Comment

by:OBCT
ID: 9896871
You can load your variable using either of these two functions:

loadVariables("www.mydomain.com/page1.asp?ref=1123", 0, "GET");
or
loadVariablesNum("www.mydomain.com/page1.asp?ref=1123", 0, "GET");

For more information on these, have a look here:
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary425.html
and
http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary426.html

Cheers

-OBCT
0
 

Author Comment

by:silki
ID: 9919125
OBCT,

Thanks for the feedback, sorry im a complete novice with flash so:

I added this into teh actionscrupt windows for the first scene but it returns "undefined"  into the textbox

*****************************************************
var karl = "";
var karl = loadVariables("127.0.0.1/page1.asp?ref=1123", 0, "GET");

textbox.text = karl

*****************************************************
0
 
LVL 9

Expert Comment

by:OBCT
ID: 9919225
I don't know any asp but if possible use whatever function you can to print out the ref variable on your page. In php you could use:
echo "ref=" + $yourvariable;
print "ref=" + $yourvariable;

Once you have that working, give the dynamic text box the var name of "ref"
loadVariables("127.0.0.1/page1.asp?ref=1123", 0, "GET");
That is all the code you really need for this. If that doesn't work then we'll try something else.

Cheers

-OBCT
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:silki
ID: 9941527
Hi

sorry about the delay in my replys ... Iv got a actionscrupt on my first frame like this:

****************************************
loadVariables("127.0.0.1/page1.asp?ref=1123", 0, "GET");
****************************************

and i have a textbox called ref

now if i save the file and publish it then rename the html page created to page1.asp and follow the link there is no value in the textbox in the swf ?????

Thanks for all your help ..


0
 
LVL 9

Expert Comment

by:OBCT
ID: 9941826
Can I ask why you want to have the ref number in a text box from a query.
If your going to use the same query string everytime you use the program then your best off just printing the variable out on your asp page then using a LoadVars function to get that number into the textbox
0
 

Author Comment

by:silki
ID: 9948257
HI,

 I need to knoe how to pass a value from the qwery string into my flash file ... Im trying to create a video Emailer ... i have created a player that needs a file name to play and i want to pass different varibles ie different videos to play ...

So where am i goin wrong ??
0
 
LVL 9

Accepted Solution

by:
OBCT earned 1000 total points
ID: 9948300
This is a load vars function. At the moment in a current work project I have used it at least 40 times. I bow down to this function hehe.
What it does is load up any variables you set from your asp page.
If you want to load up a specific variable (which i assume you do) you would use this code:

myLoad = new LoadVars();
myLoad.variable = variable;
myLoad.onLoad = function(success)
{
     if (success)
     {
          //Add code here
     }
     else
     {
           //Add error message here
     }
};
myLoad.load("127.0.0.1/page1.asp?ref=1123", myLoad, "GET");

If you have any trouble using this function the first place I suggest you look is in the Actionscript dictionary. If your still having trouble just give me a yell.
I appologize for not being much help, I'm not very good at explaining things.

Cheers

-OBCT
0
 

Author Comment

by:silki
ID: 9948841
Great,

I wont be able to try this right away so ill give you the points and check out the Actionscript dictionary ... if there is any questions just littl eones i post it here if thats ok ...

Thanks again for your time

SILKI
0
 
LVL 9

Expert Comment

by:OBCT
ID: 9948855
Yep thats fine with me.

Cheers!

-OBCT
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

636 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