![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
имеется скрипт такого рода находящися во флешке которая грузиться в файле test.php
var my_lv:LoadVars = new LoadVars();
function showtext (fileName) {
my_lv.load(fileName, my_lv);
my_lv.onData = function(src:String) {
if (src == undefined) {
trace("Ошибка загрузки данных.");
return;
}
lv_fun(src);
};
lv_fun = function (src) {
if (src = "File Already Existed"){
uploadButn.enabled = false;
}
if(src = "Press Upload"){
uploadButn.enabled = true;
}
radl2 = src;
};
}
showtext("http://домен.ру/sup/is.php?fname="+fileRef.name);
сделал скрипт, запустил, проверил, все нормально... после нескольких попыток замечаю что он не грузит результат запроса с "http://домен.ру/sup/is.php?fname="+fileRef.name а берет данные вроде как из кеша... как быть, что посоветуете??? Последний раз редактировалось 3Ton; 01.02.2007 в 16:17. |
|
|||||
|
мб, просто страничка именно из кеша грузится
+ не там вопрос задали, да еше и правило нарушили
__________________
"We Are The Champions My Friends!" Queen |
|
|||||
|
Регистрация: Nov 2006
Сообщений: 85
|
а просто рандомный параметр ему в URL подсовывать не пробовали? классическая техника... типа:
|
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
Цитата:
ситуация не исправилась, даю весь код с заменой доменного имени var my_lv = 0;
var my_lv:LoadVars = new LoadVars();
var src = 0;
var fileName = 0;
function showtext (fileName) {
my_lv.load(fileName, my_lv);
my_lv.onData = function(src:String) {
if (src == undefined) {
trace("Ошибка загрузки данных.");
return;
}
lv_fun(src);
};
lv_fun = function (src) {
if (src = "File Already Existed"){
uploadButn.enabled = false;
}
if(src = "Press Upload"){
uploadButn.enabled = true;
}
radl2 = src;
};
}
_root.radl2 = "status message"
//import the FileReference Object
import flash.net.FileReference;
//initial settings - since no upload file type selet yet user cannot upload a file
uploadButn.enabled = false;
if (fileRef.name != ''){
browseButn.enabled = true;
fileDescription = "Images";
fileExtension = "*.jpg; *.jpeg; *.rar; *.zip";
reDrawPB ("progressBar", 23, 44);
}
else {
browseButn.enabled = false;
}
//create a new FileReference object
var fileRef:FileReference = new FileReference();
//create a listener object for FileReference events
var fileRefListener:Object = new Object();
//create a listener object for comboBox events
var myComBoxListener:Object = new Object();
var isDefault:Boolean = false;
//a small function to redraw (reset) the progress bar
function reDrawPB (pb, xCor, yCor) {
_root.destroyObject(pb);
_root.createObject("ProgressBar",pb,0);
_root.progressBar.move(xCor,yCor);
}
//===================== COMBO BOX EVENT HANDLER =====================//
myComBoxListener.change = function(obj) {
status_txt.vPosition = status_txt.maxVPosition;
if (isDefault == true) {
//if user select the file type option it will clear the text area
status_txt.text="";
browseButn.enabled = false;
isDefault = false;
}else {
status_txt.text = fileDescription + ' ' + '('+fileExtension+')'+'\n';
// browseButn.enabled = true;
}
}
//apply object listener to the file reference object
fileType.addEventListener("change", myComBoxListener);
//===================== FILEREFERENCE EVENT HANDLER =====================//
//When user selects a file from the file-browsing dialog box,
//the onSelect() method is called, and passed a reference to the FileReference object
fileRefListener.onSelect = function (fileRef:FileReference):Void {
showtext("http://домен.ру/sup/is.php?fname="+fileRef.name+"&r="+Math.random()*100000);
browseButn.enabled = false;
// uploadButn.enabled = true;
reDrawPB("progressBar", 23, 44);
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File is selected to upload \n";
status_txt.vPosition = status_txt.maxVPosition;
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "-------------------------------FILE DETAILS------------------------------- \n";
status_txt.vPosition = status_txt.maxVPosition;
// status_txt.text += "File Size: " + fileRef.size + " bytes" + '\n';
// status_txt.vPosition = status_txt.maxVPosition;
// status_txt.text += "File Type: " + fileRef.type + '\n';
// status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "File Name: " + fileRef.name + '\n';
status_txt.vPosition = status_txt.maxVPosition;
// status_txt.text += "Date Created: " + fileRef.creationDate + '\n';
// status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "Date Modified: " + fileRef.modificationDate + '\n';
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "--------------------------------------------------------------------------------- \n";
}
//When user dismiss the file-browsing dialog box,
//the onCancel() method is called, and passed a reference to the FileReference object
fileRefListener.onCancel = function (fileRef:FileReference):Void {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="User terminated file upload. \n";
}
//When the file upload/download process started,
//the onOpen() method is called, and passed a reference to the FileReference object
fileRefListener.onOpen = function (fileRef:FileReference):Void {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="Opening file " + fileRef.name + '\n';
}
//The onProgress() method is called periodically during the file upload operation
fileRefListener.onProgress = function (fileRef:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
//setting the status bar function
progressBar.mode = "manual";
progressBar.setProgress(bytesLoaded, bytesTotal);
}
//When the file upload/download operation is successfully complete,
//the onComplete() method is called, and passed a reference to the FileReference object
fileRefListener.onComplete = function (fileRef:FileReference):Void {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text += "The '"+fileRef.name + "' has been uploaded.\n";
//upload is now complete, disable the upload & browse button
uploadButn.enabled = false;
}
//********************************* ERROR EVENT HANDLING *********************************//
//This method will be called if and only if an upload fails because of an HTTP error
fileRefListener.onHTTPError = function (fileRef:FileReference, error:Number) {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="HTTP error: with " + fileRef.name + " :error #" + error + '\n';
}
//This method will be called if and only if a file input/output error occur
fileRefListener.onIOError = function (fileRef:FileReference) {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="HTTP error: with " + fileRef.name + '\n';
}
//This method will be called if and only if an upload fails because of a security error
//9 out of 10 time this error occus is because of the user Flash8 player security settings
fileRefListener.onSecurityError = function (fileRef:FileReference, errorString:String) {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="Security error: with " + fileRef.name + " : " + errorString + '\n';
}
//****************************************************************************************//
//attach Listener to the FileReference Object
fileRef.addListener(fileRefListener);
//button event for the browse button
browseButn.clickHandler = function () {
//The browse function is the key, coz it displays a file-browsing dialog box
//in which the user can select a local file to upload
fileRef.browse([{description: fileDescription, extension: fileExtension}]);
}
//Button event for the upload button
uploadButn.clickHandler = function () {
status_txt.vPosition = status_txt.maxVPosition;
status_txt.text +="Attempting to upload " + fileRef.name + '\n';
//upload the file to the PHP script on the server
//put your domain in the upload() method
fileRef.upload("http://домен.ру/sup/upload.php");
// status_txt.vPosition = status_txt.maxVPosition;
}
//}
|
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
Цитата:
извеняюсь, но я читал их еще когда регистрировался, но долго отсутствовал на сайте, можно узнать что я нарушил???? |
|
|||||
|
4AM Games
|
Я говорю о правилах раздела, их не показывают при регистрации, их можно увидить в Важных топиках этого раздела
Так же перед тем как зайти в раздел, в кратком описании есть ссылка пернес в раздел для начинающих, первое и последнее устное предупреждение.
__________________
Я перестал переписывать, начал редактировать, еще лет 15 и я стану писателем ^_^ |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
1. Выбрали не тот раздел,
2. Не оформили код, как полагается, 3. Создали дубль-тему. |
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
Цитата:
давайте попорядку... 1. каков раздел должен был выбрать по Вашему мнению??? 2. согласен, исправлюсь 3. где дубль-тема??? |
|
|||||
|
Et cetera
Регистрация: Sep 2002
Сообщений: 30,787
|
Цитата:
|
![]() |
![]() |
Часовой пояс GMT +4, время: 17:22. |
|
|
« Предыдущая тема | Следующая тема » |
|
|