Re: [Flashcoders] fileReference failing silently

2010-08-09 Thread Juan Pablo Califano
The issue here is quite likely the garbage collector doing its job...

You FileRefence object is referenced only in a local variable in
the deskClickHandler method. After the method returns, since there's no
other reference to it, it's eligible for collection. So it might stick
around or not. In your case, it seems it doesn't. Try storing the fileref in
an instance variable instead. It should fix it, I think.

Cheers
Juan Pablo Califano

2010/8/9 Matt S. 

> I'm trying to use fileReference to allow users to download images, but
> it keeps failing, without errors, and without even seeming to start
> the download. What makes it weird is that it does open the finder
> window and prompts me to save the select a download location etc, but
> then when I click save...nothing. No errors, no files, just nothing.
> Here is the code I'm currently using (with puppy photo substituted for
> actual content). This is failing both locally and when uploaded to the
> server. Any suggestions much appreciated, I've been googling but
> havent found a solution.
>
> tia,
>
> Matt
>
>
> //CODE
>
>
> private function deskClickHandler(e:MouseEvent):void{
>
>var downloadURL:URLRequest;
>   var fileName:String = "SomeFile.pdf";
>var file:FileReference;
>
>downloadURL = new URLRequest();
>downloadURL.url =
> "http://mystuffspace.com/graphic/adorable-puppies.jpg";;
>file = new FileReference();
>file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
>file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
>file.addEventListener(Event.COMPLETE, completeHandler);
>file.download(downloadURL, fileName);
> }
>
> private function progressHandler(event:ProgressEvent):void {
>var file:FileReference = FileReference(event.target);
>trace("progressHandler: name=" + file.name + " bytesLoaded=" +
> event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
> }
>
> private function ioErrorHandler(event:IOErrorEvent):void {
>trace("ioErrorHandler: " + event);
> }
>
> private function completeHandler(event:Event):void {
>trace("completeHandler: " + event);
> }
> ___
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] fileReference failing silently

2010-08-09 Thread Matt S.
I'm trying to use fileReference to allow users to download images, but
it keeps failing, without errors, and without even seeming to start
the download. What makes it weird is that it does open the finder
window and prompts me to save the select a download location etc, but
then when I click save...nothing. No errors, no files, just nothing.
Here is the code I'm currently using (with puppy photo substituted for
actual content). This is failing both locally and when uploaded to the
server. Any suggestions much appreciated, I've been googling but
havent found a solution.

tia,

Matt


//CODE


private function deskClickHandler(e:MouseEvent):void{

var downloadURL:URLRequest;
   var fileName:String = "SomeFile.pdf";
var file:FileReference;

downloadURL = new URLRequest();
downloadURL.url =
"http://mystuffspace.com/graphic/adorable-puppies.jpg";;
file = new FileReference();
file.addEventListener(ProgressEvent.PROGRESS, progressHandler);
file.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
file.addEventListener(Event.COMPLETE, completeHandler);
file.download(downloadURL, fileName);
}

private function progressHandler(event:ProgressEvent):void {
var file:FileReference = FileReference(event.target);
trace("progressHandler: name=" + file.name + " bytesLoaded=" +
event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
}

private function ioErrorHandler(event:IOErrorEvent):void {
trace("ioErrorHandler: " + event);
}

private function completeHandler(event:Event):void {
trace("completeHandler: " + event);
}
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


[Flashcoders] facebook share | swfaddress

2010-08-09 Thread michael schoenfelder
Hey,

I've got a multi-page flash site that uses swfaddress to create urls. I'd
like to use facebook's "share" button on each page individually and have it
generate a unique preview for each page, but facebook seems to pull info
from the html wrapper's , which is the same for each page. Tried using
ExternalInterface.call( ) and js to rewrite the  for each new page,
but haven't had any luck.

Does anyone have any insight or resources for working around this issue?

... michael
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders