Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Pass Variables Into Flash Via Query String



I used to do this all the time to pass in simple values to Flash but with Flash 8 it doesn't seem to be working properly. I've stripped it down to it's most basic and it still doesn't seem to be working. I've got a test page here:
http://icglink.com/flashtest/

The top set uses the standard object/embed method, the left one passing in a 0, the right passing in a 1. Both use the variable named previousvisitor.

The bottom set use the same variable and value structure, but with the swfobject javascript call instead of the object/embed method.

I've got a case statement on the 5th frame that tests the incoming variable and directs the playhead to one frame label or another. The idea is that if someone has come to the site for the first time, they'll get to see a video. If not, they'll get a still frame with a "play video" button.

I'm also including a link to the FLA (version 8 remember).

http://icglink.com/flashtest/cookieTEST.fla

So does anyone have ANY idea why this isn't working correctly? I really need to get this working and it should be dead simple.



SitePoint > Design Your Site > Flash and Actionscript
Posted on: Aug 30, 2006, 08:59


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Dynamic Query String & Pass Variables To And Fro Php
Hi!

I have a webpage that needs to load a variable from query string and then the swf sends this variable to php to search it in databse and return respective entries.

My trouble is the page where the swf is placed in an HTML page whose URL is something like this : http://www.mysite.com/variableName=dynamicValue

Actually this is a link thats sent in an email. When clicked it loads this page. Here http://www.mysite.com/variableName= is static, but dynamicValue is a 15 letter randomly generated code.

I wanted to know is it possible to pass this dynamic value of the variable into my swf. If so, how to do that.

My second query is I wanted to send this variable from flash to a php file which will search it in a database and return related entries to flash. Now, I've done this seperately, that is, send variables to php by post method and get variables from php by get method. But I dont know how to do these two operations in one single call.

I am using Flash 8, though i'm exporting the movie to flash 6 player compatible and actionscript 2. Any help is welcome. Please let me have the feedback.

thanks

ashwin.

Pass Variable Via Query String
i'll try to explain this the best I can.

I have a flash header that I need included in a shopping cart site that will have nav and the header descriptions for each site page. It has 2 navigations, top and side. Side nav only controls the flash itself to display stuff that won't be in the rest of the site, like an about us section. The top nav controls what page the shopping cart goes to AND the flash header display. For example, when I click on my top nav button 'systems' I need it to go the 'systems page' and change the flash header to display info about the systems. Now when the 'system' button is clicked the page changes to the 'systems' page but since its a header the flash just pops up on the new page reloaded to its original state. So how would I fix this? could flash pass a variable via the query string to determine what frame it should be on when going to a new page?

Can You Still Pass Vars Through A Query String?
I'm trying to pass variables in through a query string appended to my url like so,

http://www.mydomain.com?myVar1=value1&myVar2=value2

From what i've read am i correct in thinking that i should be able to access these properties through 'this.loaderinfo.parameters'?

I don't seem to be able to get this to work for some reason? I'm able to get it tworking when passing in Flashvars through my html and then accessing them through the loaderinfo.parameters object, but not through a query string? Anyone got any ideas? Should this be possible?

Also i was wondering it there's any foreseeable issue passing in values both through Flashvars and a query string or should the loaderinfo.parameters object be populated with all the values?

cheers.

Loading Variables Into Flash From A Query String....
Is it possible?

Basicaly im making an e-Card type thing. so far, what happens is a person is emailed telling them theyve got a card and to click a link. this link contains ?id=4723473218947312 where the id number is a big random one, that corrrresponds to an id number in a txt file, which contains the message to be shown. I need to tell flash what id number to look up, from that link in the email, if you see what im getting at... how can i pass this data into flash?

Calling Variables From Query String Into Flash
Hi, any help given is much appreciated

Ive got multiple html pages with the same flash file embedded, with a different query string on the end for each page

eg.
home.html, myflash.swf?flashid=home
contact.html, myflash.swf?flashid=contact
support.html, myflash.swf?flashid=support

I want my flash to listen to the query string upon loading the page, and depending on the flashid, gotoAndPlay(frame)

Ive tried numerous methods to get it to work, but its just not reading my query string...

Any thoughts?
thanks!

Passing Variables From HTML To Flash Using Query String
Am using query strings in HTML to pass variables to my flash movie so I can use the same movie but different title on each page. See www.gogojuicebars.com

Works fine when I test locally, but when uploaded the movie seems to display only the first "welcome" title on each page until you have clicked all of them. Then it works correctly???? Is almost like the flash movie is loading before the varaibles can be passed, but how can this be??

Any ideas on how to fix this?

