Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 660297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:08:25+00:00 2026-05-13T23:08:25+00:00

I’m dragging from a TileList to a custom component. I want to know what

  • 0

I’m dragging from a TileList to a custom component. I want to know what is being dragged before I accept it. How do I set the “format” that is used for “event.dragSource.formats” in the DragEvent?

Edit for clarification:
When you set “dragEnabled=true” on the TileList, it takes care of the drag source stuff, but it uses “items” as the format for the DragEvent. I’m looking for a way to have the TileList use the correct format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:08:25+00:00Added an answer on May 13, 2026 at 11:08 pm

    Hey, this is a great question, and quite complex. Because Flex is primarily developed by Adobe, they don’t have the power/resources/money to cover edge/customization cases like this. If only they decentralized Flex’s development!

    I’ve had to deal with this problem too. It boils down to the fact Flex has hard-coded specific data source ‘types’ into the ListBase source, so you can’t change the types. That’s good and bad… Check out all the drag[Type]Handler methods in that ListBase class and see what’s going on.

    All we need to do is intercept the DragEvent.DRAG_START event and call event.stopImmediatePropagation() (luckily flex will listen to that!). Here’s an example app:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
        xmlns:mx="http://www.adobe.com/2006/mxml">
    
        <mx:Script>
            <![CDATA[
    
                import mx.events.DragEvent;
                import mx.managers.DragManager;
    
                protected function updateDragSource():void
                {
                    selected = !selected; // flip;
                    sourceType = selected ? "mySource" : "items";;
                }
    
                protected function dragEnterHandler(event:DragEvent):void
                {
                    if (!event.dragSource.hasFormat(sourceType))
                        event.stopImmediatePropagation();
                }
    
            ]]>
        </mx:Script>
    
        <mx:Boolean id="selected"/>
        <mx:String id="sourceType">items</mx:String>
    
        <mx:TileList id="list" width="100%" height="100%" labelField="name"
            dragEnabled="true" dropEnabled="true" dragMoveEnabled="true"
            dragEnter="dragEnterHandler(event)">
            <mx:dataProvider>
                <mx:ArrayCollection>
                    <mx:Object name="one"/>
                    <mx:Object name="two"/>
                    <mx:Object name="three"/>
                    <mx:Object name="four"/>
                </mx:ArrayCollection>
            </mx:dataProvider>
        </mx:TileList>
    
        <mx:Label text="Change Drag Source Type:"/>
        <mx:Button id="button" click="updateDragSource()" label="{sourceType}"/>
    </mx:Application>
    

    This gives you the base for checking if dragSource.hasFormat returns true/false. If you want to change what the dragSource’s format is, you’re going to have to extend TileList and override all of the drag methods :/. The items and orderedItems are hard-coded into ListBase, so you can’t change the format easily.

    The only way you can use your own formats is to not use any of the ListBase-extending classes, and implement your own drag/drop system. It’s not that bad. The reason is because, if you look into all the drag event handlers in ListBase, they have things like this:

    var dragSource:DragSource = event.dragSource;
    if (!dragSource.hasFormat("items") && !dragSource.hasFormat("orderedItems"))
        return;
    

    So if they’re not that format, it won’t allow you to drag.

    Hope that helps,
    Lance

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I have a bunch of posts stored in text files formatted in yaml/textile (from
Seemingly simple, but I cannot find anything relevant on the web. What is the
this is what i have right now Drawing an RSS feed into the php,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.