Issue with FileReference.load() on Mac/Firefox 3.6/FlashPlayer 10.0.45.2
hey there,
after several days of banging head against desk trying figure out application doing wrong, think stumbled across problem either i'm not handling correctly in code or bug in flash player plugin firefox on mac (and on linux).
here specs:
macbook pro snow leopard 10.6.3
firefox 3.6.3 w/ flash plugin 10.0.45.2
safari 4.0.5 w/ flash plugin 10.0.45.2
flashbuilder 4.0 (272416)
flex 3.5 sdk
i can't post code i've been working on it's work project; however, found on adobe's site manifests problem:
http://www.adobe.com/devnet/flash/quickstart/filereference_class_as3/
if open page in firefox 3.6 on mac, may notice crop box doesn't work (or @ least noticed behavior). see crop box fill lower right hand corner.
open same link in safari , works properly.
the following i've noticed in debugging efforts on own application:
- after completing filereference.load call, flash application appears lose focus (perhaps operating system?)
- moving cursor (both in case , think in example on site) results in getting undefined (and astronomical) values when poll mouse cursor's position.
- clicking outside of firefox , clicking in seems resolve this. seems leaving window , returning solves problem.
to provide example of behavior, i've altered code similar function example on adobe's site produce statistics mouse cursor is:
the code example:
my code (my changes bolded):
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the- filereference-class-in-flash-player-10/ -->
<s:application name="filereference_load_test"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:net="flash.net.*" xmlns:mx1="library://ns.adobe.com/flex/mx"
creationcomplete="init()">
<fx:script>
<![cdata[
import mx.controls.alert;
import mx.utils.objectutil;
[bindable]
private var appx:number;
[bindable]
private var appy:number;
private function init():void {
addeventlistener(mouseevent.mouse_move, handlemove);
}
private function handlemove(event:mouseevent):void {
appx = event.localx;
appy = event.localy;
}
private function btn_click(evt:mouseevent):void {
var arr:array = [];
arr.push(new filefilter("images", ".gif;*.jpeg;*.jpg;*.png"));
filereference.browse(arr);
}
private function filereference_select(evt:event):void {
filereference.load();
}
private function filereference_complete(evt:event):void {
img.source = filereference.data;
alert.show(objectutil.tostring(filereference));
}
]]>
</fx:script>
<fx:declarations>
<net:filereference id="filereference"
select="filereference_select(event);"
complete="filereference_complete(event);" />
</fx:declarations>
<s:panel id="panel"
horizontalcenter="0"
verticalcenter="0"
width="500">
<s:layout>
<s:verticallayout />
</s:layout>
<mx1:image id="img"
verticalcenter="0"
horizontalcenter="0"
maxwidth="200"
maxheight="200" />
<mx1:controlbar>
<s:button id="btn"
label="browse , preview..."
click="btn_click(event);" />
<s:button label="upload..."
enabled="false" />
<s:label text="mousex:" />
<mx1:text text="{appx}" />
<s:label text="mousey:" />
<mx1:text text="{appy}" />
</mx1:controlbar>
</s:panel>
</s:application>
if compile , run application in firefox, should see x , y values mouse stop updating after file loaded. on safari continue update.
i couldn't find reference problem searching on google (perhaps not right keywords?).
anyone have input on issue? appreciated
hi,
this isn't answer refuse have firefox on system maybe see if following fails under firefox, uses filereference populate list images. app works on safari, ie , chrome.
http://gumbo.flashhub.net/pagedrop/ - source code included
david.
More discussions in Flex (Read Only)
adobe
Comments
Post a Comment