Load Query String Variables Into Flash Movie
I am trying to load a variable from an HTML query string into my flash movie to load the appropriate movieclip. However, everything I've tried to do is not working... I must be doing something wrong.

My query string in the HTML file looks like this:
<param name="movie" value="components/flash/Navi.swf?navi=home" />
<embed src="components/flash/Navi.swf?navi=home"></embed>

Now, I placed a dynamic text field (temporarily) to make sure my variable was loading- which it does; I just can't seem to use the variable the way I want to.

My goal is for the variable 'navi' holding the data 'home' to control a movieclip in my movie. So if it was "Navi.swf?navi=about" then the movieclip would goto the "About Us" section of the movie.

I tried using this Actionscript:
if(navi == home){
_root.movieclipMC.gotoAndPlay("home");
}
}

if(navi == about){
_root.movieclipMC.gotoAndPlay("about");
}
}

if(navi == home){
_root.movieclipMC.gotoAndPlay("contact");
}
}

What am I doing wrong? Thanks!

Load Query String Variables Into Flash Movie
I am trying to load a variable from an HTML query string into my flash movie to load the appropriate movieclip. However, everything I've tried to do is not working... I must be doing something wrong.

My query string in the HTML file looks like this:
<param name="movie" value="components/flash/Navi.swf?navi=home" />
<embed src="components/flash/Navi.swf?navi=home"></embed>

Now, I placed a dynamic text field (temporarily) to make sure my variable was loading- which it does; I just can't seem to use the variable the way I want to.

My goal is for the variable 'navi' holding the data 'home' to control a movieclip in my movie. So if it was "Navi.swf?navi=about" then the movieclip would goto the "About Us" section of the movie.

I tried using this Actionscript:
if(navi == home){
_root.movieclipMC.gotoAndPlay("home");
}
}

if(navi == about){
_root.movieclipMC.gotoAndPlay("about");
}
}

if(navi == home){
_root.movieclipMC.gotoAndPlay("contact");
}
}

What am I doing wrong? If anyone is able to IM I would appreciate the help... my AIM is barabics. Thanks!

Pass Frame Variable Via Query String Bettween 2 Swf In 2 Different Html Files
Hello, I have an swf movie embedded in an HTML. One of the links calls to another HTML with a different SWF embedded. I need to link back to the original HTML/SWF but to a certain frame within that SWF using HTTP query. I understand that I can do this with Javascript and by parsing the HTTP query. Can anyone direct me to a tutorial or give me some help?

Thank you

maknenoiz

Query String Variables
I know I've done this before, but I can't find the file that had it.

I'm trying to simply load a variable from the URL into flash as a variable.

eg.
"http://www.mywebsite.com/index.html?page=home"
Would send Flash a variable "page" with value "home"

I remember only having to change the embed code to get this to work.

I've seen countless examples of this, but where the variable is in the source code of the page, which is not what I need. The variable must be dynamic, and therefore in the URL.

Reading Variables From The Query String?
Does anyone know how to write the code to get a Dynamic Text Box to display variables that have been passed through the query string?

Pulling Variables From The Query String
Does any one know how I would go about pulling variables from the query string (URL) and post them in a dynamic text box? My overall goal is to have an animated Flash 5 card that will display the name of the person who sent the card and the name of the person recieving the card.

Thanks

Pulling Variables From A Query String?
alright I've fidgured some things out and this is what I am currently doing.

I am attempting to load variables placed into the query sting (url) into a dynamic text field with the same variable name. Currently it is effecting the variable but it is not putting the values into the text field
Here is my code:

loadVariablesNum ("void", 0, "POST");
to = "0";
from = "0";

I have attempted sending the variables using "GET" as well as "Don't send" with the same results

the page is
http://www.familyties.com/dogDaystes...=josh&from=bob

If you remove the "to" and "from" on the query string the default value of "0" appears in each variable

What am I doing wrong?

[CS3] Passing Variables From Query String
Hi there,

i'm trying to pass a variable from a web page to a flash file. The flash file has a dynamic text box with the var value set to formError.

In the webpage i have the following code:

<script type="text/javascript">
var so = new SWFObject("flash/index_030308.swf?t=150", "mymovie", "938", "305", "8", "#FFFFFF");
so.addParam("allowScriptAccess", "sameDomain");
so.addParam("quality", "high");
so.addVariable("formError", "<%=request.QueryString("formError")%>");
</script>

to test i am typing in the address bar default.asp?formError=woteva, hoping to see "woteva" displayed in my dynamic text box in the flash file, but this isn't the case. Where am i going wrong?

Getting Variables From The Query String, SWFObject
I need to pass my swf a value through the query string. I can't seem to figure this out with AS3.

