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 601387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:42:34+00:00 2026-05-13T16:42:34+00:00

I have a TileList with thumbnail images. Under each thumbnail images I display the

  • 0

I have a TileList with thumbnail images. Under each thumbnail images I display the name of the image. I want to build rename functionality. So under the TileList is a “Rename selected image” button.

When this button is clicked, I would like to change the state of the itemRenderer component. The label underneath the image will change into a TextInput so that the user can type a new name. This is much like the Windows rename file functionality.

How can I access the itemRenderer of the selected image? How can I make it happen that it listens to the click event of the Rename button?

Some code:

<mx:TileList id="imageTileList" width="100%" height="100%" doubleClickEnabled="true"
 itemsChangeEffect="{tileListEffect}" dataProvider="{images}" 
 keyDown="{tileListKeyDownHandler(event)}"
 itemRenderer="com.n200.components.htmlElement.ImageTile" 
 columnWidth="128" rowHeight="128" itemDoubleClick="{insertImage()}" 
 horizontalScrollPolicy="off" verticalScrollPolicy="auto" />

<mx:LinkButton label="Rename selected image" labelPlacement="left"
    enabled="{imageTileList.selectedIndex>0}"
    styleName="rename24" click="{renameSelectedImage()}" />


<mx:Script>
<![CDATA[
    private function renameSelectedImage():void
    {
        // Need to access itemRenderer of selected image here
    }
]]>
</mx:Script>

The itemRenderer is just a mx:VBox with an mx:Image and a mx:Text.
In there is another mx:State where the mx:Text changes into a mx:TextInput:

<mx:states>
    <mx:State name="rename">
        <mx:RemoveChild target="{imageName}" />
        <mx:AddChild>
            <mx:TextInput id="newName" text="{originalName}" keyDown="{textInputKeyDownHandler(event)}" 
                width="100%" focusOut="{commit()}" focusThickness="0" />
        </mx:AddChild>
    </mx:State>
</mx:states>

<enterComponents:P200Image source="{imgFunction?imgFunction.fileId:null}" width="82" height="82" verticalAlign="bottom" stretch="true" />
<mx:Text id="imageName" text="{imgFunction.name}" selectable="false" truncateToFit="true" 
    textAlign="center" width="82" toolTip="{imgFunction.name}" />
  • 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-13T16:42:34+00:00Added an answer on May 13, 2026 at 4:42 pm

    Ok, thanks Pbirkoff, your answer led me in the correct direction.
    The way I do it now is that I set the name property of the data object to “” as soon as F2 or the rename button is clicked on the TileList selected item.

    I have implemented an Observe in the itemRenderer on that data.name property (http://blogs.adobe.com/paulw/archives/2006/05/the_worlds_smal.html). As soon as this property changes I change the state of the itemRenderer to show an input box rather than a label.

    This works just like Windows file explorer now.

    Some code with some relevant functions of the itemRenderer:

    <mx:states>
        <mx:State name="rename">
            <mx:RemoveChild target="{imageName}" />
            <mx:AddChild>
                <mx:TextInput id="newName" text="{originalName}" keyDown="{textInputKeyDownHandler(event)}" 
                    width="100%" focusOut="{commit()}" focusThickness="0" />
            </mx:AddChild>
        </mx:State>
    </mx:states>
    
    <enterComponents:P200Image source="{imgFunction?imgFunction.fileId:null}" width="82" height="82" verticalAlign="bottom" stretch="true" />
    <mx:Text id="imageName" text="{imgFunction.name}" selectable="false" truncateToFit="true" 
        textAlign="center" width="82" toolTip="{imgFunction.name}" />
    
    <util:Observe source="{imgFunction.name}" handler="{nameChangedHandler}" />
    
    <mx:Script>
        <![CDATA[
            [Bindable]
            private var imgFunction:ImageFunctionRecord;
    
            [Bindable]
            public override function set data(value:Object):void
            {
                super.data = value;
                if(value)
                {
                    imgFunction = ImageFunctionRecord(value);
                    originalName = imgFunction.name;
                }
                else
                {
                    imgFunction = null;
                }
            }
            public override function get data():Object
            {
                return imgFunction;
            }
    
            private function nameChangedHandler():void
            {
                if (imgFunction.name.length == 0)
                    // when rename is clicked, the name property will be set to ""
                    renameImage();
                else
                    originalName = imgFunction.name;
            }
    
    
            private function renameImage():void
            {
                currentState = "rename";
                newName.setFocus();
                selectAllText();
            }
    
        ]]>
    </mx:Script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an associative array that I want to display using TileList. However, it
I have a TileList with a custom ItemRenderer, and each item shows an image
I have a flex TileList to which I load a bunch of images. When
I am using a horizontal tilelist in flex to display an image gallery with
I am using Flex 4. I have created an image gallery with TileList When
im in Flash CS5. I have a TileList that loads its images from an
I have a TileList in flex, and need to be able to detect if
I have built a custom component using some containers and a TileList. Now when
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:
I have some problems with my ListView. At fist I build my project for

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.