Groups | Blog | Home
all groups > flash (macromedia) > september 2007 >

flash (macromedia) : Loading Absolute Paths


optikool
9/23/2007 10:08:04 PM
Hi,

I'm new to flash and I'm creating a flash mp3 player and have questions about
loading paths. I'm trying to find out if it's possible to load absolute paths
that are outside the document root of my website. The reason why I want the
mp3's outside the document root is because I don't want the mp3's to be
accessible for download. Here is the code that I'm using to try to accomplish
this task....

var getSong:LoadVars = new LoadVars();
var sndTrack:Sound = new Sound();
var pauseMs:Number = 0;

getSong.load("mp3loader.php");

getSong.onLoad = function(lSuccess:Boolean):Void {
if (this.theSong) {
txt_field.text = this.theSong
} else {
txt_field.text = "Song Not Found";
}
if (lSuccess) {
sndTrack.loadSound(this.theSong, true);
sndTrack.onLoad = function(sSuccess:Boolean):Void {
if (sSuccess) {

sndTrack.stop();

play_btn.onRelease = function() {
sndTrack.start(pauseMs, 0);
}

stop_btn.onRelease = function() {
pauseMs = 0;
sndTrack.stop();
}

pause_btn.onRelease = function() {
pauseMs = sndTrack.position / 1000;
sndTrack.stop();
}
} else {
txt_field.text = "Song Could Not be loaded";
}
};

}
};

The path that would be returned by the php file would be something similar to
"/var/www/mp3s/mp3file.mp3 and the swf file could be located at
"/var/www/public_html/player/mp3player.swf". If flash does not have the
capability to load files outside of the document root of the website can you
give alternatives to accomplish the same thing?

Thanks
Dana H.
kglad
9/29/2007 5:28:43 AM
AddThis Social Bookmark Button