More specifically I need to pass a value from the HTML that embeds the swf to the movie.

Below is sampling of the HTML code. The example code below wants to create a variable named test and assign it a value of 12. How do access this variable from inside my SWF with AS3? In AS2 and earlier this variable would have been accessible from the main timeline. I can't seem to Access this from my document class, what am I missing?

PHP Code:



<param name="movie" value="MOMA_Box_Motion.swf?test=12" /> 




I'd also like to do this with SWFObject. The SWFObject docs show this exmaple. But again I can't seem to access these variables from the document class.


PHP Code:



<script type="text/javascript">
   var so = new SWFObject("movie.swf", "mymovie", "400", "200", "8", "#336699");
   so.addVariable("variable1", "value1");
   so.addVariable("variable2", "value2");
   so.addVariable("variable3", "value3");
   so.write("flashcontent");
</script> 

Passing Variables Via Query String
i am trying to load different xml that get generated through .net when I am trying to pass varibels i am getting undefined. Can someone give me a heads up on what i might be doing wrong. from what I have read and learned I can pull via-

Code:
xmlData.load("/family/galleryimage.xml.aspx?pid=" + _root.loaderInfo.parameters.pid.toString());

Then I am defining pid in within the object class.

Code:
<param name="pid" value='<% =Request.QueryString["pid"] %>'>
However I am getting undefined. Any help is much appreciated, thanks.
MT

Can I Pass Variables In The URL String?
I am trying to get some variables into a loaded swf at runtime. The variables will carry information so the swf can load the correct xml file. I thought we could pass them through the URL string like so:

new URLRequest("testing.swf?myVar=varOne

but it just throws an URL cannot be found error. How can I get variables into my swf at runtime?

Variables & Button Action Via URL Query String
Hi,
I have 2 variable textbox named 'box1' and 'box2' and a button named 'enter' in Flash. When the enter button is clicked, it calls up an file. Here is my problem:

I need the user to go to a URL:
http://www.something.com/form.swf?box1=john&box2=smith ...?

How do i write the query string so that the Enter button will perform it's onClick action with the loaded variables?
Can anyone help me please? Thanks.

How Do I Pass Variables Into String Object?
Hi,

Im trying to count the number of characters in a string using the string object. I can do this OK when I count the number of chars in a form field but I need to count the number of chars in a variable. Someone told me to use the code "+test+" below to count the variable named 'test', but all this does is return "6". This seems to be just counting the string +test+ (i.e. 6 chars.) rather than a variable

on (release) {
test = "ThisShouldDisplay19";
result = "+test+".length;
}

Can anyone help?

Cheers...John

Dynamically Populating SetRGB Variables From Query String?
anyone know if it's possible to populate setRGB variables dynamically from a query string using loadvariables?

thanks,
dg

Append Variables On A Query String In HTML Tags
Hi.

Okay, I have a single navigation swf that I want to be able to use over several html pages. I want my swf to be able to react to whichever html page it is on so that dependant on page one button will always be frozen to synchronize with the page title.

The easiest way I could think of (and most browser compatible) was simply to append a variable into the tags on each html page in the way that is defined in this Macromedia technote:

technote: Different approaches to setting variables in a Flash movie

Sounds simple.

But... I followed the directions (thrice) and it no workee! Nothing appears in my cursed test textfield.

I was hoping that someone might be able to pull me into the light, or suggest any other options? Can anyone else get this to work?

Thanks.

pinK

Use Form To Query MySQL DB, Then Pass Data To Flash File?
Say I have a form (form.html) that asks for a login name and password.
It then queries a mysql db via php (login.php) and if there's a match, then the user is taken to a page (welcome.php) with an embedded flash file (hello.swf) in which it says Hello [username].

If I could get just that far, it would be great. I'm getting confused on a number of things but most notably what kind of text box I'd use in the flash file (dynamic or input) and what method to use pass the variable. I mean if I were doing this as a regular php page (Hello [username]) then I know how to print the name in the new page but I'm clueless when flash comes into play

Query String In Flash
I have a dynamic text field and the variable name for it is "name". I want to change this text field using query string.

I have two pages.
1) Where there is a link to the flash page called "Click here"

2) The second page is flash html page and the name of the page is "hello.html".

Both the files are in the same folder and I am using the following code as a hyperlink with "Click here".

<a href="hello.html?name=John">Click here</a>

I want the name field to print "John" but it does not work.

Please help

Query String Into Flash?
Friends ..

I m really having difficulty in retrieving a querysting into flash ... i've searched through the forum n found links at the bottom, related to my problem .. well i need to load one querystring from a few into Flash e.g:

http ~~~com?flashvar=value?othervar=value

