Flash And ASP Session Connectivity?
I am trying to have some connectivity between flash and a session object in asp.
Basically my aim is:-
When the user first enters the page they see the flash as per normal. Keeping withing the same browser window if they return to the home page what they then see is the flash animation at a particular frame, and not played from the start as previously.
Apparently the way to do this is as follows:
ActionScript Code: flashLoaded = new LoadVars();flashLoaded.onLoad=function(success){ if(success) { if(this["flash"]=="true") { gotoAndStop(5); } else { gotoAndPlay(2); } }}flashLoaded.load("default.asp");
and the ASP side of things is as follows:-
Code:
session("flash") = true I cannot get this to work, and have no idea what I am doing wrong, anyone looking at the code is this correct and any ideas as to why it does not work. I don't wish to append the querystring, because that is not the best approach in my opinion and surely there is a better method??
Please help me out here
Regards
Trev
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-15-2005, 06:27 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Passing Session Variable To FLASH, Evaluating, Then Altering The Session
I started a thread in the sounds and audio section and got some good suggestions from hp3 (mod) there. He suggested I move my questions here...
the task: read 2 session variables into FLASH, evaluate them in an if loop of some kind, and be able to rewrite the session variable with an onClick even for a button.
I want to be able to control the "state" of a soundtrack in a site that uses FLASH just as the navigation. I have the sound track built and the on off controls work fine (loads and unloads the movie to layer 1). The problem is that when you move fron HTML page to HTML page, your choices don't persist.
Every page in the site is ASP/VBSCRIPT, so using a Session variable is not a problem. I just need to know HOW.
I was told I need to pass the varible in through the embed src tag:
<embed src="controlpanel.swf?VAR1=VAL1&VAR2=VAL2" loop="false" etc etc
actually...
<embed src="controlpanel.swf?STATE=<%=Session("STATE")%>& TRACK=<%=Session("TRACK")%>" loop="false" etc etc
sound right so far? OK..easy enough. Now how do I read that querystring value into a FLASH AND then how do I evaluate it?
Is it as simple as Request.Querystring("STATE")?
FlashVariable1 = Request.Querystring("STATE")
Is there some loadvarible method for doing this? In the end, I want the first frame of the movie to do this:
1. get the variables STATE & TRACK from the embem src tag
2. evaluate the variables and do accordingly:
if FlashVariable1 = "ON" then
if FlashVariable2 = 1 then
load track1.swf into layer 1
else if FlashVariable2 = 2 then
load track2.swf into layer 2
else don't play the music
end if
3. when the user clicks the off button or selects a different track, write that back to the server side session variable:
onclick
unloadmovie from level 1 (killing the audio)
set Session("VAR1") = "OFF"
or for track selection...
onclick
loadmovie trackX.swf into layer 1
set Session("VAR1") = "ON"
set Session("VAR2") = "TRACK2"
Then, when the user moves to the next HTML (actually ASP) page, the embed tag uses the new session variable values and passes them into FLASH so that they can be evaluate once more.
Sound right? now HOW? That's the question. Your help is SUPREMELY appreciated!!
Thanks all
Filereference Session/cookie Problem..is It Secured To Send Session Id Explicitly?
hi, i am using fancyupload(combination of flash upload(file reference) and javascript).. the problem with file reference is that it doesn't send cookies and sessions to the upload script but i need to do authentication in the upload script to prevent any illegal uploads....
i read that session id must be sent to the upload script... but i wanna know if it is a security issue to send session id explicitly like this...
the fancy upload operates by giving the url through the javascript so basically i need to append the session id to the url making visible to the public.... so is there any harm that can be made if this session id is seen by everybody.... i read somewhere that this can be a risk for CSRF(cross site request forgery)??
is there a more secure method to do it??
and another question this how i wanted to do my upload
- load my php page where the upload form is found.... (i create a $_SESSION['upload_allowed']
- then i append the session id to the url of the upload script (e.g. "/includes/upload.php?PHPSSID=".session_id()
- when a user uploads a file....the flash uploads the file and calls the script upload.php?PHPSSID=1231231313
- the upload.php checks if $_SESSION['upload_allowed'] is found and allows the copy the file if it is found...
i wanna know something... i create a session $_SESSION['upload_allowed']... the flash uploads a big file(say it takes 1hr)..... and after the upload is complete, it calls upload.php.... but what if the session lifetime is less than 1hr.... the upload will fails isn't it??
when does the flash actually calls upload.php, when upload is complete(to temporary file) or at the start of upload??? i am confused with this
srry for such a long history...
Flash Connectivity And Security?
hi, i want to make a game that would exchange data between a database and perhaps a program, should i make the game using flash and actionscript or with java(an applet that is)
also can a flash presentation on a website, store a cookie on the users computer, which then in turn can be used to malicious reasons???
Ali
Database Connectivity With Flash?
Hi everyone
I am creating my companys website in which for the content area i am using the XML for calling the data.
For making it more flexible can i connect the database directly so that i can get the data through the database without creating the XML? Is it done ever before? if yes please let me know if its the right and efficient choice? and how can i do that as well please
Thanks
F.
Database Connectivity With Flash?
Hi everyone
I am creating my companys website in which for the content area i am using the XML for calling the data.
For making it more flexible can i connect the database directly so that i can get the data through the database without creating the XML? Is it done ever before? if yes please let me know if its the right and efficient choice? and how can i do that as well please
Thanks
F.
Database Connectivity With FLASH? How To
Hi All
Can anyone tell me if we can connect our database with flash some how and if any one can provide a sample or tutorial for it would be really helpful.
Waiting for some help.
Thanks
F.
Flash And Access Connectivity
I want to connect Macromedia Flash WORK that I designed with Microsoft Access Database and store/retrieve data values into it using client side script only.
Is it possible for anyone to help me with code/examples of how to connect to Microsoft Access using client only middleware script such as xml/JavaScript or vbscript and store data values into the database.
Please no server side scripts.
I am not allowed to use ASP or other server side scripts since the connectivity will be without a server only client allowed.
So the Breakdown --> things needed:
Connection to Access Database from Flash
Store and retrive data from access.
(using client side scripts XML, JavaScript, VBScript)
Thank u ,
loshy.
Flash And Access Connectivity
I want to connect Macromedia Flash WORK that I designed with Microsoft Access Database and store/retrieve data values into it using client side script only.
Is it possible for anyone to help me with code/examples of how to connect to Microsoft Access using client only middleware script such as xml/JavaScript or vbscript and store data values into the database.
Please no server side scripts.
I am not allowed to use ASP or other server side scripts since the connectivity will be without a server only client allowed.
So the Breakdown --> things needed:
Connection to Access Database from Flash
Store and retrive data from access.
(using client side scripts XML, JavaScript, VBScript)
Thank u ,
loshy.
Flash And Database Connectivity
Is there a good book that covers database connections with flash? I guess the proper order would be to learn XML first. What kind of database can flash communicate? SQL?
Rod
Database Connectivity In Flash Site... Pls Help
dear experts!!
I am making a flash completely in flash and I want that the contents of my flash site's home page should change dynamically everyday and gather contents from database randomly. I can do it in html page but don't know how to do it in flash. Please help me...
Flash MX (not 2004) Web-based DB Connectivity
I just recently got myself into a pretty large project where the client is asking for some seriously slick Flash animation and dynamics, based on a database on the server.
I'm curious to know if anyone out there knows of the BEST way that Flash MX (don't have 2004 yet, so bear with me) can communicate with a database without reloading the web page/Flash movie. I've delved into some XML based ideas, and in my mind I think I'll need to be using XML and a connectivity language, but I really want to find the best, most reliable (and easiest to use for development) language(s) to use for this project.
I'm not worried about learning anything new--this part I'm pretty good at by now.
I would figure a MySQL or MS-SQL based database would be best, since they are among the most stable (and we expect the database to become quite large eventually.)
So, any ideas or suggestions out there?
Thanx ahead of time.
Flash Connectivity (Urgent Help Needed)
All,
Urgent Help needed - I want to connect Macromedia Flash Quiz that I designed with Microsoft Access Database and store data values into it.
Is it possible for you to email me code/examples of how to connect to Microsoft Access using client only middleware script such as xml/JavaScript or vbscript and store data values into the database. Please no server side scripts.
I am not allowed to use ASP or other server side scripts since the connectivity will be without a server only client allowed.
Breakdown For Anyone Outhere who can do this:
Connection to Access Database from Flash
Storing Flash Data i.e. Text, Multiple Choice, Yes/No Values etc.. into Access Tables
(using client side scripts XML, JavaScript, VBScript)
Retrieivng Data from the database to Flash Quiz.
Email Address: g79@hotmail.com
Regards!
GG
Flash Mx 2004 + Database Connectivity
Hi,
I want to create an application for flash mx 2004 and any database communication.
Could all of you plz suggest various options available for me.
I think for this we require middleware softwares like coldfusion tool.
Could you suggest any freeware softwares for this connectivity.
cheers,
atul
Help Required In Database Connectivity In Flash
Guys, I am struck up with database connectivity ... any body has any idea how to connect the access with flash. I need this off line i.e. it needs to be on CD not on web. Client has more then 5000 products and he is providing the data on excel file so our job is to show the product though search based on numaric and string. PL help
Flash Mx 2004 + Database Connectivity
Hi,
I want to create an application for flash mx 2004 and any database communication.
Could all of you plz suggest various options available for me.
I think for this we require middleware softwares like coldfusion tool.
Could you suggest any freeware softwares for this connectivity.
cheers,
atul
Flash MX, ASP, And Microsoft Access Database COnnectivity
I desperately want to learn how to connect to a Access DB using ASP and a Flash MX and/or 2004 Pro front-end application to:
- add a record
- modify/ delete a record
- save to the database
- email via asp and flash
Is there a clear step by step tutorial anyone knows of. IF not does anyone know of a great book for a visual leaner like me.
I appreciate the help.
Flash Media Server Port Connectivity Check
HI,
i ran the the tests at http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16466 to figure out
if i can connect to fms from my network.
following are the results:
MAC 9,0,115,0
RTMP DEFAULTTimeOut
RTMP 80 Success
RTMP 443 TimeOut
RTMP 1935 Success
HTTP TunnelingDEFAULTSuccess
HTTP Tunneling80 Success
but what i would like to know is that: RTMP default fails, but rtmp 1935 succeeds, is n't rtmp 1935 the default?
also, does the above tests actually send rtmp traffic before confirming that port 1935, or any other port is open
for rtmp traffic or they just open a tcp connection and return?
so a basic question is: how reliable are the above tests and if the tests use AS2 code or AS3 code running inside my browser?
thanks,
Sunil
Session In A Flash
I have search here and I cant find that I looking fore.
I use much ASP and sometime I use session.
Now I try to find that in flash
That I try to do is this, I like to have a session in a flash that remember if the flash have show the visiter the movie.
The problem is that if the visitor is new the flash is going to play, after that that going to show a button if the visitor like to see the movie one more time.
The visitor going to surf around the site can maybe come back to the flash and the visitor is going to see the button (The flash have already play one time before)
If the visitor close the browser I whant that session to disappear so if the visitor visit the page again immediate the movie i play automatic and then again save the session so the movie dont show again so long the visitor is there and dont have close the browser.
The page that flash is going to be is a clean HTML so no ASP/PHP/Javascript
I going to be very happy if someone can help me whit this problem
(Sorry if that is hard to read my messenger, I'm not so good to write english)
Session In Flash
Dear all,
Just wondering, can I use session to move around variables between movie clips ?
thanks
Set Session In Flash
Is it possible to set a session variable in Flash?
Like $_SESSION[name] = "jasper"; would do it in html?
Asp - Flash Keep Session Id <<<
Hi ...
we have a dynamic site with ASP and I have a navigation on flash based. so this navigation has 3 level. the problem is that when user clicked to buttons on first, second or third level. and then if user click browser's back button the navigation the page should to keep session id and back to previous level. how can I do that?
pls send me an example!
thanks
[ö] <<
Session Id Using Flash In Asp Pages
I am wondering if flash can create a session id or obtain SID from asp pages that use SID. the SID is only important for the shopping cart. If Flash creates the SID what is the variable that will allow asp the maintain the same SID
Flash Variable To Php Session
Can anyone tell me how to send a value in flash to a php session? I'm not an actionscript expert so you might have to walk me through it.
Using Session Variables With Flash
I have a flash navigation that will be included into several different .html, .php files. The customer I am building the site for doesn't want a full flash site because of price, but rather wants a hybrid site. Anyway, the way I have it now, the navigation loads when you get to the index page. From there if they click a button and say it goes to music.php, this page contains the exact same nav_loader.swf which loads nav.swf into level 0. How do I get it to not show the loader file if it was already loaded in the index.php and is now cached?
You can see what I mean by going to http://66.195.17.117/~movingto/ and clicking the home and music buttons only.
Thanks for your help.
Flash And Session Info
Hi
I am developing a backend in Java and using Flash as the front end. The Flash application requires that the user logs in. To do this I get the session info and store it in the flash and pass is back as JSESSIONID=xxxxx to each url that is loaded. THis works fine in a browser window. Howe if I need to debug in the FLASH ide this doesn't workas the browser seems to ignore the session info being passed.
Is there a way to get around this?
Benon
Unset Session Id In Flash
How to I unset the session id after I click a send button in Flash? I can set it in the index.php page where the flash object is, but after clicking the send button, the index.php page doesn't change location so I can't unset it. Is it possible to unset in through actionscript?
Passing Session Ids Into Flash And Then Out Again
Hi all,
Wondering if anyone is able to shed any light on passing user session ids into fa flash file (from html), then say the flash button is directing them to another page, that there user session id be taken with them...
If there are any tutorials on this I would be greatful to know.
Thanks
Dan
Using PHP Session Variables In Flash...
Hi guys, im writing a football manager game in PHP/mySQL and FLASH/AS..
at the moment...
a user can select 6 players for their team
enter an 8 team tournament
view there first fixture.
this is all achieved using php..
for the actual matchplay for the fixture i want to take the variables created in php into flash.... and then produce a dynamic animation....
i have played around with gettin php variables into flash and have so far been successful, however.. it doesnt seem to like it when i used SESSION variables??? This is quite a large problem as most of my queries depend upon session variables....
the variables i need to use are ...
$gameid = $_SESSION['gameid'];
$teamid = $_SESSION['teamid'];
I also get a lot of errors when having session_start(); at the top of my php page...
Does anyone know how to get round this problem???
thanx in advance
Flash And PHP Session Issue
Hi there! Does anyone know how flash deals with PHP sessions? I have a flash input text box , converted to a MC with the instance name form, and heres the code for when the submit button, named 'moveon', is hit:
ActionScript Code:
moveon.onRelease = function ()
{
if (email.text == "")
{
trace("Invalid Email");
}
else
{
form.loadVariables("emailLoader.php", "POST");
play();
}
}
Here's the php script:
<?php
session_start();
$_SESSION['emailAddr'] = $_POST['emailAddr'];
$to = "my email address";
$subject = "tester";
$message = "Customer Email: ".$_SESSION['emailAddr'];
mail( $to, $subject, $message ) or print "Could not send mail";
?>
So this part works. It starts the session, stores the var in the session array, and then mails it to me. Then once the people enter their email address in the flash site, it takes them to an upload area where they can upload a file from their computer. The uploading part works fine, I use FileReference and call a second php script:
ActionScript Code:
file.upload("fileUpload2.php");
And here's the PHP script for that one
<?php
session_start();
$source = $_FILES['Filedata']['tmp_name'];
$target = "uploadedFiles/".$_FILES['Filedata']['name'];
move_uploaded_file($source, $target);
$subject = "SFP: A new file has been UPLOADED";
$message = "A new file, ".$_FILES['Filedata']['name']." , has been uploaded.
";
$message .= "Download: http://www.mywebsite.com/".$target."
";
if (isset($_SESSION['emailAddr']))
{
$message .= "Customer Email: ".$_SESSION['emailAddr'];
}
else
{
$message .= "EMAIL IS NOT SET IN PHP SESSION!";
}
$to = "myemail";
mail( $to, $subject, $message ) or print "Could not send mail";
?>
So it checks if that session is set, and its not, I get the return of that else statement in my email. I was wondering if maybe Flash destroys PHP sessions prematurely. It's set in php.ini so that the session is destroyed when the browser is restarted, but I was thinking maybe Flash does funny things. Any ideas? Cheers
Session Persistence With Flash RPC
Hi,
I am integrating a flash front end using remoting to make RPCs to a J2EE business delegate at the same time as having other pages created by JSP pages.
Without using cookies I am looking for a way to maintain session persistence. I want to do this at the server end, i.e. I want the http session ID. so that I can go from a swf to static html pages without losing session objects.
It is my understanding that when using the flash file however that at each instance it creates a new session, for example if someone followed a link out of the movie, and then navigated back it would create a new session.
At the moment I am getting around this using a login to identify a user and have a session ID stored in a DB. However I feel that this is an inelegant solution and does not allow me to have to separate flash RIA movies with html pages inbetween when I only want to display static content.
I know the flash gateway servlet creates a JSESSIONID but it only passes this forward to the movie on the client so that subsequent requests can use it. However with the RPC I do not appear to be able to get this on the server side or find anyway of being able to stay in the same session when a request for the swf is made as it creates a new session for the new movie!!!
Can anyone help me at all? I realise that it is possible with cookies but do not wish to use these... Thankyou to anyone who can take the time to answer this.
[FLA+PHP] How To Set A Session Variable From Flash?
Hi all,
I have an intro page created in flash that ends with the language
choice using two or more buttons (english - italian ...).
Every button should set the session variable 'language' to the related
language (the italian button should set it to 'IT'; the english button
should set it to 'UK').
Then the whole site is developed using PHP and every page reads the
session variable 'language' to display the right texts/images.
I'm able to set the session variable in a php page, but I'm not able
to set this variable in the flash movie.
Is there a tutorial or manual to read?
Thanks in advance for any suggestion.
tony
Login Session In Flash
How to maintain login session in flash remoting?
Edited: 02/10/2007 at 10:58:45 AM by Simhanature
Ending A Php Session W/ A Flash Btn....
hello, I have a flash header with a log out btn--I was wondering if it is pssible to end a session with this flash btn? or if it is possible to link the btn to a php file that ends the session then sends the user to a new page?
thanks,
hutch
Passing Session ID From Flash To CF CFC
I have to update a session variable from a flash shockwave. Is there a way to pass the sessionID to the Cold Fusion CFC from the shockwave so that Cold Fusion knows which Session Flash is referring to?
Can Flash Use Session Variables?
hey guys,
I've created an html/asp web page with a standard form that asks the user to enter their "username". When the user does this and clicks submit, he is taken to another html page that contains a flash movie. I want this flash movie to display the "username" entered on the previous page.
I figure, I can make the username a session variable and then have the flash movie reference it. Is this possible? What would the actionscript look like?
Thank-you very much!
artane
Ending A Session With A Flash Btn...
hello, I have a flash header with a log out btn--I was wondering if it is pssible to end a session with this flash btn? or if it is possible to link the btn to a php file that ends the session then sends the user to a new page?
thanks,
hutch
Can Flash Use Session Variables?
hey guys,
I've created an html/asp web page with a standard form that asks the user to enter their "username". When the user does this and clicks submit, he is taken to another html page that contains a flash movie. I want this flash movie to display the "username" entered on the previous page.
I figure, I can make the username a session variable and then have the flash movie reference it. Is this possible? What would the actionscript look like?
Thank-you very much!
artane
Passing Session Variables Into Flash
I'm building a login scheme that uses PHP sessions to pass the key variables (i.e. $login and $password).
Typically, I can easily pass variables into flash movies by calling the PHP scripts via LoadVarNum and using print to send them back.
However, this situation is a little different since the php session commands are actually part of the url that contains the embedded .swf. I have determined that the needed variables are in fact making it to the top level url but not into the .swf.
Does anyone know of an alternative way to pass the variables into the .swf (besides populating them into header since that would reveal the info in the link)???
I'm thinking that there may be an option in the embed command or something.
Any help will be greatly appreciated.
PHP/Flash How To Send Session Variables
I have a database that requires unique logins and that works in flash. I have another part that opens a pop up window (html) to view account info. **The problem is that I can not get flash to send the session variable so they can view account info.
I do not want to have another round of logins at this point so how do I get flash to send the session var. By the way I know flash is getting the var because I have done testing and have traced test variables. Here is the smartclip code below.
on (release) {
getURL ("javascript:window.open('"add url add"?session','"add winName add"','width="add winW add",height="add winH add",scrollbars=1, top='+((screen.height/2)-(" add winH/2 add "))+',left='+((screen.width/2)-(" add winW/2 add "))); void(0);");
}
the session variable name is 'session' so where does the
?session go becuase I have tried every concievable placement.
Thanks in advance
HWORB
PHP/Flash How To Send Session Variables
I have a database that requires unique logins and that works in flash. I have another part that opens a pop up window (html) to view account info. **The problem is that I can not get flash to send the session variable so they can view account info.
I do not want to have another round of logins at this point so how do I get flash to send the session var. By the way I know flash is getting the var because I have done testing and have traced test variables. Here is the smartclip code below.
on (release) {
getURL ("javascript:window.open('"add url add"?session','"add winName add"','width="add winW add",height="add winH add",scrollbars=1, top='+((screen.height/2)-(" add winH/2 add "))+',left='+((screen.width/2)-(" add winW/2 add "))); void(0);");
}
the session variable name is 'session' so where does the
?session go becuase I have tried every concievable placement.
Thanks in advance
HWORB
Help: Can Flash Interact With Asp Session Variables?
can flash interact with asp Session variables?
it seems to work fine from cold fusion, but i am having problems getting flash to read variables from an asp page
&myPageNumber=<%=Session("PN")%>&
flash seems to see this as:
&myvar=<Session("PN")&
instead of
&myvar=108&
any ideas?
Using Flash Menus / ASP Session Variables
I'm going to try and explain this the best I can...
Here we go...
I'm using a Flash MX menu to navigate a company Intranet. When a user logs into the Intranet, an ASP script sets Session variables so that other pages can detect if a user is logged in. All of the pages of the Intranet are set up to kick back to the login screen if these Session variables are not set. When navigating with the Flash Menu, the Session variables do not carry to the next page (even if they are ALREADY SET).
I'm using the getURL(link) actionscript command...
I was wondering if anyone knew a way to make these Session variables carry over after a call to getURL() or if there is another ActionScript command that could be used?
Thanks for the help,
Grier
Send Session Variable In Flash
I want to send a session variable out of flash. It would be a URL I am sending out.
How would I do this? Do I need php or asp?
Sharing Flash Session With Browser
I have seen some workarounds for this but none work for me. For some inane reason Flash loads cookies from Internet Explorer even when I use firefox. Specifically I am using Flash to upload files. On the server I use ACEGI with Java Servlets. I have tried the method of sending the cookies on the Querystring, but java does not read cookies from there (go figure, that isn't where they should be anyway), I have also tried to send the sessionid on the querystring but ACEGI isn't recognizing it. As a result all uploads fail in non-internet explorer browsers.
Does anyone else have other solutions? Even stupid ones would be appreciated.
Output From Flash To Session Cookies
Hi,
I'm a newbie as far as Flash is concerned. My background is coding dynamic ASP 3.0 with ODBC connection to Access databases. I have a number of educational programmes written in Flash that I want to be able to track the progress of the student through each scene so I can provide advanced reporting.
I am hoping the simplest solution ( not necessarily the best) is to get each scene to write to the session cookie. I can use the Global.asa file Session.end event to capture the output to write to a database. I would like to write several variables for each scene - course name, scene number, date & time.
All help appreciated
|