![]() |
|
||||||||||
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
во первых почему для новичков если тут вопрос о возможном кешировании пхп запросов флешем...
а во вторых я так и не понял насчет дублирования темы... и правила только что прочитал снова и фак тоже в чем моя проблема???? тут помощь предложат или только хаить будут??? |
|
|||||
|
4AM Games
|
Цитата:
Цитата:
Автор ответа совершенно прав, это нормальная практика. + К тому если бы вы перед публикацией подумали, то могли бы понять, что даже если вы профи вам нужно постится не в разделе ActionScript а в Flash и Другие Технологии, где как раз таки обсуждаются вопросы связки с серверами\оболочками, неужели так сложно прочесть описания форумов, они не занимают даже страницы печатного текста, по моему это нулевая нагрузка.
__________________
Я перестал переписывать, начал редактировать, еще лет 15 и я стану писателем ^_^ |
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
я извеняюсь, а модератор пробежался взглядом по коду прежде чем переместить тему???
ситуация такова - готовлю систему управляющую процессом от поступления заявки до получения готового продукта. почти все готово последний ньюанс - во флеше необходимо отправить файл на производство, при выборе файла формируется запрос на сервер(ни страничка ни флеш не перезагружаются) с проверкой наличия такого файла, если файла нет активизируется кнопка отправки и файл отправляется опятьже не перезагружая ни страничку ни флеш. проблема получить динамическиподгружаеммые данные путем запроса через my_lv.load(fileName, my_lv); не перезагружая ни флеш ни страничку. |
|
|||||
|
4AM Games
|
повторяю. вы как супер гуру флэша, способы ознакомится с третьим постов в данном топике и сказать мне работает или нет.
далее раз вы такой профи, вы можете ответить кэшируются файлы или нет, а не "может быть", можно же отследить через файр вол или HTTP трейсер откуда пришли данные от сервера или кеша. и если вы такой гений, почему бы вам не прочитать про все методы класса LoadVars и понять что без перегрузки все очень легко делается?
__________________
Я перестал переписывать, начал редактировать, еще лет 15 и я стану писателем ^_^ |
|
|||||
|
Регистрация: 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
|
Цитата:
вопрос гораздо глубже начинающих, и мне не понятно Ваше несогласие с этим |
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
Цитата:
хотя точно файлы на сервере я вижу и при запросе непосредственно из строки браузера а не флеша я получаю другой ответ |
|
|||||
|
4AM Games
|
если перепишете код в АС2 я в нем разберусь, в ас1 мне влом копатся.
а вопрос по любому не подходит в категорию ActionScript для Профессионалов, я уже сказал для интеграции с сервером есть специальный раздел, но туда попадают только те кто соблюдает правила. форума. так то =)
__________________
Я перестал переписывать, начал редактировать, еще лет 15 и я стану писателем ^_^ |
|
|||||
|
Регистрация: Sep 2005
Сообщений: 28
|
а исходя из чего Вы решили что это код АС1???
|
![]() |
![]() |
Часовой пояс GMT +4, время: 18:20. |
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | |
| Опции просмотра | |
|
|