i want this (flashvar=1) value to goto different scene if the value is 1 then
gotoAndPlay("scene1",1); if (flashvar=2) so on .... !! I need the flash code from which i can get this value ... kinldy compile my request ... n gimme no error zero warning .. ... i m requesting this thread again, i haven't got any reply from the last one ..... thanks a lot .. the links r these !!



http://www.permadi.com/tutorial/fla...ring/index.html
http://www.actionscript.org/forums/...ed=1#post285398
http://www.actionscript.org/forums/...03&page=2&pp=15
http://www.actionscript.org/forums/...ead.php3?t=2219
http://www.actionscript.org/forums/...ead.php3?t=2946
http://www.macromedia.com/support/f...local_query.htm




have a nice time ...

How Do I Get A URL Into Flash From A Query String?
I've looked around in books and docs and forums and I've realised that I've got no idea of what to look for.

What I want to do is quite simple: somehow append a URL string to the Flash <object/> and <embed/> tags to tell Flash where to look for an MP3 file.

Something like:


HTML Code:
<object height="40" id="fl_cube" width="50" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"> <param value="http://mysite.com/assets/mp3player.swf?url=audio_file.mp3" name="movie" /> <param value="high" name="quality" /> <param value="#FFFFFF" name="bgcolor" /> <embed width="50" height="40" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="mp3player" bgcolor="#FFFFFF" quality="high" src="http://mysite.com/assets/mp3player.swf?url=audio_file.mp3" />
</object>
I don't even know if the query string is right:

"http://mysite.com/assets/mp3player.swf?url=audio_file.mp3"

Any help or tutorials would be greatly appreciated. Thanks in advance.

Query String And AS3 In Flash Cs3
I have been searching for how to read querystrings from html into flash.

I mean that I would like to get the variables like this:
Code:

<embed src="header_v2.swf?beta=1" quality="high" ...></embed>
I would like to get the variable: beta into flash.

In AS2 it was pretty easy, but when I try it in AS3 I get the error: Access of undefined property beta.

This is what I tried:Code:

var betaString:String = beta;
trace(betaString);
I have searched everywhere but cannot figure out how to get this in, is there someone that can help me out by pointing me in the right direction. If I find it out I will post an example/solution here.

I have looked at URLVariables and URLLoader, but those seem to be for outbound calls to a specific location, not when actually embedding the swf file. The reason that I am trying to figure this out is that I need the HTML/PHP embeded calls to remain the same.

Error 2101: The String Passed To UrlVariables.decode() Must Be Url-encoded Query String
I am trying to make a flash contact form which will submit the firstname, lastname, email and comments to an asp.net page.

I am have having the following error:

Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs

I am using the following action script code as pasted below. This action script is communicating with an asp.net file to send the email out. In the end it responds back with response=passed or failed.

I have already spent around 3 hours figuring it out.. and looking through the internet for resolution but no luck. Any help will be appreciated.

stop();
submit_btn.addEventListener(MouseEvent.CLICK, submit);

function submit(e:MouseEvent):void
{
var variables:URLVariables = new URLVariables();
variables.firstname = firstname_txt.text;
variables.lastname = lastname_txt.text;
variables.email = email_txt.text;
variables.comments2 = comments_txt.text;

var req:URLRequest = new URLRequest(”emailacount.aspx”);
req.method = URLRequestMethod.POST;
req.data = variables;

var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener(Event.COMPLETE, sent);
loader.addEventListener(IOErrorEvent.IO_ERROR, error);
loader.load(req);

status_txt.text = “Sending…”;

}

function sent(e:Event):void
{
status_txt.text = “Your email has been sent.”;
firstname_txt.text = “”;
lastname_txt.text = “”;
email_txt.text = “”;
comments_txt.text = “”;
}

function error(e:IOErrorEvent):void
{
status_txt.text = “There was an error. Please try again later.”;
}

and the following asp.net code:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script language="VB" runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
Try
Dim fromEmailAddress = "paul@lancierinc.com"
Dim toEmailAddress = "rizwandar@gmail.com"

Dim firstName = Request.QueryString("firstname_txt")
Dim lastName = Request.QueryString("lastname_txt")
Dim comments = Request.QueryString("comments_txt")
Dim userEmail = Request.QueryString("email_txt")

'create the mail message
Dim mail As New MailMessage()

'set the addresses
mail.From = New MailAddress(fromEmailAddress)
mail.To.Add(toEmailAddress)

'set the content
mail.Subject = "Email from" & firstName & " " & lastName
mail.IsBodyHtml = True
Dim strBody As String = "<b>Email from</b>" & " " & firstName & " " & lastName & "<br><b>Email Address:</b> " & userEmail & "<br><b>Comments:</b> " & comments
mail.Body = strBody

