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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:54:59+00:00 2026-05-20T07:54:59+00:00

version flash cs5 ok so i know the general code to rename all selected

  • 0

version flash cs5

ok so i know the general code to rename all selected library items

var items = fl.getDocumentDOM().library.getSelectedItems();
for (var i=0; i<items.length; i++){
var item = items[i];
item.name = "ABC_"+item.name;
}

but this isn’t good enough if the library items are in folders… because item.name returns the full path, but item.name sets the name. o.O as someone else points out here, http://forums.adobe.com/message/107718

  • so when i try to rename Level1 to be ABC_Level1
  • if Level1’s folder path is LIBRARY/FolderA/FolderB/Level1
  • i get this instead
  • ABC_FolderA-FolderB-Level1

i could probably code some sort of string parser something like this,

item.name = “ABC_”+item.name.substr(item.name.lastIndexOf(“-“), 99)

but that is really ugly and would not work if library items contained “-” already. “Level-1” for example

so i guess what I’m hoping for is a different way to access the name that returns just the name and not the path

  • 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-20T07:55:00+00:00Added an answer on May 20, 2026 at 7:55 am

    It’s tricky because when you get the name it’s the full path, but when you set the name, it’s just the item name (and not the path). You have to separate the name and the folder before concatenating. So, there isn’t a “clean” way to do it, though writing a function might make it more readable:

    function getItemName(item) {
       return item.name.split("/").pop();
    }
    

    Then set the name of the item thusly:

     item.name = "ABC_" + getItemName(item);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There is a way to know the flash player version installed on the computer
How to know if debug version of flash is installed? Thank you.
I notice in older version of flash you can create an instance of a
Let's say I have Flash-version of and non-Flash version of my website. When a
I'm using Box2D (the AS3/Flash version, if it matters) and I'm trying to calculate
It appears I'm not able to detect the installed version of flash on Vista/IE7.
On chrome it works ok. My flash version is WIN 10,0,32,18 Debug: No This
With swfobject 2.2, how do you specify the desired version of flash you require?
Version Control with Subversion recommends the following layout for (single-project) repositories (complemented by this
The version of Subclipse (1.2.4) currently available through Aptana's automatic Plugins Manager does not

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.