Спасибо - сейчас попробую!
Добавлено через 17 минут
Вы кажысь совсем мой пост не читали или читали невнимательно:
1. мне нужно с картинкой делать манипуляции, посему FileReference.upload не подходит - он аплоадит файл, который на диске.
2. Я не имею возможности создавать 2-ве кнопки. Есть только одна для FileReference.browse - без нее никак, а Аплоад запускаеца средствами JavaScrip - после верификации формы.
Цитата:
Сообщение от zurkis
 Код AS3:
package {
import flash.display.Sprite;
import flash.text.TextField;
import flash.events.*;
import flash.net.*;
import fl.controls.Button;
public class FileUpload extends Sprite {
private var _output:TextField;
private var _fileReference:FileReference;
var browseButton:Button = new Button();
var uploadButton:Button = new Button();
public function FileUpload() {
browseButton.move(10, 30);
browseButton.buttonMode = true;
browseButton.label = "Browse";
browseButton.addEventListener(MouseEvent.CLICK, browseHandler);
addChild(browseButton);
uploadButton.move(120,30);
uploadButton.buttonMode=true;
uploadButton.label ="Upload";
uploadButton.addEventListener(MouseEvent.CLICK, uploadHandler);
uploadButton.visible = false;
addChild(uploadButton);
_output = new TextField();
_output.width = 400;
_output.height = 400;
_output.y = 75;
addChild(_output);
_fileReference = new FileReference();
_fileReference.addEventListener(Event.SELECT, selectHandler);
_fileReference.addEventListener(Event.CANCEL, cancelHandler);
_fileReference.addEventListener(ProgressEvent.PROG RESS,progressHandler);
_fileReference.addEventListener(IOErrorEvent.IO_ER ROR,ioErrorHandler);
_fileReference.addEventListener(SecurityErrorEvent .SECURITY_ERROR,securityHandler);
_fileReference.addEventListener(Event.COMPLETE, completeHandler);
}
private function browseHandler(event:MouseEvent):void {
_fileReference.browse();
}
private function selectHandler(event:Event):void {
_output.text = "Selected File";
_output.appendText("\nName: " + _fileReference.name);
_output.appendText("\nSize: " + _fileReference.size);
_output.appendText("\nCreated On: " + _fileReference.creationDate);
_output.appendText("\nModified On: " +_fileReference.modificationDate);
uploadButton.visible = true;
}
private function cancelHandler(event:Event):void {
_output.text = "Canceled";
}
private function uploadHandler(event:MouseEvent):void {
_fileReference.upload(new URLRequest("simpleFileUpload.php"));
}
private function progressHandler(eventrogressEvent):void {
_output.text = "file uploading\noprogress (bytes): " + event.bytesLoaded + " / " + event.bytesTotal;
}
private function ioErrorHandler(event:IOErrorEvent):void {
_output.text = "an IO error occurred";
}
private function securityHandler(event:SecurityErrorEvent):void {
_output.text = "a security error occurred";
}
private function completeHandler(event:Event):void {
_output.text = "the file has uploaded";
uploadButton.visible = false;
}
}
}
ну и php
 PHP код:
<?php
move_uploaded_file($_FILES['Filedata']['tmp_name'], 'uploads/'.$_FILES['Filedata']['name']);
?>
|
Добавлено через 1 час 16 минут
В общем нашел тут в хелпах:

Код:
В приложении Flash Player 10 и более поздней версии при использовании типа содержимого multipart (например, multipart/form-data), в котором содержится отправка (обозначена параметром filename в заголовке content-disposition в теле оператора POST), к операции POST применяются правила безопасности для отправок:
* Операция POST должна быть выполнена в ответ на действие, инициированное пользователем, такое как щелчок мыши или нажатие клавиши.
* Если операция POST является междоменной (назначением операции POST не является сервер, на котором содержится SWF-файл, отправляющий запрос POST), целевой сервер должен предоставить файл политик URL, в котором разрешен междоменный доступ.
И кагбе вопрос переходит в другой - можно ли программно сгенерировать Клик мышкой или нажатие клавиши на клавиатуре - что бы было соответствующее Событие (Event)?