View Full Version : variables and flash?
bleutuna
February 25th, 2004, 12:02 PM
Got a website. Has some music. I want to make it so that if you turn the music off, it says off on subsequent pages.
The site is HTML, with flash where needed.
http://www.aladdin-trading.com/dev/
Can I use flash to write a variable to ASP, and then have ASP pass it back to Flash?
jbum
February 25th, 2004, 01:36 PM
In short, yes.
There are a number of methods you can use to synchronize your flash movie to a back-end, including Flash Remoting, XML and send/load vars. Here's some example code (from the O'Reilly "Flash Cookbook" - buy it!) for loading vars from a server-side cgi script.
// You must first create the LoadVars object.
myLoadVars = new LoadVars( );
// Then load the variable from the server-side script. This example
// uses the loadVarsScript.cgi script, which is assumed to be in
// the /cgi-bin directory on the same server. To test this code,
// change the URL to point to an actual script on your server.
myLoadVars.load("/cgi-bin/loadVarsScript.cgi");
myLoadVars.onLoad = function (success) {
// If the data loads, display the variable in a
// text field named output_txt on _root.
if (success) {
_root.output_txt.text = this.myVar;
}
};
Instead of CGI, those vars could be loaded from an ASP page as well...
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.