PDA

View Full Version : help with uploading to ftp


haider
08-27-2007, 08:49 AM
hi guys and ladies. :cool:
i have a problem with uploading my website to an ftp server,

basically everything works fine locally but when uploaded into the ftp,

the video links dont work.

i am controlling the videos by a variable ns in my video player ,

i am also using a combo box to select the video being played here are the codes.
the combo box name is selectClip, its contained in a MC (move1)



var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

theVideo.attachVideo(ns);

rewind.onRelease = function() {
ns.seek(0);
}
pllay.onRelease = function() {
ns.pause();
}
stopp.onRelease = function() {
_root.ns.close();
}

//scrubber bar
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 409.8;
loader.scrub._x = ns.time / duration * 409.8;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,409.8,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/409.8) * duration));
}


//test
var selectListener = new Object();
selectListener.change = function(){
_root.ns.close();
_root.ns.play(move1.selectClip.selectedItem.data);
}

_root.move1.selectClip.addEventListener("change", selectListener);
playRandomClip();

//test1
var selectListener = new Object();
selectListener.change = function(){
_root.ns.close();
_root.ns.play(move1.selectClip1.selectedItem.data) ;
}

_root.move1.selectClip1.addEventListener("change", selectListener);
playRandomClip();


thanks guys for the help

fandlr
08-27-2007, 09:18 AM
use absolute paths and try again

haider
08-27-2007, 09:26 AM
how do i change the combobox data to absolte paths then ?

Paul Ferrie
08-27-2007, 09:30 AM
selectListener.change = function(){
_root.ns.close();
_root.ns.play("http://www.yourdomain.com/videos/"+move1.selectClip.selectedItem.data);
}

Hope it helps

haider
08-27-2007, 09:33 AM
hi i tried changing the path of the data in the combo box to the absolute value "ftp://1b07126@w3.eng.tp.edu.sg/basic.flv" but it still does not play . i am really stumped on this one..

Paul Ferrie
08-27-2007, 09:37 AM
Do you not have a web address you can use rather than the ftp@?

haider
08-27-2007, 09:49 AM
yeah i do, ive tried it on both the ftp and the html adress

selectListener.change = function(){
_root.ns.close();
_root.ns.play("http://w3.eng.tp.edu.sg/1b07126/"+move1.selectClip.selectedItem.data);
}


it somehow does not seem to be able to play the file

Paul Ferrie
08-27-2007, 09:54 AM
What data is passed to the url?
http://w3.eng.tp.edu.sg/1b07126/+?what

haider
08-27-2007, 09:58 AM
the data is controlled by a combobox, basically they are video files. for example basic.flv

haider
08-27-2007, 10:02 AM
i tried editing the combobox data by making it an absolute path
http://w3.eng.tp.edu.sg/1b07126/basic tut.flv

Paul Ferrie
08-27-2007, 10:10 AM
Server not found on your link
http://w3.eng.tp.edu.sg/1b07126/basic tut.flv

also you should avoid having spaces in your filenames.

is 1b07126 a folder on your collage campus network?

haider
08-27-2007, 10:18 AM
yea man, its a college campus network , only those in the campus can access it.

Paul Ferrie
08-27-2007, 10:26 AM
Have you tried asking one of the tech guys on campus?
They will know for sure what you need to do.

haider
08-27-2007, 10:28 AM
hi paul, i tried using a button to play the file an alternative way to see if the combobox had something wrong.

on (release) {
_level0.gotoAndStop("oos");
function wait() {
clearInterval(myTimer);
ns.play("http://w3.eng.tp.edu.sg/1b07126/videos/rotary setup.flv")
InformationSlideTo(2);
}
myTimer = setInterval(wait, 1);
}

even this will not make the video player play

Paul Ferrie
08-27-2007, 10:58 AM
Your getting a server error on your url so no amount of code will make it work.

You need to speak to tech guys at your campus about it.

haider
08-28-2007, 11:00 AM
hey man u were right it was the servers fault the technician had to allow the extension .flv in some MYAP or something like that

Paul Ferrie
08-28-2007, 11:04 AM
Ah nice one:)
It's MIME Type