'send the message
Dim smtp As New SmtpClient("mail.lancierinc.com")
smtp.Send(mail)
Dim urltoencodestring2 = "response=passed&err=0"
'Response.Write(urltoencodestring2)


Catch smtpEx As SmtpException
'A problem occurred when sending the email message
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a problem in sending the email: {0}');", smtpEx.Message.Replace("'", "'")), True)
Response.Write(smtpEx.Message)
Dim urltoencodestring = "response=failed&err=1"
'Response.Write(urltoencodestring)

Catch generalEx As Exception
'Some other problem occurred
'ClientScript.RegisterStartupScript(Me.GetType(), "OhCrap", String.Format("alert('There was a general problem: {0}');", generalEx.Message.Replace("'", "'")), True)
Dim urltoencodestring3 = "response=failed&err=1"
'Response.Write(urltoencodestring3)
End Try
End Sub
</script>

Getting Query String Data In Flash
How would I go about getting a queryString variable into a flash movie that is loaded on the page.

EX:
index.aspx?FlashTitle=Kids+Run

I would then have a flash movie on that very page that would need to use the FlashTitle Variable. I can write the variable anywhere on the page useing .NET if it needs to go anywhere else to make this happen.

1. Is there a way to load quey string data
2. Is there a way to load flash vars written to a html page

I know you can load XML variables and that being the case there has to be a way to do this. Thanks.

-Alex Banks

Passing A Query String To Flash
Here's the need:

I'm going to be making a gallery of "thumbnails" which are all a flash file dynamically loading new content in each. So a single html page will house up to 48 copies of that same swf loading a new picture in each.

There has to be a way to load a flash file with a query at the end, right (in the html source code)? Like filename.swf?id=123&thispage=123 right? If so, how do I access those variables passed to flash?

My idea was to write my standard loop (in PHP) posting a new swf in each iteration but change the query string with each so that I can load the new content.

Query String Vs Flash Vars?
Hi -

Im building an mp3 player to load and play various single mp3 files for a website. i want to control each instance of the player with variables in the param name and embed sections of the html code... (ie.. load a unique title, mp3 url into each instance of the movie on a given page)

im new to this side of flash... ive googled for info and found a few things but not enough to implement what im trying to do.... would be cool if some one could sort me out on this cheers-

John

Can Flash Can Create A Query String Like In The Php?
Good day.

I have a question that can flash can create a querystring?
Example:

If i will click the Ok button in flash it will pass a variable in php or a query string. Then the query string or the variable in in php will pass to another flash files.

it is possible?

Coz i have a images when the user click one of the images then click ok it will go to the other .SWF files but the image that is choosen will be shown in the other .swf file.

How to do that?
Cn any body help me ? give me some links or tutorials...Coz im stuck..

Thanks in advance

Query String Vs Flash Vars?
Hi -

Im building an mp3 player to load and play various single mp3 files for a website. i want to control each instance of the player with variables in the param name and embed sections of the html code... (ie.. load a unique title, mp3 url into each instance of the movie on a given page)

im new to this side of flash... ive googled for info and found a few things but not enough to implement what im trying to do.... would be cool if some one could sort me out on this cheers-

John

String Passed To URLVariables.decode() Must Be A URL-encoded Query String...
I really don't understand why this won't work? I've made a test which sends some POST data to a script on my page which works fine. But why does not this work?


Code:
var mapsize = _cmap.fieldx.toString(16) + _cmap.fieldy.toString(16);
var names = "Zomis_AI6";
var description = "descr";
var result = "gameresult";
var upldata: String = "mapsize="+mapsize+"&names="+names+"&description="+description+"&result="+result;
trace(upldata);
var variables:URLVariables = new URLVariables(upldata);
var request2:URLRequest = new URLRequest();
request2.url = "http://www.zomis.net/record.php";
request2.method = URLRequestMethod.POST;
request2.data = variables;
var loader2:URLLoader = new URLLoader();
loader2.dataFormat = URLLoaderDataFormat.VARIABLES;
loader2.addEventListener(Event.COMPLETE, uploadcomplete);
try {
loader2.load(request2);
trace("Loaded");
}
catch (error:Error) {
trace("Unable to load URL");
}
Tracing gets:

Code:
mapsize=1010&names=Zomis_AI6&description=descr&result=gameresult
Loaded
Error: Error #2101: The String passed to URLVariables.decode() must be a URL-encoded query string containing name/value pairs.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables$iinit()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()

Pass XML String From PHP To Flash
Hi everyone, I'm hoping someone can help me out. I've been searching how to do this but haven't got it to work yet.

All I want to do is have flash call my php page which is putting together an xml string as a variable. I want to take that xmlstring in flash and parse it into my array.

I know how to do everything except load that XML string and parse it. I know how to parse an xml file, but a string is new to me. Also, for some reason when I try to get the XML string from PHP it comes back undefined.

Here is my Flash Actionscript:
// Call PHP and load XML string
loadVariablesNum("http://domain/recentimages.php","");

//My PHP file spits out the string as $recentxml, and it works fine. But when I try to trace that same string in Flash I get undefined.

//Here is the loop I've created to wait until the xml has been generated.

if (recentxml == undefined){

gotoAndPlay("loop");

} else if (recentxml != undefined){

gotoAndStop("finished");

}

//And here is the parsing method.
var myPhoto:XML = new XML();
myPhoto.parseXML(recentxml);
myPhoto.ignoreWhite = true;

Can anyone help? I would really appreciate any advice, I've been struggling with this for a while now and it's probably something easy.

Thanks, Matt

Query String Varibales Lagging Into Flash
ok heres the deal. i have a menu on an asp page. i wrote a java script function w/asp to retrieve variables from the page.

<script language="JavaScript">
<!--
function setName() {
szlgnID="<%=Request.QueryString("lgnID")%>"
szlgnType="<%=Request.QueryString("lgnType")%>"
szlvl="<%=Request.QueryString("lvl")%>"
szloc="<%=Request.QueryString("loc")%>"
//check if Flash object exists
if (window.document.dataBackendMenu) {
//set page variable in _root timeline of Flash movie
window.document.dataBackendMenu.SetVariable("lgnID ", szlgnID);

}
}

//-->
</script>

the flashpiece calls the function and the page pushes the variables into them mov. problem is it seems to be lagging - taking too much time. if i want to actually be able to use the values loaded i have to wait 3-5 frames in my mov. is this just a flash issue or what? is there a quicker more efficient manner to retrieve variables from the url string and put them into flash? the menu is residing as an include for the whole site. any help would greatly be appreciated. thanks.

Passing Query String Var Into Flash Only Works Sometimes...?
I'm trying to pass a variable into Flash from a query string, and for the most part it works great.

flashmovie.swf?page=home

On any page other than the home page, the Flash movie should skip it's build animation and go right to a resting state. Code:

if (page != "home") {
gotoAndPlay("navigation");
} else {
play();
}

This only works as intended after visiting several pages. Lets say I arrive on the home page and the movie plays through all it's animations. Fine, great. Now I go to any other page and it should skip right to the 'navigation' keyframe - right? Wrong, the movie skips ahead only about 40 frames, and plays out the rest of the intro. All other pages afterward behave correctly as coded. And revisiting that second page also now behaves normally.

What's the deal?

Sending Query String Flash To Html
hi all,
I am new to here this forum im using movie clips here long time ago, anyway could you pls tell me how to send query string flash to html. I found one site they are doing html to flash they didn't mention about how to send flash to html. I just doing one flash one that i need to using this option pleas tell me

cheer
code finder

Reading Query String From Java Into Flash
Hi,

I may be going about this in the wrong way (any help appreciated) but I want to be able to dynamically play an audio/video dependant on some parameters passed from a java servlet (jsp page). I currently have 2 parameters I'm passing using FlashVars; type can equal "audio" or "video" and a second parameter will be audio= or video= specifying the disk location of the file I want to incorporate into an empty movie clip in flash CS3 using actionscript 3. This will be an mpg, wav etc... file. I'm quite new to flash and upto now have only created a couple of flash applications using embedded images so please be gentle with me.

Is this even possible? There doesn't seem to be too much on the web I have
been able to find but it could be I'm not searching for the right thing.

Thanks in advance for any help.

Gary

How To Pass Carry String From Flash?
Is it possible to pass carry string from flash.
Example:
on some event I need to catch _y position of one object and to pass that variable to PHP script via URL.

Is it possible?

