Very interesting idea, could come in handy someday, thanks for sharing this :-)

Jeremy.



On 8/12/06, Sergey Kovalyov <[EMAIL PROTECTED]> wrote:

Sorry, but previous sample was incorrect. Below you could find the correct one:



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle"
creationComplete="onCreationComplete()">

<mx:Script>
<![CDATA[

import mx.controls.Image;

public static const IMAGE_SOURCE : String =


[Bindable]
private var imageContextMenu : ContextMenu;

private function onCreationComplete() : void {
var item : ContextMenuItem = new ContextMenuItem("Save Image As...");
item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,
onSaveAsContextMenuItemSelect);
imageContextMenu = new ContextMenu();
imageContextMenu.customItems.push(item);
}

private function onSaveAsContextMenuItemSelect(event :
ContextMenuEvent) : void {
var image : Image = Image(event.contextMenuOwner);
var downloadURL : URLRequest = new URLRequest();
downloadURL.url = "">

var fileReference : FileReference = new FileReference();
fileReference.download(downloadURL);
}

]]>
</mx:Script>

<mx:Image source="{IMAGE_SOURCE}" contextMenu="{imageContextMenu}" />

</mx:Application>

On 8/11/06, Sergey Kovalyov <[EMAIL PROTECTED]> wrote:
> Hi All!
>
> Probably, somebody already implemented this, but still it could be
> interested. I have just created an example of application that
> demonstrates how to implement "Save Image As..." functionality native
> for browsers but not available in Flash applications usually.
>
> Sure, it's only to show the concept, so "hardcoded". I want to create
> component inherited from mx.controls.Image later. Any ideas and
> suggestions are welcome! :)
>
> Regards, Sergey.


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to