[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
Well, I just tried that and the event still doesn't fire. Here is my
complete application...

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute creationComplete=init()
mx:Script
![CDATA[
import flexmdi.events.MDIManagerEvent;
import flexmdi.managers.MDIManager;
import flexmdi.containers.MDIWindow;

private function init():void
{
var win1:MDIWindow = new MDIWindow();
win1.width = win1.height = 300;
win1.title = Window One;

MDIManager.global.add(win1);


MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
windowEventHandler);
}

private function windowEventHandler(event:Event):void
{
if(event is MDIManagerEvent)
{
trace(event.type);
}
}
]]
/mx:Script
mx:Button label=Get Ver click=trace('The button was clicked');/
/mx:Application

I added the button control as a sanity check.

When I ran it, I clicked the button, moved the window, clicked the
button, moved the window,... You get the idea. The output of the trace
was...

The button was clicked
The button was clicked
The button was clicked
The button was clicked
The button was clicked

I don't really see what I can be doing wrong.

BTW. I am using Flex 3 beta 2 but just noticed beta 3 is out which I
am downloading now. Could that have anything to do with it?

Thanks for any and all help with this.


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Hi Steve,
 
 I think something else must be interfering with your code. If you
 paste the following code (pretty identical to yours) into a Script
 block in a new Flex project you should see windowDragEnd traced out
 to the console. (init() is called in creationComplete)
 
 import flexmdi.events.MDIManagerEvent;
 import flexmdi.managers.MDIManager;
 import flexmdi.containers.MDIWindow;
  
 private function init():void
 {
   var win1:MDIWindow = new MDIWindow();
   win1.width = win1.height = 300;
   win1.title = Window One;
   
   MDIManager.global.add(win1);
   
   MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
 windowEventHandler);
 }
 
 private function windowEventHandler(event:Event):void
 {
   if(event is MDIManagerEvent)
   {
   trace(event.type);
   }
 }
 
 
 HTH,
 Ben
 
 
 --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote:
 
  I am using FlexMDI and would like to know when a window has been
  dragged to a new position so I can save the position.
  
  I am adding windows on the fly with...
  
  var newWindow:MDIWindow = new MDIWindow();
  MDIManager.global.add(newWindow);
  
  I have tried...
  
  newWindow.addEventListener(MDIWindowEvent.DRAG_END,
  this.windowDragEndEventHandler);
  MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
  this.windowDragEndEventHandler);
  
  but these do not fire.
  
  Anybody have any ideas?
  
  If this is not the right forum for these questions, please let me know
  where to post this. I have checked and cannot find a forum directly
  related to FlexMDI.
 