If it`s not, is there a way to write that variable in some txt file on server.. or something simillar..

Thanks folks!

Open Flash From Asp Link That Passes Query String
I am hoping this is easy.

How do you open a flash file with a link that is passing a query string? The flash file needs to evaluate data in the query string.

I am trying to open a record from a query by passing the ID to flash. something like ...myClip.htm?ID=13 My code in the movie would use the ID in the query string to pass back to an asp page that would run the query and pass it back to flash. I know it would be easier to stay in flash but the starting point is in an asp page. If there is an easier/better method I 'd love to hear it.

AS 2 Problems Setting Variable From Query String In Flash...
I'm creating a banner for a client that pulls in images via XML (sub_banner.xml.php) and depending upon which section of the site the user is in, PHP writes a query string sent via flashvars to set which section images to pull in.

The URL for example, after the query string is set for 'conferences' section of the site will be: sub_banner.xml.php?headerImages=conferences

All the PHP is in place, I'm just having trouble setting the query string (headerImages) in flash. I've tried: var headerImages:String = headerImages;

My background is HTML/CSS based and still learning AS2 so any help is much appreciated!

ASP: Pass A String Using Flash GETURL To Another ASP Document
In my ASP/html document I use the following code to carry/pass the username/school of a logged user to the next ASP document:


PHP Code:



<a href="projects.asp?name=<% =strUserName %>&school=<% =strSchoolName %>"




(not PHP but otherwise cant paste in the code.... why dont you guys have an ASP tag :P )

My question is how would I put this into a geturl statement in a flash button so that i can pass the asp strings using flash as a frontend to the next asp file?

I try just sticking in the link then the asp code but it doesn't.

Effectively the flash file button urls should retrieve the username/school for the next document but am having no luck ://

Any help appreciated.

Pass A String, Return Object With Name String
I feel like this should be pretty easy, but I 'm not quite sure how to do this...

I've got a string that is the name of a movieclip which is on the stage. I'd like to write a function which I can pass that string and have it return the object which has the instance name of that string.

Any hints?

Thanks.

John

AMFPHP - Can't Pass Variable Into SQL Query
Hey guys,

Yeah, I know there's a Flash Remoting forum, but the last post there is months old and gathering dust. So here goes...

Just getting to grips with AMFPHP but I've run into an annoying problem tat I can't seem to work out.

OK, this works, no problem:

PHP Code:



/**
    *queries Moodle FlashMod DB table only if logged on as user
    *@returns recordset (array) of Word Search activity records
    */
    public function get_wordsearch_records()
    {
        return mysql_query('SELECT * FROM `mdl_flashmod_results` WHERE `swfname` = 'Word Search' ');
    } 




But this just returns false:

PHP Code:



/**
    *queries Moodle FlashMod DB table only if logged on as user
    *@returns recordset (array) of input activity records
    */
    public function get_wordsearch_records($activity_type)
    {
        return mysql_query('SELECT * FROM `mdl_flashmod_results` WHERE `swfname` = $activity_type ');
    } 




I've also tried all sorts of other combinations of quotes, re-setting the variable in the PHP file, etc. but I always get false unless I hard code the SQL query.

Any help?

Pass Variable To Swf To Query Database
I am trying to create a page that lets a user preview mp3’s. The mp3s file locations are stored in a database and there is an <cfoutput query > that takes say the mp3 file ids and places it in the swf file. The swf file trys to call the database and loads the file.

I am having major difficulty as I am not an actionscript programmer.









Attach Code

HTML PAGE:
<cfoutput query =”myQueryName”>

<object …>
<param name="movie" value="mp3player.swf?fileID=#myQueryName.fileIDnumber#" />
…othercode.
</object>

</cfoutput>


ActionScriptPage:

var musicPlays:Boolean = false;
var theSound:String = LoadVars(URL.s);
var loopTune:Sound = new Sound();


loopTune.onLoad = function(success:Boolean) {
if (success) {
loopTune.start(0, 999);
musicPlays = true;
_root.musicPlayer.gotoAndStop("playing");
}
};
loopTune.loadSound("s", false);
musicPlayer.playStop.onPress = function ():Void {
if (musicPlays) {
this._parent.gotoAndStop("stopped");
loopTune.stop();
musicPlays = false;
} else {
this._parent.gotoAndStop("playing");
loopTune.start(0, 999);
musicPlays = true;
}
};

Can't Pass String To Nc.connect(string)
hey guys. fairly new to flash, but I've managed to throw together a player with info and tutorials from here and other places. I've got everything just how I want it save for one problem. I've got an XML file that I get the URL for my server from and also get the names of videos to populate a list. Here's the problem:
I can get the URL into a string in my program (it traces fine). However, when i try to pass that string in my nc.connect(string) it doesn't work. Everything loads fine, but when you click a video, it can't connect to it. If I manually enter the URL into the connect field like this: nc.connect("rtmp://url") it works fine.
So am I missing something? Why can it take the URL manually entered and not from a string?

Pass PHP Variables To Flash
I am trying to create a flash site that will allow users to upload an image to database. I am using PHP script to upload the image through an HTML popup window. Once the image is uploaded (after 'submit' has been clicked), how can I pass the 'imgID' variable back to Flash?

I know variables can be passed back to Flash through PHP by simply using the 'echo' function, but I can't seem to get it to work in this case (maybe b/c I am launching my php script through the 'getURL' instead of 'loadVariables'???).

Flash code:

Code:
on (release) {
//launch upload window
getURL("javascript:openNewWindow('upload.php', 'myWindow', 'height=200,width=500,toolbar=no,scrollbar=no,menubar=no,location=no,resizable=yes,status=no'); NewWindow.focus(); void(0);");
}
PHP Code:

PHP Code:



<?php

#DB CONNECT
//database info
$host="localhost";
$user="";
$pass="";
$db="";
$table ="image";

// database connection
$conn = mysql_connect($host, $user, $pass) OR DIE (mysql_error());
@mysql_select_db ($db, $conn) OR DIE (mysql_error());

#ON SUBMIT
// Do this process if user has browse the
// file and click the submit button
if ($_FILES) {

#ALLOWED FILE TYPES
$image_types = Array ("image/bmp",
                    "image/jpeg",
                    "image/pjpeg",
                    "image/gif",
                    "image/x-png",
                    "application/octet-stream");

#IF THE FILE UPLOADS SET USERFILE AND BUILD VARIABLES
if (is_uploaded_file ($_FILES['userfile']['tmp_name'])) {
    $userfile = addslashes (fread (fopen($_FILES["userfile"]["tmp_name"], "r"), filesize($_FILES["userfile"]["tmp_name"])));
    $file_name = $_FILES["userfile"]["name"];
    $file_size = $_FILES["userfile"]["size"];
    $file_type = $_FILES["userfile"]["type"];

#IF THE FILE UPLOADED IS IN THE ALLOWED FILE TYPES ARRAY UPLOAD IT
if (in_array (strtolower ($file_type), $image_types)) {
    $sql = "INSERT INTO ".$table." "
        . "(image_type, image, image_size, image_name, image_date) ";
    $sql.= "VALUES (";
    $sql.= "'{$file_type}', '{$userfile}', '{$file_size}', '{$file_name}', NOW())";

    @mysql_query ($sql, $conn);
    //Header("Location:".$_SERVER["PHP_SELF"]);
    
    //get image id
    $id= mysql_insert_id();
    
    echo "$id";
    
    }
  }
}

?>

<html>
<head>
<title>Upload Image</title>
</head>
<body>
<form method="post" enctype="multipart/form-data">
    <br>Select Image to Upload:<br>
    <input type="hidden" name="MAX_FILE_SIZE" value="24000000">
    <input type="file" name="userfile"  size="60">
  <p>
    <input type="submit" name="submit" value="Upload Image">
</form>

</body>
</html>



HTML Code:

Code:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>index</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<!-- URL's used in the movie-->
<A HREF=javascript:openNewWindow('upload.php', 'myWindow', ','height=200,width=500,toolbar=no,scrollbar=no,menubar=no,location=no,resizable=yes,status=no'); NewWindow.focus(); void(0);></A> <A HREF=javascript:Launch('index.php')></A> <!-- text used in the movie-->
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="550" HEIGHT="400" id="index" ALIGN="">
<PARAM NAME=movie VALUE="index.swf?id=<? echo id?>">
<PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> <EMBED src="index.swf?id=<? echo id?>" quality=high bgcolor=#FFFFFF WIDTH="550" HEIGHT="400" NAME="index" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT>

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function openNewWindow(URLtoOpen,windowName,windowFeatures) {
newWindow = window.open(URLtoOpen,windowName,windowFeatures);

}
// End -->
</SCRIPT>

</BODY>
</HTML>
Thanks for any advice you can offer.

Pass Variables From Flash
hi,

i like to know how do u pass variables from flash to another html. mine is just one simple variable.

what i get from flash Help is using GET and POST(after declaring the variables)

getURL("http://www.macromedia.com", "_blank", "GET");
getURL("http://www.macromedia.com", "_blank", "POST");

is there another way where i can pass variables? like using:
getURL("http://wwww.macromedia.com?fid=",);

*fid is the variables.


thank you

H E L P P L E A S E ASP And FLASH Pass Variables
Hope somone can assist here, I have an ASP page with 3 variables it gets from an excel spreadsheet (unusual but it works ok) I want to display the variables in 3 text areas in Flash 8
getdata.asp is my web page, variables are
STR_name
STR_add2
STR_postcode

its as simple as that, the ASP page works fine so I guess I need to run it in the background to produce the variables?
I have read many tutorials arround this but cant quite grasp it
I need to know what actionscript to run under what frame, I dont need to scroll through the records as the web page will only bring back 1 set of variables because the data is non conflicting

Thanks in advance
many thanks


































Edited: 04/16/2008 at 12:56:42 AM by john iles..

Copyright 2005-08 www.BigResource.com, All rights reserved