[Flex 4] Can't Set Drag indicator in Air Application

I'm trying to make a simple Air app that lets the user drag an Icon from one panel into another.  I want to set the drag indicator to look like the icon being dragged.  But no icon is being displayed.  Here is my code.  I'm using flash builder 4, it shouldn't be this hard.
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    viewSourceURL="srcview/index.html">
    <fx:Script>
        <![CDATA[
            import mx.core.DragSource;
            import mx.core.IUIComponent;
            import mx.events.DragEvent;
            import mx.managers.DragManager;
            [Embed("assets/network.jpg")]
            private var network_icon:Class;
            //user clicks the src, so allow drag
            private function mouseDownHandle(e:MouseEvent):void {
                var img:Image = e.currentTarget as  Image;
                var dragImg:Image = new Image();
                dragImg.source = img.source;
                dragImg.width = 111;
                dragImg.height = 111;
                var src:Image = Image(e.currentTarget);
                var ds:DragSource = new DragSource();
                ds.addData(src, "img");
                DragManager.doDrag(e.currentTarget as IUIComponent, ds, e, dragImg);
            //user moves the drag proxy onto the drop target, so allow drop
            private function dragEnterHandler(e:DragEvent):void {
                DragManager.acceptDragDrop(e.currentTarget as IUIComponent);
            //user drops src onto target, so re-parent the src to the target
            private function dragDropHandler(e:DragEvent):void {
                e.currentTarget.addElement(e.dragInitiator);
        ]]>
    </fx:Script>
    <!-- SRC -->
    <s:Panel title="src" width="100" minHeight="133" x="10" y="10">
        <s:layout>
            <s:VerticalLayout gap="10" horizontalAlign="center"
                              paddingTop="10" paddingBottom="10" />
        </s:layout>
        <mx:Image source="{network_icon}" mouseMove="{mouseDownHandle(event);}" />
    </s:Panel>
    <!-- TARGET -->
    <s:Panel title="target" width="100" minHeight="133" x="120" y="10"
             dragEnter="dragEnterHandler(event);"
             dragDrop="dragDropHandler(event);">
        <s:layout>
            <s:VerticalLayout gap="10" horizontalAlign="center"
                              paddingTop="10" paddingBottom="10" />
        </s:layout>
    </s:Panel>
</s:WindowedApplication>

Hello from France!
Same problem here...
It works in a web application but not in an Air application.
Any idea will be welcome...
L.N.

Similar Messages

  • Can you set a second "Open with:" application for a file?

    Hi all,
    I was wondering if something like this exists for OS X Lion or greater: you can set a default application to open a type of file, say Safari for all .html files, but can you set a second default application for a file?
    I usually open files using command + o or command + down arrow from the Finder and I've often thought how good it would be to hit an alternate keyboard shortcut to open the selected file in a secondary default application.
    For example, if I'm making a web page and have the .html selected in the finder I can hit command + o (or command + down arrow) to open it in Safari and if the file isn't open in my editor and is selected in the Finder I can hit, say command + option + o (or command + option + down arrow) to open the .html file in my editor.
    Does anyone know if this can be achieved in OS X Lion or greater?
    Any advice is greatly appreciated.
    Thanks.

    Hi all,
    If anyone's interested in a partial solution, I've rigged up the following.
    I ended up using an Automator action coupled with Spark to capture a keyboard key combination. Spark: http://www.shadowlab.org/Software/spark
    I've used Spark before with good results, and although it's from 2008 it still works on Lion.
    I created an Automator action that does two things:
    gets the selected Finder items
    opens finder items in the text editor I'm using.
    I then saved the workflow as an application so that Spark could run it.
    I've set up a keyboard shortcut that Spark picks up and calls my Automator workflow. It all seems to work nicely.
    So, I've created a specific "open selected file with <text editor>" keyboard shortcut that should do for the time being.

  • Drag Email into Air Application

    Can someone tell me if it is possible to drag an email
    message from Outlook or other desktop email clients into an AIR
    application, and have the application read the contents?

    AIR can get text, html, bitmaps, and file handles through
    drag and drop. If the e-mail client puts the e-mail into one of
    those formats, then an AIR application can recieve it. Otherwise,
    it can't.

  • How can I set the timezone in my application?

    I inherited a website in which the DateFormat() function is littered throughout, and plays an integral role in ensuring the application runs correctly. For instance, we have a calendar system in which employees can book lessons on certain days and at certain times. The Date and Time functions are key to this application's success.
    But we moved the website from one server to a newer, shared, one a few months back running CF10 on Windows Server 2008. (I believe the old one was running CF8 on a Windows 2000 server or something.) But what appears to be happening is that other users on this new shared box are changing the date/time based on their needs and at different times, and it is affecting our applications. I called the support staff of the hosting company who told me I had to specify the date and time via Java in my application file and that should solve the problem.
    The issue is that I really have no idea how to do this. My programming with Java is virtually null, and even my familiarity with ColdFusion is waning, as I have not seriously used it in about 9 years. I see there are a number of tutorials and demonstrations on the web for accessing date and time via Java in ColdFusion, but I don't know how to set the application to a specified timezone, (which is what I think I have to do), so that when the DateFormat() object is called, it calls the correct date. Otherwise, when employees go to book lessons, the dates are off. Their calendar will show that April might begin on a Tuesday instead of a Monday. At other times we've noticed the hour is off by a considerable amount - 4 or 5 hours, when the server itself is in a timezone only 1 hour behind us.
    Any idea how to pull something like this off?
    I figure even if I can specify the timezone in the application files I may have to overwrite every instance of DateFormat() to something customized, but I'm hoping I don't have to go that far.
    Any help is greatly appreciated.

    Question: Do you think the response from the support staff is correct? I mean, surely, I can't be the only CF user on a shared box whose other users need to modify the date and time within their applications. Even if they do it at the application level for their domain, surely it wouldn't affect mine, would it? That was what was implied by the support people, but I have a feeling they are way off, or covering for some goof-up on their end. I struggled like hell yesterday trying to get this to work and I did not get very far at all.
    I found an interesting tutorial here which does a comparison of time zones and, theoretically, this might do the trick. But if what the guy told me was nonsense then I won't bother with it. For the record, our calendar has been working fine for about a week now.

  • How can I set up my macbook air to use programs on my iMac over the internet?

    I have a program (MacPractice) on my iMac. It's running the server program while my MacBook Air is running the client software which has to be connected via the wireless (last Gen Time machine) in my office to function. What do I need to do to be able to access my iMac over the internet when I'm out of the office? I was told that I would need to set up a DNS (?) address to log in. I use a Comcast internet modem which goes through my Time Machine wireless router to my iMac. Is this even possible to do with the current setup?

    Ok, in this case your iMac will be performing as an application server. As such, it will need to be "reachable" from the Internet. This is typically done in one of two ways: 1) It is assigned a static Public IP address, or 2) It is assigned a static Private IP address.
    In the first method, your iMac will be like any other publically available server (Web, E-Mail, etc.) To accomplish this, you would need for your ISP to provide you with a static Public IP. You can then configure the AirPort Extreme to allow remote clients to access this server by creating a DMZ for the server. This would fully expose your iMac to the Internet.
    In the second method, you would assign the iMac a static Private IP address that is just outside of the default range of the AirPort's DHCP service. You would then configure the AirPort for port mapping. Which ports that will be needed to be mapped will depend on what your application's support tells you.

  • How can I set auto-resize for an application?

    Hi, I have created a flex application but now I have a problem: if I use it on a netbook, with little display, or I use it throught facebook the application does not auto-resize nor vertical/horizontal bar appear!
    Is there a way to let application auto-resize?I used flash builder 4 with a graphite-spark theme and no layout at all...help me please!

    Yes, but the problem are x and y : they are absolute so containers will eventually collide...you mean the only way is to use nested containers and not use coordinates in order to put elements on the application?

  • Can't set the correct key when converting imported audio to GB loops

    Hi,
    I feel I am really out of options for this one. I am trying to convert a couple of mp3 files to useful GarageBand loops. This is what I tried first:
    1) drag the mp3 file on the timeline.
    2) using a steady 4-beat, match the BPM settings to that it fits the tempo of the imported file
    3) check the key of the imported file with a software instrument, and switch the project's key accordingly
    4) Edit -> Add to Loop Library
    Using this method, the produced loops show up in the Loops Browser correctly, but they play back in the wrong key. Example: I created a loop from a mp3 file that was originally played in A. I tagged it as being in the "A" key by creating a loop from it, with the project key set to "A".
    When it then shows up in the Loop Browser, and I would select this loop with my Garageband project (still) set to "A" - I would expect to hear the loop being played in its original key.
    It doesn't. It plays about four or five semitones too high (the difference between A and C, or C and E)
    I haven't been able yet to figure out why this is so, or if there is any pattern in how much the key is off.
    Then I searched far & wide, and found the Apple Loop Utility and a couple of articles on bulletsandbones.com. I also checked the midi import settings, though I doubt whether they have any influence here. They were set at 44.1 KHz.
    This is what I tried then:
    1) use bulletsandbones.com's never-fail conversion to AIF format (44.1 KHz sample rate, 16 bit)
    2) use the Apple Loop Utility to "tag" the AIF file, setting it so that it shows up in the right category of the loop browser, etc.
    3) also, use this utility to tag it with the key that the loop is played in
    4) copy the AIF file into the Loop Library directory
    5) start Garageband, and refresh / re-index the Loop Library so that the new loop is added and properly indexed
    This made no difference. Or maybe it did, but the loops thus produced STILL do not play back in the key that I tagged them in (if I set the project accordingly, of course). It's completely mystifying.
    I can omit a key indicator in the Apple Loop Utility, and only then does the loop play back as it should. But then it does not change with the project's key settings anymore.
    Even more strange: even a loop that I tagged (in the "A" key) and saved with the Apple Loop Utility, plays back too high in that same Apple Loop Utility when I re-open it. It does play back correctly in Finder's Fast Preview.
    I could not find any mention of this problem elsewhere. Does anyone have a suggestion what might cause this?

    I think this is the culprit:
    3) check the key of the imported file with a software instrument, and switch the project's key accordingly
    If the "follow tempo & pitch" box is checked, this might change the sample's pitch and throw GB off.
    Try to determine the sample's key before you import it, set the GB project's key accordingly, and then import the sample. That should assign it the correct key!

  • How can I set up Cinema Display as a main screen and leave my macbook pro as a second screen instead?

    How can I set up Cinema Display as a main screen and leave my macbook pro as a second screen instead?

    I learned that the Dock is positioned at the chosen edge of whatever Display is positioned farthest to that side.  E.g. for the Dock to be positioned on the right side of the Cinema Display (instead of the right side of the MacBook), the Cinema Display must be oriented (by dragging) to the right of the MacBook monitor on the "Arrangement" tab of the Displays Preference Panel.

  • Can I set up folders in pages on iPad?

    how can i set uo pages folders?

    You can create folders in iOS Pages in a manner similar to creating and using Folders as described in Chapter 3 of the iOS User Guide found as a special bookmark in Safari. Well worth reading.
    In Pages Document View (where you see thumbnails of each document) tap on a document and drag it over another document to create a folder. Additional documents can then be dragged into the folder. To remove a document in a folder, tap, hold then drag out of the folder.
    There are limits: each folder can only hold 20 documents and you cannot nest folders or place a folder inside another folder.

  • How do I back up my entire iphoto library to an external hard drive that I have dedicated for photos only?  Can I simply drag the iphoto library onto my seagate (hard drive) icon?

    How do I back up my entire iphoto library on to an external hard drive that will be my second back up plan.  I already have one back up that is also synched with time machine.  But now I want to back up my iphoto library to a new hard drive to have a second copy. Can I simply drag the whole library onto the icon on my desk top?  THX

    WHile you can do it that way, the next time you back up you'll end up copying the entire library again, and,as you'l see, once a library gets bigger that can take a considerable amount of time.
    Try using an app that will do incremental back ups. This is a very good way to work. The first time you run the back up the app will make a complete copy of the Library. Thereafter it will update the back up with the changes you have made. That makes subsequent back ups much faster. Many of these apps also have scheduling capabilities: So set it up and it will do the back up automatically.
    Example of such apps: Chronosync - but there are many others. Search on MacUpdate or the App Store

  • How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    How can I set up a guest access point with a Time Capsule and an Airport Extreme? I am using a Telus router with the Time Capsule used as a wireless access point (bridge mode). I don't want the guest access point to have access to my network.

    The Guest Network function of the Time Capsule and AirPort Extreme cannot be enabled when the device is in Bridge Mode. Unfortunately, with another router...the Telus...upstream on your network, Bridge Mode is indicated as the correct setting for all other routers on the network.
    If you can replace the Telus gateway with a simple modem (that performs no routing functions), you should be able to configure either the Time Capsule or the AirPort Extreme....whichever is connected to the modem....to provide a Guest Network.

  • How can i set a layout for MIGO screen

    Hello all,
    How can i set a layout for MIGO screen. & make that layout default. Like i want to drag Requistioner column next to quantity in MIgo screen. temporarily I can drag but is there a way to save as layout & save it.

    Hi
    First you arrange however you want and then go to table settings which is there in the right corner of the item details and create a variant and save.
    Find a button with blue yellow and white at the top end above the vertical drag bar when put the cursor it will show you as Configuration.
    After creating the variant tick the check box use as standard setting below the variant
    Hope it helps
    Edited by: Girish  Adaviswamy on Mar 3, 2010 1:27 PM

  • How can I set my pictures in a order I want ? (On my iPad)

    How can I set my pictures in a order I want ? (On my iPad)

    HI friend open your desired album and see on the right side corner a button which says select press the button select and then press select the picture you want to move. A tick mark appears on the photo. Touch and hold the photo again for sometime and your finger can move the photo and can be dragged to your desired order. Did I clear your doubt. Fredy. 

  • In ios 7 I can't see my old playlist of videoclip in landscape view. Anybody know how can I set it?

    In ios 7 I can't see my old playlist of videoclip in landscape view. Anybody know how can I set it?

    Hello everyone,
    I faced this same issue, but not from updating to iOS 7.
    In my case all my music playlists disappeared. In another post I found a process which got them back, but after I'd done so I noticed that my Apps list and my books list were both empty, even though I'd bought plenty of books & apps. The following trick I discovered restored both of these lists.
    1. Within iTunes, select the Apps tab within the library, to show the (empty) window of all your apps.
    2. Now in a finder window, open your iTunes folder. On my computer this is in my Music folder.
    3. Within the iTunes folder, locate and drag the "Mobile Applications" folder into the apps window.
    Presto!!
    The same thing worked for finding the missing books, except that the books folder is stored one level deeper, within the iTunes Music folder, and of course I dragged it into the books window.
    I don't know if it matters, but I'm still running OSX 10.6.8 because I have use some legacy OSX apps that won't run in anything more recent, but my iTunes version is 11.1.4.
    I hope this helps a few people...

  • Set deletion indicator in purchase requisition account assignment

    Hi Guys,
    Can you please help we with the solution to set deletion indicator in purchase requisition account assignment or close purchase requisition. A purchase requisition of $3.600.000,00 was created through Project system Network-External Processing and it has 2 duplicate network activities and $2.246.577,20 was converted to purchase order then $1,353,423 became the network remaining order plan. A purchase order service entry sheet was accepted and the invoice was created. Now Iu2019m experiencing problem when Iu2019m trying to change WBS element and Network system status to TECO in order to remove the remaining order plan of $1,353,423. Iu2019m getting error message number:06411 the procedure I have follow to correct the error is to reduce quantities in the account assignment item and delete superfluous account assignment by setting deletion in each case but I cannot do that because the fields are grey
    Regards
    Sandile

    Hi,
    please check first if the report ZMO_CORRECT_EBKN  from note 739004  can correct the problem.
    I would like to recommend you to check also the note 796973 whether the correction is avalilable in your coding, it should solve the issue.
    In case the problem still persists, please open a ticket to get help from the primary support in area MM-SRV.
    Regards,
    Edit

Maybe you are looking for