[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread ben.clinkinbeard
Hmmm, thats pretty odd. I don't have Beta 2 available to test with but
that shouldn't be causing any issues because the code was written
against Flex 2. Are you able to capture other events from MDIManager?
What about events directly from the window?

Ben



[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
Well, I have just installed Flex 3 beta 3 and tried it again. This is
the code:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute creationComplete=init()
mx:Script
![CDATA[
import flexmdi.events.MDIManagerEvent;
import flexmdi.events.MDIWindowEvent;
import flexmdi.managers.MDIManager;
import flexmdi.containers.MDIWindow;

private function init():void
{
var win1:MDIWindow = new MDIWindow();
win1.width = win1.height = 300;
win1.title = Window One;
var win2:MDIWindow = new MDIWindow();
win2.width = win2.height = 300;
win2.title = Window Two;

MDIManager.global.add(win1);
MDIManager.global.add(win2);


MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_ADD,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_MINIMIZE,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_RESTORE,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_MAXIMIZE,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_CLOSE,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_START,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_END,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_START,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_RESIZE_START,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_RESIZE,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_RESIZE_END,
windowEventHandler);

win1.addEventListener(MDIWindowEvent.RESIZE, 
windowEventHandler);

win1.addEventListener(MDIWindowEvent.FOCUS_START, windowEventHandler);
win1.addEventListener(MDIWindowEvent.FOCUS_END, 
windowEventHandler);

win1.addEventListener(MDIWindowEvent.MINIMIZE,windowEventHandler);

win1.addEventListener(MDIWindowEvent.RESTORE,windowEventHandler);

win1.addEventListener(MDIWindowEvent.MAXIMIZE,windowEventHandler);

win1.addEventListener(MDIWindowEvent.CLOSE,windowEventHandler);

win1.addEventListener(MDIWindowEvent.RESIZE_END,windowEventHandler);

win1.addEventListener(MDIWindowEvent.RESIZE_START,windowEventHandler);
}

private function windowEventHandler(event:Event):void
{
if(event is MDIManagerEvent)
{
trace(MDIManagerEvent:  + event.type);
}
if(event is MDIWindowEvent)
{
trace(MDIWindowEvent:  + event.type);
}
}
]]
/mx:Script
mx:Button label=Get Ver click=trace('The button was clicked');/
/mx:Application

After licking on each window, moving them around a resizining,
minimizing maximizing and closing them, this is what I got...

MDIWindowEvent: resizeStart
MDIManagerEvent: windowResizeStart
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize
MDIManagerEvent: windowResize
MDIWindowEvent: resize

[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
Further testing...This time I tried it in IE6 (Have been using Firefox
2.0.0.11). This gives the following (Abbreviated):

MDIManagerEvent: windowDragStart
MDIManagerEvent: windowDrag
MDIManagerEvent: windowDragEnd
MDIManagerEvent: windowDragStart
MDIManagerEvent: windowDrag
MDIManagerEvent: windowDragEnd
MDIManagerEvent: windowDragStart
MDIManagerEvent: windowDrag
MDIManagerEvent: windowDragEnd
MDIWindowEvent: maximize
MDIManagerEvent: windowMaximize
MDIWindowEvent: restore
MDIManagerEvent: windowRestore
MDIWindowEvent: close
MDIManagerEvent: windowClose

Note that there are no MDIWindow drag events generated but MDIManager
drag events are. Also, there are no focus events.

As a newb, I don't really understand why there would be a difference
between Firefox and IE. Don't they use the same Flash Player?

Anyway, I hope this helps to narrow down where the problem is.




[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread ben.clinkinbeard
What happens if you use the code found here?
http://www.returnundefined.com/flexmdi/explorer/srcview/index.html

Ben



--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 Further testing...This time I tried it in IE6 (Have been using Firefox
 2.0.0.11). This gives the following (Abbreviated):
 
 MDIManagerEvent: windowDragStart
 MDIManagerEvent: windowDrag
 MDIManagerEvent: windowDragEnd
 MDIManagerEvent: windowDragStart
 MDIManagerEvent: windowDrag
 MDIManagerEvent: windowDragEnd
 MDIManagerEvent: windowDragStart
 MDIManagerEvent: windowDrag
 MDIManagerEvent: windowDragEnd
 MDIWindowEvent: maximize
 MDIManagerEvent: windowMaximize
 MDIWindowEvent: restore
 MDIManagerEvent: windowRestore
 MDIWindowEvent: close
 MDIManagerEvent: windowClose
 
 Note that there are no MDIWindow drag events generated but MDIManager
 drag events are. Also, there are no focus events.
 
 As a newb, I don't really understand why there would be a difference
 between Firefox and IE. Don't they use the same Flash Player?
 
 Anyway, I hope this helps to narrow down where the problem is.





[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread ben.clinkinbeard
Just noticed that your code doesn't define any drag listeners on the
window, so thats why you're not seeing those. I would also check to
see what version of the player you have in each browser.

Ben



[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
OK, my bad on the window drag listeners.

I just added them all in and tried on IE6. This gives me both
MDIWindow Drag Events and MDIManager Drag Events.

I then tried again on Firefox and everything worked. Huh??

Let me do some more testing.



--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Just noticed that your code doesn't define any drag listeners on the
 window, so thats why you're not seeing those. I would also check to
 see what version of the player you have in each browser.
 
 Ben





[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
If I use that code then I get the drag events but that uses
mdiCanvas.windowManager. I don't want to use a canvas; I would much
rather use the global functions.

My application has a docked ApplicationControlBar and I want my
flexMDI windows to be able to float on top of this bar. The only way I
see to do that is with the global manager.


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 What happens if you use the code found here?
 http://www.returnundefined.com/flexmdi/explorer/srcview/index.html
 
 Ben




[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
Well, color me totally confused. I have no idea what I did but now it
works (Although I still do not see any focus events; But I don't need
those right now).

Here is the pared down code which works...

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute creationComplete=init()
mx:Script
![CDATA[
import flexmdi.events.MDIManagerEvent;
import flexmdi.managers.MDIManager;
import flexmdi.containers.MDIWindow;

private function init():void
{
var win1:MDIWindow = new MDIWindow();
win1.width = win1.height = 300;
win1.title = Window One;
var win2:MDIWindow = new MDIWindow();
win2.width = win2.height = 300;
win2.title = Window Two;

MDIManager.global.add(win1);
MDIManager.global.add(win2);


MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_START,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_END,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_START,
windowEventHandler);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
windowEventHandler);
}

private function windowEventHandler(event:Event):void
{
if(event is MDIManagerEvent)
{
var mgrEvent:MDIManagerEvent = event as 
MDIManagerEvent;
trace(mgrEvent.window.title +  
MDIManagerEvent:  + event.type);
}
}
]]
/mx:Script
/mx:Application


If I move both of the windows, this is what is output...

Window Two MDIManagerEvent: windowDragStart
Window Two MDIManagerEvent: windowDragEnd
Window One MDIManagerEvent: windowDragStart
Window One MDIManagerEvent: windowDragEnd





[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread ben.clinkinbeard
Strange indeed :) I know the code I pointed you to used a canvas, I
just wanted to see if that made a difference. Maybe try converting
that file to use the global instance and see if that works?

Ben


--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 Well, color me totally confused. I have no idea what I did but now it
 works (Although I still do not see any focus events; But I don't need
 those right now).
 
 Here is the pared down code which works...
 
 ?xml version=1.0 encoding=utf-8?
 mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
 layout=absolute creationComplete=init()
   mx:Script
   ![CDATA[
   import flexmdi.events.MDIManagerEvent;
   import flexmdi.managers.MDIManager;
   import flexmdi.containers.MDIWindow;
   
   private function init():void
   {
   var win1:MDIWindow = new MDIWindow();
   win1.width = win1.height = 300;
   win1.title = Window One;
   var win2:MDIWindow = new MDIWindow();
   win2.width = win2.height = 300;
   win2.title = Window Two;
   
   MDIManager.global.add(win1);
   MDIManager.global.add(win2);
   
   
 MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_START,
 windowEventHandler);
   
 MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_FOCUS_END,
 windowEventHandler);
   
 MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_START,
 windowEventHandler);
   
 MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
 windowEventHandler);
   }
   
   private function windowEventHandler(event:Event):void
   {
   if(event is MDIManagerEvent)
   {
   var mgrEvent:MDIManagerEvent = event as 
 MDIManagerEvent;
   trace(mgrEvent.window.title +  
 MDIManagerEvent:  + event.type);
   }
   }
   ]]
   /mx:Script
 /mx:Application
 
 
 If I move both of the windows, this is what is output...
 
 Window Two MDIManagerEvent: windowDragStart
 Window Two MDIManagerEvent: windowDragEnd
 Window One MDIManagerEvent: windowDragStart
 Window One MDIManagerEvent: windowDragEnd





[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-20 Thread valdhor
Maybe I will give that a try.

I have been thinking about why it suddenly worked. When you asked what
version of Flash Player I was running, I went to
http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507 to
find out. The page came up quite quick but the movie took about 15
seconds. I am just wondering whether my flash player had been cached
and going to the adobe page above caused it to completely reload the
latest Flash Player I had just installed?

Other than that, I am stumped.


--- In flexcoders@yahoogroups.com, ben.clinkinbeard
[EMAIL PROTECTED] wrote:

 Strange indeed :) I know the code I pointed you to used a canvas, I
 just wanted to see if that made a difference. Maybe try converting
 that file to use the global instance and see if that works?




[flexcoders] Re: FlexMDI How to get DRAG_END event to fire

2007-12-19 Thread ben.clinkinbeard
Hi Steve,

I think something else must be interfering with your code. If you
paste the following code (pretty identical to yours) into a Script
block in a new Flex project you should see windowDragEnd traced out
to the console. (init() is called in creationComplete)

import flexmdi.events.MDIManagerEvent;
import flexmdi.managers.MDIManager;
import flexmdi.containers.MDIWindow;
 
private function init():void
{
var win1:MDIWindow = new MDIWindow();
win1.width = win1.height = 300;
win1.title = Window One;

MDIManager.global.add(win1);

MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
windowEventHandler);
}

private function windowEventHandler(event:Event):void
{
if(event is MDIManagerEvent)
{
trace(event.type);
}
}


HTH,
Ben


--- In flexcoders@yahoogroups.com, valdhor [EMAIL PROTECTED] wrote:

 I am using FlexMDI and would like to know when a window has been
 dragged to a new position so I can save the position.
 
 I am adding windows on the fly with...
 
 var newWindow:MDIWindow = new MDIWindow();
 MDIManager.global.add(newWindow);
 
 I have tried...
 
 newWindow.addEventListener(MDIWindowEvent.DRAG_END,
 this.windowDragEndEventHandler);
 MDIManager.global.addEventListener(MDIManagerEvent.WINDOW_DRAG_END,
 this.windowDragEndEventHandler);
 
 but these do not fire.
 
 Anybody have any ideas?
 
 If this is not the right forum for these questions, please let me know
 where to post this. I have checked and cannot find a forum directly
 related to FlexMDI.