bom depois de muito custo conseguir resolver alguns problemas
mas agora nao tem erro no as mas ele nao esta indo para taskbar
function setSystrayIcon():void { var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.CONNECT, prepareForSystray);
loader.load(new URLRequest("16.png"));} /*** Check to see if the application
may be docked and set basic properties*/function
prepareForSystray(event:Event):void { dockImage =
event.target.content.bitmapData; if
(NativeApplication.supportsSystemTrayIcon){ setSystemTrayProperties();
SystemTrayIcon(NativeApplication.nativeApplication .icon).menu =
createSystrayRootMenu(); }} /*** Create a menu that can be accessed from the
systray*/function createSystrayRootMenu():NativeMenu { var menu:NativeMenu =
new NativeMenu(); var openNativeMenuItem:NativeMenuItem = new
NativeMenuItem("Restaurar"); var exitNativeMenuItem:NativeMenuItem = new
NativeMenuItem("Fechar"); openNativeMenuItem.addEventListener(Event.SELECT,
undock); exitNativeMenuItem.addEventListener(Event.SELECT, closeButton_CLICK);
menu.addItem(openNativeMenuItem); menu.addItem(new NativeMenuItem("",true));
menu.addItem(exitNativeMenuItem); return menu;} /*** To be able to dock and
undock we need to set some eventlisteners*/function
setSystemTrayProperties():void{
SystemTrayIcon(NativeApplication.nativeApplication.icon).tooltip = "O programa
está minizado, clique para restaurar";
SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK,
undock); //ponto.buttonMode = true;// activa o mover
//ponto.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
nwMinimized);
stage.nativeWindow.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
nwMinimized); //Catch the minimize event } /*** Do our own 'minimize' by
docking the application to the systray (showing the application icon in the
systray)*/function closeButton_CLICK(e:MouseEvent):void {
NativeApplication.nativeApplication.exit(); }function dock():void {
stage.nativeWindow.visible = false;
NativeApplication.nativeApplication.icon.bitmaps = [dockImage];} /*** Show the
application again and remove the application icon from the systray*/function
undock(evt:Event):void { stage.nativeWindow.visible = true;
stage.nativeWindow.orderToFront();
NativeApplication.nativeApplication.icon.bitmaps = [];} function
nwMinimized(displayStateEvent:NativeWindowDisplayStateEvent):void { //Do
we have an minimize action? //The afterDisplayState hasn't happened
yet, but only describes the state the window will go to, //so we can
prevent it! if(displayStateEvent.afterDisplayState ==
NativeWindowDisplayState.MINIMIZED) { //Prevent the windowedapplication
minimize action from happening and implement our own minimize //The
reason the windowedapplication minimize action is caught, is that if active
we're not able to //undock the application back neatly. The
application doesn't become visible directly, but only after clicking
//on the taskbars application link. (Not sure yet what happens exactly with
standard minimize) displayStateEvent.preventDefault(); //Dock
(our own minimize) dock(); } }Ate mais,Michel Melomsn: [EMAIL
PROTECTED]://michelmelo.wordpress.com/Esta mensagem, incluindo seus anexos, tem
caráter confidencial e seu conteúdo é restrito ao destinatário da mensagem.
Caso você tenha recebido esta mensagem por engano, queira por favor retorná-la
ao destinatário e apagá-la de seus arquivos.Qualquer uso não autorizado,
replicação ou disseminação desta mensagem ou parte dela é expressamente
proibido.
> Date: Wed, 8 Oct 2008 14:21:53 +0100> From: [EMAIL PROTECTED]> To:
> [email protected]> Subject: [riapt] Re: Taskbar icons flash air> > >
> michel melo wrote:> > Olá pessoal,> > estou a procurar de materiais sobre o
> taskbar para poder trabalhar no > > flash air> > alguem pode me ajudar?> >> >
> /*Ate mais,> > */> > */_Michel Melo> > msn: _/**/[EMAIL PROTECTED]> >
> http://michelmelo.wordpress.com/_/* <mailto:[EMAIL PROTECTED]>> >> > *Esta
> mensagem, incluindo seus anexos, tem caráter confidencial e seu > > conteúdo
> é restrito ao destinatário da mensagem.> > Caso você tenha recebido esta
> mensagem por engano, queira por favor > > retorná-la ao destinatário e
> apagá-la de seus arquivos.> > Qualquer uso não autorizado, replicação ou
> disseminação desta mensagem > > ou parte dela é expressamente proibido.*> >>
> >> >
> ------------------------------------------------------------------------> >
> Obtenha o novo Windows Live Messenger! Experimente! > >
> <http://get.live.com/messenger/overview>> > >> Mas o que precisas? mandar um
> icon para lá? criar um NativeMenuItem?> posso te mostrar o que fiz deverá
> ajudar (vi isto num site qq)...> > ////// Systray> private var
> dockImage:BitmapData;> > public function setSystrayIcon():void {> var
> loader:Loader = new Loader();>
> loader.contentLoaderInfo.addEventListener(Event.COMPLETE, >
> prepareForSystray);> loader.load(new URLRequest("assets/icons/logo16.png"));>
> }> > /**> * Check to see if the application may be docked and set basic
> properties> */> public function prepareForSystray(event:Event):void {>
> dockImage = event.target.content.bitmapData;> > if
> (NativeApplication.supportsSystemTrayIcon){> setSystemTrayProperties();>
> SystemTrayIcon(NativeApplication.nativeApplication .icon).menu = >
> createSystrayRootMenu();> }> }> > /**> * Create a menu that can be accessed
> from the systray> */> private function createSystrayRootMenu():NativeMenu {>
> var menu:NativeMenu = new NativeMenu();> var
> openNativeMenuItem:NativeMenuItem = new > NativeMenuItem("Restaurar");> var
> exitNativeMenuItem:NativeMenuItem = new NativeMenuItem("Fechar");> >
> openNativeMenuItem.addEventListener(Event.SELECT, undock);> >
> exitNativeMenuItem.addEventListener(Event.SELECT, closeApp);> >
> menu.addItem(openNativeMenuItem);> menu.addItem(new
> NativeMenuItem("",true));> menu.addItem(exitNativeMenuItem);> > return menu;>
> }> > /**> * To be able to dock and undock we need to set some eventlisteners>
> */> private function setSystemTrayProperties():void{ >
> SystemTrayIcon(NativeApplication.nativeApplication.icon).tooltip = > "O
> programa está minizado, clique para restaurar";> >
> SystemTrayIcon(NativeApplication.nativeApplication.icon).addEventListener(MouseEvent.CLICK,
> > undock);> >
> //stage.nativeWindow.addEventListener(NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING,
> > nwMinimized);> }> > /**> * Do our own 'minimize' by docking the
> application to the systray > (showing the application icon in the systray)>
> */> public function dock():void {> stage.nativeWindow.visible = false;>
> NativeApplication.nativeApplication.icon.bitmaps = [dockImage];> }> > /**> *
> Show the application again and remove the application icon from the >
> systray> */> public function undock(evt:Event):void {>
> stage.nativeWindow.visible = true;> stage.nativeWindow.orderToFront();>
> NativeApplication.nativeApplication.icon.bitmaps = [];> }> > E assim ja te
> safas :)> > >
> _________________________________________________________________
Obtenha o novo Windows Live Messenger!
http://get.live.com/messenger/overview
--~--~---------~--~----~------------~-------~--~----~
Recebeu esta mensagem porque está inscrito em Grupo "Mailing List da Comunidade
Portuguesa de Desenvolvimento de RIAs - www.riapt.org" do Grupos Google.
Para enviar mensagens para este grupo, envie um email para
[email protected]
Para anular a inscrição neste grupo, envie um email para [EMAIL PROTECTED]
Para mais opções, visite este grupo em
http://groups.google.com/group/riapt?hl=pt-PT
-~----------~----~----~----~------~----~------~--~---