Two quick AIR(AJAX) questions.

I've been working on developing an AIR interface for a web
app that I've also been developing. It is necessary for my AIR app
to minimize to the system tray (on Windows) so it's out of the way.
I already have that functionality in place, however, I am
having trouble finding a solution to capture the windows chrome
minimize event, suppress it, and run my own minimize function.
I am also wanting a single (or double, doesn't matter) click
on the tray icon to restore the window. Again, I have the
functionality in place, but am having trouble capturing the click
event on the tray icon.
I'm sure I'm just missing something about how AIR uses
events, so if y'all would be so kind as to point me in the correct
direction, I would appreciate it! Thanks!
-Beau

For the window minimize event:
window.nativeWindow.addEventListener(air.NativeWindow.MINIMIZING,
yourMinimizeFunction);
function yourMinimizeFunction(event){
event.preventDefault();
For the Icon click:
if(air.NativeApplication.supportsSystemTrayIcon){
air.NativeApplication.nativeApplication.icon.addEventListener("click",
clickHandler);
} else if(air.NativeApplication.supportsDockIcon){
air.NativeApplication.nativeApplication.addEventListener("invoke",
clickHandler);
Note that the events aren't symmetrical between Windows and
Mac. Windows gives you mouse events, the Mac gives you an invoke
event. Also, this code has not been checked, there may be typos,
etc.

Similar Messages

  • Simple AIR ajax question? One html file or many?

    I am a new ajax air developer and was wondering if it's a better practice to use one html file in my app or many html files? So far I have been testing with many html files using javascript location.href to send the user to another html page when they click different navigation buttons. This works although there is a clear webpage "loading" feel to the app due to a temporary white screen displaying over the app as it loads the next page (maybe for a couple milliseconds). Not a huge deal but still feels somewhat unprofessional since regular desktop apps do not have this "flicker" occur when changing navigation. Now if I use a single html file (where I load html using javascript) this does not occur but the file feels very large and bloated. Anyone have any suggestions of how I can eliminate the flicker that occurs using many files (perhaps I am not loading the file the correct way into the native window) or am I stuck with a single file if I want there to be no flicker?

    I'll say become a Flex/AIR developer

  • Two quick VLAN routing questions

    lets say I have a L3 switch routing 4 VLANs
    VLAN 1 is 192.168.10.0/24, the switch's virtual interface is 192.168.10.254 inside this vlan
    VLAN 2 is 192.168.20.0/24, the switch's virtual interface is 192.168.20.254 inside this vlan
    VLAN 3 is 192.168.30.0/24, the switch's virtual interface is 192.168.30.254 inside this vlan
    VLAN 4 is 192.168.40.0/24, the switch's virtual interface is 192.168.40.254 inside this vlan
    there is only one router going out from this switch to the net, and lets say it is in VLAN 1 and it's address is 192.168.10.1
    first question-- inside of the L3 switch I will need to add a default route of 0.0.0.0 0.0.0.0 192.168.10.1
    so that all traffic not corresponding to a 192.168.x.x address knows where to get out to the net, correct?
    secondly- when configuring that router, is there a difference if I use the following static route:
    192.168.20.0 255.255.255.0 192.168.10.254
    instead of
    192.168.20.0 255.255.255.0 192.168.20.254
    either way, the packet gets to the L3 switch, but in one case it gets there via the VLAN interface inside of VLAN 1, and in the other case, it gets there via the VLAN interface inside of the VLAN for which the traffic is destined anyway. what im trying to figure out is, will this make any difference at all? especially in terms of broadcast packets?
    if it makes no difference, then is it safe to say that the following static route would be optimal?
    192.168.0.0 255.255.0.0 192.168.10.254
    Solved!
    Go to Solution.

    Re "firstly". Correct. The L3 switch will route traffic according to its routing table. By default it knows all IP subnets to which it is directly connected to, i.e. all the VLAN subnets. If you have to add a default route manually or not depends on the exact implementation. It may well be that the L3 switch will use the any default gateway for routing which you use for the IP settings of the switch itself (if there is an option in the web interface to set a default gateway). If you cannot define a default gateway on the L3 switch you probably have to add a static route manually. The easiest way should be to check the current routing table and see if there is a default gateway or not.
    Re "secondly". A router can only forward packets to the next hop router. The next hop router must be connected to that router. The route "192.168.20.0 255.255.255.0 192.168.10.254" is correct for a router with IP address 192.168.10.1 and subnet mask 255.255.255.0 as 192.168.10.254 is connected to the router. "192.168.20.0 255.255.255.0 192.168.20.254" is not correct. The router cannot learn the path to a specific subnet 192.168.20.0/255.255.255.0 by using a gateway in that subnet. It is not correct to use that kind of a route and you should not use it even if it might even work (because the router does a plain ARP request to find the MAC address of 192.168.20.254 and your L3 switch will respond to the ARP request even if it is on the internet of 192.168.10.254). The very moment when there would be another router between the 10 and 20 subnets it would not work anymore...
    Re your conclusion: I would recommend to keep four static routes for the existing subnets on the L3 switch instead of putting everything into a larger single subnet which includes a lot of addresses which are not connected there. Technically it works if you only use working IP addresses. But you will see some loops if you send something to 192.168.55.50 or similar. The gateway router will send it to the L3 switch which will send it back to the gateway. They should figure it's a loop but still I would not recommend this kind of setup... Add routes for each of the L3 switch subnet...

  • Two quick email issue questions

    Hello:
    I am a novice when it comes to WiFi's and have a question which deals with it. I am able to send emails from my iPhone when using the Edge service, but when I am using my WiFi connection at home, I am not able to. Nothing happens at all. I can receive emails with no problem.
    Also, occasionally when I receive a picture in an email (ie. taken from my wife's iPhone) I can view the picture a few times, but later I will get the message "message not downloaded from server" (or something like that). Why can I not always view the image? Sometimes I can never view them.
    Thanks very much for the help,
    Scott

    Hey Jolly_mon,
    Most POP accounts provided by Internet Service Providers will only let you send emails when you are connecting to the Internet using their network connection. So, many people use the AT&T EDGE outgoing mail server cwmx.com. This server can only send when connecting to the Internet over the EDGE network.
    Are you using the cwmx.com outgoing mail server? Goto Settings> Mail> tap the account.
    This article provides general tips for send mail issues.
    http://support.apple.com/kb/HT1330
    As for the pictures disappearing from the emails, it sounds like you may have another email client checking the pop server and causing some type of conflict. It could be locking the POP account or removing the attachments from the emails.
    This article provides more information about POP email accounts http://docs.info.apple.com/article.html?path=Mail/2.0/en/ml943.html
    A way to avoid these POP email account issues, is setup a .Mac, Gmail, or Yahoo! account.
    Jason

  • HT4783 AirDrop between two MacBook Airs

    We have two MacBook Airs, and older one running 10.7.5 and a newer one running 10.9.1.  When running AirDrop on both, the older one can see the newer one and can transfer files successfully.  But the newer one cannot see the older one.  Any ideas?

    what is your question?

  • I downloaded mountain lion for my macbook pro and i want to install it on my sisters' macbook air, my question is, how many times can i share my purchase?

    i downloaded mountain lion for my macbook pro and i want to install it on my sisters' macbook air, my question is, how many times can i share my purchase?

    Association of Associated Devices is subject to the following terms:
    "You may auto-download Eligible Content or download previously-purchased Eligible Content from an Account on up to 10 Associated Devices, provided no more than 5 are iTunes-authorized computers."
    That information is available here >   iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    If you re download Mountain Lion using your Apple ID on her Mac, your sister will need to use your Apple ID and password to install and update apps.

  • Quick SAP Script question New Page Print

    Quick SAP Script question
    I have added a new page to an existing SAP Script BUT only want it to print if a condition is true.
    I need to do this from within the form as the print program is SAP Std.
    Any idea how I can prevent the new page from printing?
    i.e. I need the form NOT to call the new page if the condition is false. Is there a way of forcing an exit or stop from with in the form?

    Hi,
    To trigger a new page, there is script ediotr command NEW-PAGE.
    so find where is that command is triggered and use the below code for trigger it on any specific condition....
    if &condition& = 'True'
    /*  NEW-PAGE
    elseif
    /: NEW-PAGE   
    endif
    so it means if condition is satisfied your new page will not work.. else it will...
    Hope you got it...
    Try this..
    Best luck..
    Regs,
    Lokesh.

  • Not supported: Air + Ajax + (flex-ajax-bridge) + LCDS

    I'm building an application Air (Flex + extjs) and offline synchronization with LCDS. For sure I need the flex-ajax-bridge.
    But the experiments failed on Air runtime container, when ajax tried to communicate with server end data services.
    And I checked the source code of flex bridge file (FDMSBridge.as):
    import bridge.FABridge;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import flash.events.Event;
    import flash.external.ExternalInterface;
    import mx.core.mx_internal;
    use namespace object_proxy;
    [Frame(extraClass="FakeFlexInit")]
    public class FDMSBridge extends FDMSBase
    private var gateway:FABridge;
    public function FDMSBridge()
    super();
    if (ExternalInterface.available == false)
    return;
    ExternalInterface.addCallback("createObject", createObject);
    private function createObject(className:String, cArgs:Array):Object
    From the source code, we can tell the bridge rely heavily on the flash.external interface; AND look at this link -
    http://livedocs.adobe.com/labs/air/1/aslr/flash/external/ExternalInterface.html
    where it says -
    Note: Adobe AIR currently does not support the ExternalInterface class.
    which leads to the conclusion that:
    Air + Ajax(HTML) + LCDS solution is not supported by AIR currently.
    The ExternalInterface class environment:
    Browser Operating System Operating System
    Internet Explorer 5.0 and later Windows
    Netscape 8.0 and later Windows MacOS
    Mozilla 1.7.5 and later Windows MacOS
    Firefox 1.0 and later Windows MacOS
    Safari 1.3 and later MacOS
    Can anyone tell me what's the version of AIR built-in browser (squirralfish)? or, will AIR support FDMSBridge soon?
    Thanks!

    I agree, it would be nice to have gzip encoding support in
    AIR's browser component. But, I looked at what my AIR app sends
    when it requests a web page, and it's not claiming to the remote
    server that it can support gzip. If the server is sending the
    content gzipped anyway, it's almost certainly broken. Web servers
    aren't supposed to dictate encodings. Clients say what they're
    capable of receiving, and servers send the data in that format if
    they're capable of sending any of the requested formats.
    I see only one exception in the spec.
    Section
    14.3 says the server is allowed to send what it likes if the
    client doesn't say what it wants (true for AIR) and it cannot
    support the default, which is to say, sending the raw data as it is
    on disk. So, is that the case? Can this server really not send raw
    data, to anyone, ever? If so, it's violating the spirit of the web,
    to the point that I'd say it's broken, even if the spec does allow
    it. And if the server really is capable of sending the raw data,
    it's
    really broken for insisting on sending it compressed when
    the client hasn't told it that it can handle it; this would
    actually be against the spec, not just against the spirit of the
    spec.
    It would seem a more sensible use of your time to fix the
    server than to go and learn another technology just to work around
    its brokenness.

  • I have what is hopefully a quick and easy question. I kno...

    I have what is hopefully a quick and easy question. I know almost nothing about this stuff so go easy on me . All I need to do is find out if my DHCP is enabled. I'm having problems with my Xbox 360 and one of the possible problems is this DHCP thing. However I have no idea how to find the settings for my router on my computer. If it helps I have a Wirless model BEFW11S4. Thanks in advance for any help.

    You need to access your router to check if the DHCP is on.  To access the router open your browser and type in http://192.168.1.1 into the address field and hit enter.  That should open the routers log on screen and by default the user is left blank (some routers it is admin) and the password is abmin.  If you changed your routers password as you should for security reasons then use that password.  That will bring you to your routers user interface and on the main set up page should be your DHCP.
    Richard Aichner (Ikester)

  • JQuery AJAX vs. Adobe AIR AJAX Class

    Hi,
    I would like to use jQuery for my next project, and as you know, jquery comes with an included AJAX module, but i could also use the ajax class provided with adobe air. Which one should i better use it ? I've worked before with jQuery and so i'm more familiar with this library.
    Is there a difference between Adobe AIR AJAX Class and jQuery's AJAX ?
    Thank you,
    Alex

    I've seen a tutorial such as this:
    $("#loginbtn").click(function(){ 
    params = 'username='+$("#username").val()+'&password='+$("#password").val(); 
    request = new air.URLRequest(server + 'loginService.php'); 
    request.data = params; 
    request.method = air.URLRequestMethod.POST; 
    loader = new air.URLLoader(); 
    loader.addEventListener(air.Event.COMPLETE, loginComplete); 
    try { 
       loader.load(request); 
    } catch (error) { 
       alert("Error connecting to login server."); 
    and i am saying that you could do the same thing in jQuery.
    Is there any advantage in using AIR's AJAX Class ?
    Thank you for your support.
    Sincerely,
    Alex

  • AIR+AJAX+FTP

    Hi,
    I am building an app which needs to connect via ftp and
    upload some files to the server. I am using AIR and AJAX. I am not
    able to do that. All the tutorials are mainly for Flex. Can anyone
    help me?
    Gaurav

    I am just touching my toes into AIR+AJAX now, and would be interested in created a similar app, where a user could drag a file from their desktop to the app, and upload to ftp.  Did you get any help on this, or know of any tutorials that may be helpful?
    Cheers,
    Dan

  • AIR/Ajax support for gzipped HTTP response

    I run from one problem into another. I would like to fetch
    XML data from one site, but apparently it sends it gzip encoded.
    And it seems AIR/Ajax is not good with supporting this.
    I saw some workarounds for this in AIR/Flex (and Flash i
    suppose as well) by using some ActionScript code. Is there any
    option for AIR/Ajax ?
    Or maybe is there an option to setup URLRequest/URLLoader in
    a way it looks to external site as 'browser' that does not support
    gzip encoding ?

    I agree, it would be nice to have gzip encoding support in
    AIR's browser component. But, I looked at what my AIR app sends
    when it requests a web page, and it's not claiming to the remote
    server that it can support gzip. If the server is sending the
    content gzipped anyway, it's almost certainly broken. Web servers
    aren't supposed to dictate encodings. Clients say what they're
    capable of receiving, and servers send the data in that format if
    they're capable of sending any of the requested formats.
    I see only one exception in the spec.
    Section
    14.3 says the server is allowed to send what it likes if the
    client doesn't say what it wants (true for AIR) and it cannot
    support the default, which is to say, sending the raw data as it is
    on disk. So, is that the case? Can this server really not send raw
    data, to anyone, ever? If so, it's violating the spirit of the web,
    to the point that I'd say it's broken, even if the spec does allow
    it. And if the server really is capable of sending the raw data,
    it's
    really broken for insisting on sending it compressed when
    the client hasn't told it that it can handle it; this would
    actually be against the spec, not just against the spirit of the
    spec.
    It would seem a more sensible use of your time to fix the
    server than to go and learn another technology just to work around
    its brokenness.

  • TS2529 You make a backup of the iPhone and after that worked Ri Storr lost version reserve two MacBook Air and thus lost all contacts and pictures in my phone I hope help me to recover because of its great importance knowing that Alitonz Copies old from b

    I make a backup of the iPhone and after that worked Ri Storr lost version reserve two MacBook Air and thus lost all contacts and pictures in my phone I hope help me to recover because of its great importance knowing that Alitonz Copies old from backup from Prepare other iPod does notretains only a new version of the iPhone after the irrigation Store

    TS2529 I make a backup for my iPhone and after that I worked Re Storeto it than when i select re stor backup I lost version reserve from  MacBook Air and  lost all contacts and pictures in my phone I hope help me to recover my last backup because of its great importance
    note ihave 2 Copies old backup in ituns from my ipad i dont losat
    plz help my myenglish  langauge is baaaad

  • Two quick questions about Library after moving beginning on a new computer

    Hi there,
    I just moved from Windows to Mac, meaning I had to move my iTunes library from the old PC to my new MBA.
    Just a couple of quick questions.
    1. When I started iTunes on my new Mac, in the preferences I directed the media folder to the folder with all my itunes music/podcasts etc, and then I imported the Library XML file.  Is this incorrect? Should I have imported a different file? Should I have used the itl file instead? 
    If so, should I delete the library and start again?  (if this is the case, please suggest the best way of doing this without affecting my media)
    - a kind of sub-question to this one:  some of the media files arent showing up in the iTunes library, but they are in the media folder on the ext HDD.  Is there a way I can find out which ones havent been recognized by iTunes?  Whats the best way of getting them in to my library?
    2. Pretty much half of my podcasts have not been loaded in the new iTunes.  The ones that havent were ones that I subscribed to on my iPhone, whereas the ones that show up in iTunes were ones I downloaded from iTunes.  When I connect my iPhone and sync it with iTunes, will those podcasts show up in iTunes?  Or is there a risk that they will be deleted from my iPhone?
    Cheers,

    The .xml is lacking some information such as ratings, date added, and play count.  Using the .itl includes this information but cannot be imported using the method you did.
    A complete library is everything in the iTunes folder.  By using the method you did you left the artwork behind in the artwork folder on the other machine.
    Selecting the media folder in preferences does not get iTunes to recognize the media.  All it does is tell iTunes to start storing new media in that location.
    Using the method I outlined nothing will be missed (with the exception of WMA) because you aren't rebuilding your library, you are using the one that already exists.
    You don't have to re-copy everything as long as you get the stuff you missed and re-assemble it all as it was before except not on the Mac.
    What are the iTunes library files? - http://support.apple.com/kb/HT1660
    More on iTunes library files and what they do - http://en.wikipedia.org/wiki/ITunes#Media_management
    What are all those iTunes files? - http://www.macworld.com/article/139974/2009/04/itunes_files.html
    Where are my iTunes files located? - http://support.apple.com/kb/ht1391

  • Two quick questions about the new iMacs...

    I work at a church, and this summer, we are breaking ground on a new building. I am hoping to get a new iMac to go in the new sound booth to run the Power Point. Two questions:
    Would a church get a special discount when buying from Apple?
    Did I hear somewhere that the new iMacs support an external monitor (a different output than the main monitor)?
    Thanks!
    Matthew

    <<Would a church get a special discount when buying from Apple?
    Did I hear somewhere that the new iMacs support an external monitor (a different output than the main monitor)?>>
    I know Apple offers education and government discounts... I'm not aware of discounts for church organizations.
    Yes, the iMac CD offers support for dual monitors, mirrored and extended.

Maybe you are looking for