неполадки с FileReference.browse
При выборе картинки, название файла не отображается на ярлыке. Отображается только при повторном нажатии на кнопку "Обзор" (при повторном выборе) - имя файла, выбранного в первый раз. Что я делаю неправильно?
Код:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
Код AS3:
import org.osmf.utils.URL;
public var imageTypes:FileFilter=new FileFilter("Images (*.jpg,*.jpeg,*.gif,*.png)", "*.jpg;*.jpeg;*.gif;*.png");
public var fileRef:FileReference=new FileReference();
public var nomen:String;
public function Browse():void{
fileRef.browse(imageTypes);
nomen=fileRef.name;
}
public function Rer():void{
Browse();
opis.text=nomen;
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Panel x="287" y="198" width="326" height="231" title="Ваше имя:">
<s:Label x="10" y="20" text="Имя:" width="46"/>
<s:Label x="10" y="50" text="Фамилия:" width="72"/>
<s:Label x="10" y="80" text="Ученая степень:" width="99"/>
<s:Label x="10" y="140" text="Фото:" width="99"/>
<s:Label x="10" y="110" text="Обращение:" width="99"/>
<s:TextInput x="137" y="10"/>
<s:TextInput x="137" y="40"/>
<s:ComboBox x="135" y="70" enabled="true" id="comb1"/>
<s:ComboBox x="135" y="100" enabled="true" id="comb0"/>
<s:ToggleButton x="135" y="140" label="Обзор..." enabled="true" click="Rer();"/>
<s:Label x="213" y="140" width="101" height="21" id="opis"/>
</s:Panel>
</s:Application>
|