Right, that will probably be becuase the stage.nativeWindow hasn't yet
initialized you can test this theory by using this code:


var timer:Timer = new Timer(100)
timer.addEventListener(Timer.TIMER, teststage);
timer.start();

function teststage (): void
{
        if (stage.nativeWindow != undefined)
        {
                timer.stop();
                backgroundClip.addEventListener(MouseEvent.MOUSE_DOWN,
doDrag); 
                // any other set up
        }
}

Something alon g those lines

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sidney
de Koning
Sent: 13 December 2007 18:00
To: Flash Coders List
Subject: Re: [Flashcoders] Flex 3 & Air Beta 3

Hi Matthew,

Yes i'm using Flash IDE to publish.
i'm getting a bunch of errors:

1119: Access of possibly undefined property nativeWindow through a
reference with static type flash.display:Stage.

And also i get an error about a ArtemisJSExtension.cpp on line 563 -
importPublishProfile: Argument number 1 is invalid

So i cant trace the output of the event fired.

(i'll prabably replay tomorrow, have to be on my way now, but i'll read
your reply).

Cheers, Sidney

Matthew James Poole wrote:
> Hi Sidney,
>
> Assumiung you are working in Flex the following will work just fine 
> (just tested it myself)
>
> <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication 
> xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" creationComplete="init()">
>       <mx:Script>
>               <![CDATA[
>                       
>                       import flash.events.MouseEvent;
>                       
>                       import flash.display.NativeWindow;
>                       import flash.events.MouseEvent;
>                       
>                       public function init () : void
>                       {
>       
> backgroundClip.addEventListener(MouseEvent.MOUSE_DOWN, doDrag); 
>                       }
>                       
>
>                       public function doDrag(event:MouseEvent):void
>                       {
>                           stage.nativeWindow.startMove();
>                       }
>               ]]>
>       </mx:Script>
>       <mx:VBox height="100%" width="100%" id="backgroundClip"
> color="#ff9900" />
> </mx:WindowedApplication>
>
> If you are working in Flash, I cant help you immediately as I don't 
> have the Flash Air extension installed, but does the event get fired??

> If it does what do you get when you trace(window)??
>
> Cheers
> Matt
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Sidney

> de Koning
> Sent: 09 December 2007 17:29
> To: Flash Coders List
> Subject: Re: [Flashcoders] Flex 3 & Air Beta 3
>
> Hi Mathew,
>
> Currently i'm developing a AIR application and it needs to drag when i

> click with my mouse on the background of the app.
> But that does not work any more. Can you lend assistence? Belwo is the
> code:
>
> import flash.events.MouseEvent;
> import flash.display.MovieClip;
>
> import flash.display.NativeWindow;
> import flash.display.Stage.nativeWindow; import 
> flash.events.MouseEvent;
>
> backgroundClip.addEventListener(MouseEvent.MOUSE_DOWN, doDrag); var 
> window:NativeWindow = stage.nativeWindow;
>
> function doDrag(event:MouseEvent):void {
>     window.startMove();
> }
>
> Is there anything i'm forgetting?
>
> Regards, Sidney
>
>
> Matthew James Poole wrote:
>   
>> Heres a couple of differences I found in the framework since Beta 2:
>>
>> Air - the Shell object is no more it is replaced by the 
>> NativeApplication Singleton Air - the flash.desktop.DragManager is 
>> now
>>     
>
>   
>> mx.managers.DragManager Flex / Air - Clipboard object no longer has 
>> the dataFormats() method now use getData() instead
>>
>> ... That's it so far - I'll post more ifd I find any. Has anyone else

>> found any?
>>
>> Cheers
>> Matt
>>     
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> ______________________________________________________________________
> This e-mail has been scanned for viruses by the Virtual Universe 
> e-mail security system - powered by MessageLabs.
> http://www.virtual-universe.net
>
> ______________________________________________________________________
>
> Virtual Universe Ltd, 28-39 The Quadrant, 135 Salusbury Road, London  
> NW6 6RJ
>
> Tel:      +44 (0) 870 788 6000  
>
> Fax:     +44 (0) 870 788 6689
>
> Web:    www.virtual-universe.net
>
> ----------------------------------------------------------------------
> -------------------
>
> CONFIDENTIALITY NOTICE
>
> This e-mail may contain information which is confidential and
privileged. If you are not the named addressee of this e-mail, you may
not copy or use it, or forward or otherwise disclose it to anyone else.
If you have received this e-mail in error, please e-mail the sender by
replying to this message and then fully delete it from your system. 
>
> Any views or opinions presented in this e-mail are solely those of the
author and do not necessarily represent those of Amplefuture Group.
Amplefuture Group reserves the right to monitor e-mail communications
from both external and internal sources for the purposes of ensuring
correct and appropriate use of our communication equipment.
>
>
>
> ______________________________________________________________________
> This e-mail has been scanned for viruses by the Virtual Universe 
> e-mail security system - powered by MessageLabs. 
> http://www.virtual-universe.net
>
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>   

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

______________________________________________________________________
This e-mail has been scanned for viruses by the Virtual Universe e-mail
security system - powered by MessageLabs.
http://www.virtual-universe.net

______________________________________________________________________

______________________________________________________________________
This e-mail has been scanned for viruses by the Virtual Universe e-mail 
security system - powered by MessageLabs. http://www.virtual-universe.net

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to