Александр К.
3 сообщения
#15 лет назад
Не кто не подскажет где можно взять готовый скрипт для загрузки "одного" файла на сайт с прогресс баром ?
что бы прогресс бар был во флеше, а не на java script

swfupload.googlecode.com не подходит, у него прогресс бар на java script

как я понял загружает файлы только пачками, что тоже не подходит

подскажите может кто сталкивался с подобным вопросом
Константинович С.
658 сообщений
#15 лет назад
ProgressBar: When an application is loading external data or media, it is best to offer the user
feedback on the progress of the loading process, and that is where the ProgressBar component
comes in handy. This component displays a graphical representation of the state of the load,
either in a determinate manner (for example, showing a percentage of the bytes loaded in) or
in an indeterminate manner (for example, showing a looping animation to assure the user that
something is occurring, though it does not represent a percentage of bytes).
Александр К.
3 сообщения
#15 лет назад
Цитата ("sergannd_snz"):
ProgressBar: When an application is loading external data or media, it is best to offer the user
feedback on the progress of the loading process, and that is where the ProgressBar component
comes in handy. This component displays a graphical representation of the state of the load,
either in a determinate manner (for example, showing a percentage of the bytes loaded in) or
in an indeterminate manner (for example, showing a looping animation to assure the user that
something is occurring, though it does not represent a percentage of bytes).

о чем этот пост ? куда информативней дать линк чем copy&paste
Константинович С.
658 сообщений
#15 лет назад
The example code does the following:

The constructor function creates a URLLoader instance named loader and a URLRequest instance named request, which contains the location and name of the file to be loaded.
The loader object is passed to the configureListeners() method, which adds listeners for each of the supported URLLoader events.
The request object is then passed to loader.load(), which loads the text file.
When the URLLoader has finished loading the text file the Event.COMPLETE event fires, triggering the completeHandler() method. The completeHandler() method creates a URLVariables object from the text loaded from the file. The URLVariables object converts URL-encoded name/value pairs into ActionScript properties to make it easier to manipulate the loaded data.

package {
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;

public class URLLoaderExample extends Sprite {
public function URLLoaderExample() {
var loader:URLLoader = new URLLoader();
configureListeners(loader);

var request:URLRequest = new URLRequest("urlLoaderExample.txt";
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.";
}
}

private function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
dispatcher.addEventListener(Event.OPEN, openHandler);
dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}

private function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
trace("completeHandler: " + loader.data);

var vars:URLVariables = new URLVariables(loader.data);
trace("The answer is " + vars.answer);
}

private function openHandler(event:Event):void {
trace("openHandler: " + event);
}

private function progressHandler(event:ProgressEvent):void {
trace("progressHandler loaded:" + event.bytesLoaded + " total: " + event.bytesTotal);
}

private function securityErrorHandler(event:SecurityErrorEvent):void {
trace("securityErrorHandler: " + event);
}

private function httpStatusHandler(event:HTTPStatusEvent):void {
trace("httpStatusHandler: " + event);
}

private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
}
}
}
Константинович С.
658 сообщений
#15 лет назад
Progress Dispatched when data is received as the download operation progresses. URLLoader
Константинович С.
658 сообщений
#15 лет назад
See also

URLLoader.load()
progress event

Event Object Type: flash.events.ProgressEvent
ProgressEvent.type property = flash.events.ProgressEvent.PROGRESS


Language version: ActionScript 3.0
Player version: Flash Player 9


Dispatched when data is received as the download operation progresses.

Note that with a URLLoader object, it is not possible to access the data until it has been received completely. So, the progress event only serves as a notification of how far the download has progressed. To access the data before it's entirely downloaded, use a URLStream object.


Defines the value of the type property of a progress event object.
This event has the following properties:

Property Value
bubbles false
bytesLoaded The number of items or bytes loaded at the time the listener processes the event.
bytesTotal The total number of items or bytes that ultimately will be loaded if the loading process succeeds.
cancelable false; there is no default behavior to cancel.
currentTarget The object that is actively processing the Event object with an event listener.
target The network object reporting progress.
Константинович С.
658 сообщений
#15 лет назад
F1 - справка флэш
Александр К.
3 сообщения
#15 лет назад
sergannd_snz, Уважаемый я просил Free Open Source скрипт,а не SDK for developer улавливаете разницу ?
Константинович С.
658 сообщений
#15 лет назад
Что есть
Вадим П.
182 сообщения
#15 лет назад
Когда мне нужен был такой upload'ер, я взял swf () или с facebook можно (там такой же upload'er)
Устанавливаем в флэшварс значения, к примеру сейчас при загрузки Видео Вконтакт установлены следующие переменные:

var flashvars = {
'upload_url': ';,
'redirect_url': '',
'post_data': escape('swfupload=1&text=blablabla'),
'file_name': 'video_file',
'file_size_limit': 1024*1024*1024, // 1GB
'file_types_description': 'Video files (*.mp4, *.avi, *.3gp, *.mpg, *.mpeg, *.mov, *.flv, *.wmv)',
'file_types': '*.mp4;*.MP4;*.avi;*.AVI;*.3gp;*.3GP;*.mpg;*.MPG;*.mpeg;*.MPEG;*.mov;*.MOV;*.flv;*.FLV;*.wmv;*.WMV',

'onUploadStart': 'onUploadStart',
'onUploadSuccess': 'onUploadSuccess',
'onUploadComplete': 'onUploadComplete',
'onUploadError': 'onUploadError',
'onDebug': 'onDebug',

'lang.button_browse': 'Выбрать файл',
'lang.button_terminate': 'Отмена'
};


и готово