Ok, so we all have seen the dynamic flash swfs (mp3 players, location maps,
etc) embedded in myspace... How does this work? I am working on something
like this, and I need some help....
If you look at MyFlashFetish.com's MP3 player "copy and paste your code", they
are using FlashVars to define a user ID, which makes sense. Then you would put
that FlashVars userID into a URL variable to dynamically load some content from
a Coldfusion/PHP page.
My problem is, how do you do that? I tried something such as this.....
[h]
myData = new LoadVars();
myData.onLoad = function() {
myText_txt.text = this.myVariable;
};
myData.load("http://www.1sserver.com/test/loadvars.cfm?userID=1234");
[/h]
I didn't have much luck...... I'm not sure I should even be posting what I
did.... I guess bottom line is, how would you guys do this?
Thanks in advance!!!!
myData = new LoadVars();
myData.onLoad = function() {
myText_txt.text = this.myVariable;
};
myData.load("http://www.1sserver.com/test/loadvars.cfm?userID=1234");
Noelbaland - 31 May 2008 02:10 GMT
Hello,
There are various ways to do what you want to do above. I came across this
good article/tutorial a few months ago that might help. The writer explains
all the different ways to load and send data in Flash. He even has
downloadable files as well. There's one in there which uses FlashVars.
http://www.nunomira.com/tutorials/loading_variables.php
Also, I'm not sure how it works in Coldfusion but in PHP your code above would
work if there was a myVariable returned in the script.
<?php
if(isset($_GET['userID']) == "1234"){
$myVariable = "Hello World";
// echo or print the variable
echo "&myVariable=$myVariable";
}
?>