-
FK'n_dog
preferably yes
show your php code
-
The fla is the one that I have attached and the contents of the php file is:
PHP Code:
<?php
$id = $_GET['id'];
if(isset($id)){
$db = mysql_connect("localhost", "root", "");
mysql_select_db("tracks4all",$db);
$result = mysql_query("SELECT * FROM tracks WHERE id = $id",$db);
if (!$rec = mysql_fetch_array($result)) {
echo ("Sorry, no records found");
}
else {
do {
$name = $rec["file"];
echo("file=$name");
}
while ($rec = mysql_fetch_array($result));
}
}
?>
-
FK'n_dog
echo("&file=".$name."&");
-
OK and Shall I keep the fla the same?
because by just doing so it still doesn't work
-
FK'n_dog
RE : my post - 05-26-2007, 10:25 PM
Flash receives - &file=song1.mp3&
(Flash does not care how the variable is created, could be
from text file, php file, asp file, xml file - it doesn't matter.
what matters is the variable...it must be variable=value)
the code in the above post works OK
suggest you close your project.
open a new file.
test with the code i wrote above.
when you have it working apply the logic to your project
-
I did what you said and I ended up with this.
However it still doesn't play the file
PHP Code:
fileid = _level0.id;
this.createEmptyMovieClip("myMusic",1000);
myMusic = new Sound(myMusicMc);
lv = new LoadVars();
lv = loadVariables("file.php?id="+fileid, "_root");
lv.onLoad = function(){
myMusic.loadSound("../songuploads/"+lv.file); // defaults to event sound
trace("Ready to play "+lv.file);
};
-
FK'n_dog
Code:
fileid = _level0.id;
this.createEmptyMovieClip("myMusic",1000);
myMusic = new Sound(myMusicMc);
lv = new LoadVars();
/// lv = loadVariables("file.php?id="+fileid, "_root"); // wtf is this??
lv.id = fileid;
lv.sendAndLoad("file.php", lv, "POST");
lv.onLoad = function(){
// myMusic.loadSound("../songuploads/"+lv.file);
myMusic.loadSound("../songuploads/"+lv.file, true);
// true will stream the sound file
// if false, or parameter omitted, will load but will not play
trace("Ready to play "+lv.file);
};
-
Finally it works
Thank you very much for all your help and support
I have learnt a lot from this thread
Thanks very much again
-
FK'n_dog
no problem
glad to help you on your way
good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|