Return flash filename minus the file extension

Lon Hosford sent me the following code which returns the name
of the running
flash file minus the '.swf' extension. It was working great
until I tried to
use it when the flash file was run from a path that had a .
(dot) in the
name of one of the folders in the path to the flash file. I
guess it uses
the dot to find where to cut of the extension from the
path/filename. It
seems to find the first dot in the path/filename. I would
like it to find
the last dot in the pathfilename. Can anybody help me with
this?
xmlFileName= _url.split("/").pop().split(".").shift()
trace(xmlFileName)
Thanks
Jim...

Try lastIndexOf , you should get the solution. Refer to
actionscript directory for the syntax

Similar Messages

  • How can I get a filename without the file extension?

    I using a JFileChooser to select and read a file. Now I want to get the filename without the file extension
    JFileChooser j = new JFileChooser;
    String file = j.getSelectedFile.getName();
    At the moment I get this result "file.dat". I need only the filename.....
    Thank you
    Thomas

    It's quite that.
    Here is the code to do that (and the method to get only the extension):
         public String getFileName(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(0, ind);
              return(null);
         public String getFileExtension(String text) {
              int ind = text.lastIndexOf(".");
              if(0<ind && ind<(text.length()-1)) {
                   return text.substring(ind+1).toLowerCase();
              return(null);
         }(I used 0<ind instead of ind>0 because with the code formatting there is a bug with > )
    I hope this helps,
    Denis

  • DOriginalName without the file extension

    Folks
    I'm sorry if I'm posting this in the wrong place, but I'm very much out of my depth.
    The organisation I work for has recently adopted Oracle Content Server to manage its intranet site, and it's fallen to me to work out how to report on my team's content. I'm using the built-in search facility and discovering bits and pieces of coding as I go along. However, I'm stuck with this:
    <$dOriginalName$>
    This gives me filenames with file extensions, whereas I need filenames without file extensions. Does anyone know how to achieve this? For information, both our filenames and our file extensions can be of various lengths, but there will never be more than one '.' (namely the '.' separating the filename from the file extension).
    Many thanks in advance.
    Ed

    Not sure about your requirement. But if you are asking it at database level then
    WITH T1(str) AS(
    SELECT 'ABCD.TXT' FROM DUAL UNION ALL
    SELECT 'CHEF.DISCARD' FROM DUAL)
    SELECT SUBSTR(str,1,INSTR(str,'.')-1) FILE_NAME FROM T1;
    OUTPUT:
    FILE_NAME
    ABCD
    CHEF
    If this is not then post some sample of your data.

  • Filename.xls is in a different format than specified by the file extension

    When I create Dimensions and then try to maintain dimension members using the administration client, I receive the following notification from Excel 2007.  The file you are trying to open, filename.xls, is in a different format that specified by the file extension.  Verify that the file is not corrupted and is from a trusted source before opening the file.  Do you want to open the file now?  Yes or No.
    I click yes and the file opens correctly in Excel.  If I click No, I get an "Unspecified error" dialog box from BPC.  I suspect this is a security feature in Excel 2007.  Has anyone else run across this and if so, know of a good way to disable this message?
    Adam

    After upgrading to Excel 2007, you may get the following error when you try to open an excel document.
    The file you are trying to open .xlsx is in a different format than specified by the file extension. verify the file is not corrupted and is from trusted source before opening the file. Do you want to open the file now?
    This errors particularly occurs when youu2019re trying to open an XLS file (Excel 2000-2003) with Excel 2007.
    The easiest way to solve this problem, is to insert the following registry key. This will suppress the notification:
    [HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security]
    u201CExtensionHardeningu201D=dword:00000000
    The step-by-step instructions are as follows:
    1.Click Start, click Run, type regedit.exe and press ENTER. This will open your Registry
    2.Navigate to HKEY_CURRENT_USER\SOFTWARE\MICROSOFT\OFFICE\12.0\EXCEL\SECURITY
    3.Right click in the right window and choose New -> DWORD
    4.In the Name field, type u201CExtensionHardeningu201C  (without the quotes)
    5.Verify that the data has the value u201C0u2033
    I advice the steps above to solve the problem, despite the fact that it is quick and dirty.

  • Batch Rename with additional "."s, drops the file extension. Request for "Keep File Extension" option...

    I NEVER name files with extra "." s in the name. I realize that all OS's (even Windows) will recognize it, but I haven't gotten out the old mindset of 8.3 filenaming... Although I do use longer names. So... I was surprised to see that when I was renaming files as per a clients naming preference to add a period within the name, the file extension is removed.
    For example: 
    original file -  2014_10_31_1643.CR2   when batch renaming to "2014.31" + sequence, drops the "CR2" extension.
    but.... if I change it to "2014_31" + sequence, the ".CR2" remains
    Since adding multiple "." is a legitimate naming convention, shouldn't the file extension remain?  Or, possibly this could be made more flexible by adding a check box "Keep file extension"
    just a thought.

    Refer to this stackexchange article:
    http://apple.stackexchange.com/questions/47319/how-can-i-make-os-x-recognize-new -file-extensions
    The finder will only select the filename only for "known" file types.

  • Changing the file extension by entering a "?" in JFileChooser

    Hi,
    I've encountered a weird thing in JFileChooser. If you open the chooser, type at least one "?" in the field for the filename and then hit the approve button, the file extension will change to the text you entered as the filename.
    To reproduce this problem, simply launch the JWSFileChooserDemo hit the "Open a File..."-button and as the filename enter something like "?deadbeef". Now click the open button and you will see that the file extension changes to "?deadbeef".
    This is a really strange behaviour in my opinion.
    I'm using Windows 7 with java 6u16, but the issue is the same on windows xp sp3. Perhaps on linux too. I'll give it a try as soon as I can.
    Has anyone else encountered that problem?
    Best regards
    Edited by: Wurstsalat on Mar 23, 2010 10:30 AM

    To reproduce this problemThis is not a problem but rather a feature. I did not know of this till now. Thanks for informing.
    As Kevin pointed out this is related to filtering of files.
    ?deadbeefThis will match all the files which start with any letter followed by "deadbeef". So, ? is a wildcard meaning any one character. Other wildcard can be *, which means any number of characters. Try this:
    *.txt
    a*.txt
    *.jp*g
    ??.txt I don't know other wildcards...
    Thanks!

  • Display the file extension?

    Is there a way to display the file extension? I want to tag some as PSD files and I want to delete all gif files. Currently I am opening each in Photoshop elements to get the extension, which is very cumbersome. I know I can see the extension in finder, but I cannot assign keywords in finder.
    Thanks
    bob

    New Smart Album
    Filename -> Contains -> psd
    Regards
    TD

  • Can the file extension be removed when using the File Special Field?

    I placed a Special Field on the top of my topics that gives
    me the filename for that specific topic. I used the Insert >
    Field > Special Field > File and the File Name is inserted
    where I want it. The problem is that i don't want the file
    extension to show, just the name. I can't figure out how to do
    this...Any suggestions....anyone? Maybe a Script or an applet? Any
    input will be greatly appreciated...

    Thank you for your response. I did try something similar to
    what you suggested but the problem is that whatever I modify it
    automatically puts it back like it was as soon as I try to save it.
    This is probably because I used the Insert Special Field commands
    from the Menu. It automatically places this on the code:
    <!--kadov_tag{{<variable name=file
    x-format=default
    x-value=017.htm>}}-->017.htm<!--kadov_tag{{</variable>}}-->
    Where 017.htm is the actual name of the file for the specific
    topic. This means that it's apparently doing this on the background
    somewhere I can't see and inserting the value on the code for the
    topic...
    I hope that made sense! Again, I thank you in advance for any
    suggestions...

  • Photoshop cannot recognize the file extension

    I'm trying to batch convert BMP files to JPG. One file works fine, as I build the Action. But when I run the batch, I get the error:
    File: "/Users/bryan/7D FTP/Streak in 7D/Pyracantha 2/Strips - 2 wide/"
    Error: Could not complete your request because Photoshop cannot recognize the file extension. (-25600)
    I see that the file in question is a directory, not a file, but everything was set up correctly to override "open" commands etc.
    Any ideas?

    The file names are an image sequence, Strip0002.bmp, Strip0002.bmp, etc.
    But the file name never appears in the error message, only the path.
    I tried moving the folders to the desktop in case the filename and path was too long, but it had no effect. The Batch Action always does the first file without error and fails on the second, as if it has remembered the output type JPG and is then confused by the input type BMP.

  • How do I add a movie from my laptop to iTunes, what should be the file extension.

    How do I add a movie from my laptop to iTunes, what should be the file extension.

    The extension is usually .mov, .m4v, or .mp4.   But you can't just change the extension.  The movies have to be encoded in a particular fomat.  Anything downloaded from iTunes or plays in Quicktime player will be fine.

  • The filtering process could not be initialized when trying to process this item. Verify that the file extension is a known type and the item is not corrupt

    I am getting below error message while search crawl in sharepoint foundation 2010 search for only .VSD files and not for any other docs type.
    The filtering process could not be initialized when trying to process this item. Verify that the file extension is a known type and the item is not corrupt. 
    I have installed the Microsoft Filter Pack 2.0 in search server but still i am getting the same error.
    <//span>
    Any one's help will be appreciated.
    Regards,
    Rashmi
    Rashmi Singhal

    Hi Rashmi,
    1. Checked the file extension is added or not to the search file types.
    2. Checked file name has any invalid characters.
    3. Resetting the crawl index and run a full crawl .
    Best Regards.
    Kelly Chen
    TechNet Community Support

  • Why do the file extensions (.jpg .gif .png) no longer appear when I click on a previously saved image to use that image's file name (particularly important when saving a series of images using the same root name)?

    I save a lot of images using firefox, often times from a large batch or series of images. It used to be that I would click on a previously saved image and the entire file name including the file extension (i.e. image_example.jpg) would appear in the "save as" line. Now when I click on a previously saved file, the file name appears without the file extension (i.e. image_example). Which means I have to manually type .jpg every time. For a large collection of images that I am hoping to use the same root file name and then add chronological numbers at the end, this has become incredibly frustrating, especially as it is a previously unnecessary task.
    I am using a new Macbook Pro and maybe there's something Apple related to this...? It did not happen on my old PowerBook G4. I have file extensions turned on in System Preferences.
    It should be noted that I have searched high and low and have even gone into the Apple Genius Bar where they were just confused as I was and of course ended by urging me to use Safari (shocker!) as it has all kinds of new extensions and bells and whistles. I seriously feel alone on an island with this dumb, hard to google problem. Thanks so much for any help anyone out there might have.
    I mean: is this as simple as changing a setting in about:config?
    Your assistance is greatly appreciated.

    Thanks for your response Mylenium, however like I mentioned multiple times, I did change all of my trackpad/scrolling settings in system preferences.  And if I wanted to use a normal mouse (or a tablet), I would've gotten an iMac instead of a MacBook Pro.  I travel often and work all over the place, not always with access to a decently sized workspace that would be required for using a mouse or tablet.

  • Photoshop CS 5.5 - "Could not save [filename] because the file is locked..........."

    Hi,
    We have a few iMacs here all running 10.8.4 - we have PhotoShop CS 5.5 and all the artwork etc is saved on a shared server ( Windows 2008 r2)   and we are forever getting these problems......
    Only in photoshop we get the following error message......
    "Could not save [filename] because the file is locked or you do not have the necessary access privilege. Use the 'Get info' command in the finder to unlock the file or change permissions on the file or enclosing folders"
    Can't see this been an access issue so really don't know whats causing this other than the fact it's just server based...
    Please please please somebody help.

    I have been hqving this issue on windows after I upgraded to internet explorer 10 and using outlook (hotmail.com) to attach images to an email.
    After a file saved via photoshop (i assum any programe not just photoshop will cause this problem) is attached in outlook to an email, IE10 will not let go of that file.  meaning if you update the image in Photoshop and try and save over the existing jpg you previously attached it will give this error, file locked or file permissions needed etc.
    Just posting this info incase you are using email to attach files and then getting these permisssion problems.
    I work around it by closing the outlook browser tab (the email), so it lets go of the file, I can then save ontop of the file no problem, I then open outlook as needed.

  • Cannot save as PDF - "Could not save a copy as (filename) because the file is already in use..."

    I have a number of PSD files I've created and I'm trying to save them as PDFs.
    I can Save for Web and Devices, I can save as a .gif, .eps., and every other format I've tested, but I cannot save as a PDF. I get the error:
    "Could not save a copy as (filename) because the file is already in use or was left open by another application."
    I'm running Adobe Master Collection CS5 with Photoshop CS 5.5 (12.0.4 x64) on a Windows 7 64-bit machine.
    I have a 928 GB HD with 697 GB free.
    I have rebooted and tried saving the files immediately after I reboot. I have killed my virus scanner. I have killed a number of other possible culprits including Acrotray.exe and CS5ServiceManager.ext
    I have run Process Explorer as recommended by Microsoft and found no applications using the file. I've also tried saving the file to my external hard drive and/or renaming the file with only rare luck.
    Nothing seems to fix it.
    The boards seem to suggest Adobe isn't taking responsibility for this and pointing it back to the OS or other software. I'm willing to believe them if someone can show me how/where to kill whatever process it is - but at this point, all my indicators point back to Photoshop.

    Here is a clip from a past post where user could not drag and drop files to hard drive.
    To my great relief I have now sorted this issue and offer the following as the Correct Answer. My sincere and grateful thanks go to Curt and Yammer, above, who have helped me so much in sorting this Windows 7 issue which is clearly very relevant to Bridge users also. Any slowness to grasp what they have been saying is down to me!
    The key to solving this issue lies is understanding that in terms of Windows 7 Security, every internal or external hard drive, plus folders, sub-folders and files thereon has an OWNER. Also each OWNER has a certain level of PERMISSION to do things such as moving files to a different folder, deleting or re-naming them etc. If you try to do things that you don't currently have Permission to do, that is when you get an ‘Access Denied’ error message. Also your system has an Admistrator or Administrators and at the outset you need to ensure through the Control Panel that you are listed as one of them. .
    If, like me, you didn't realise these things, (and why would you if Microsoft or your computer or hard drive suppliers couldn't be bothered to really make sure you knew about them), then trying to fathom the ‘Access Denied’ problem becomes a stressful and frustrating nightmare as I can testify having spent a week at it!
    The steps that I took to resolve the issue and which I believe now constitute the 'Correct Answer' are as follows:
    First make sure that you have Administrator rights on your system via the Control Panel
    Next ‘right click’ on the Drive whose files you want to gain full access to, for example the drive that your pictures are stored on, and click on 'Properties'.
    Under the Security tab you will see a list of Groups and Users on this drive and the Permissions that they have to do things.
    Before doing anything to edit these Permissions, first click on the Advanced button. This opens another window with a tab showing the Owner of this drive.
    Click on the Owner tab and if you are not already listed as the owner, make yourself the owner by selecting your name from the list. I believe it should appear there if you are an admistrator or user. (In my case at this stage the owner was initially shown as an obscure string of numbers and letters which I believe identified the drive when it was connected to the lap top I was using before I upgraded my machine)
    Now be sure to check the box that says "Replace Owner on Subcontainers and Objects" and the click Apply. On completion of this step, the drive in question and all the folders, subfolders and files thereon should now be 'owned' by you. You could check this out by right clicking on a particular folder then clicking Properties > Security > Advanced > Owner. Your name should appear. So far so simples!
    Now go back to the Security Tab for your drive (Step 2 / 3 above) and look at the Permissions you currently have. Your aim now is to allow yourself 'Full Control.' If you don’t currently have this level of permission click Edit, select your name on the list, check ‘Full Control’ and 'Apply' the change.
    I think I'm right in saying that at this point whilst still working in the Drive directory you are now given the option of ticking boxes which allow you to, in effect, cascade the permission you have just granted yourself to all the files and folders on that drive. Tick the box to allow this and Windows should then take care of the rest.If I'm not quite correct here then in my particular case, for example, all my images were stored on my external drive. The top level, or 'parent' folder in which all my pictures could be found was the 'My Pictures' folder and I had created a number of folders and subfolders ('child ' folders) within that folder. The permissions I gave to the Parent folder – My Pictures – were cascaded down through the Child folders.
    On completion of the above step I tested the result in Windows Explorer by dragging a few files back and forth between folders and it now worked perfectly - I was now able to move / delete / rename etc all files without now getting the dreaded access denied message. What a sense of relief! This meant that I could now open Bridge normally rather than having to right click it and 'Run As Admistrator' - albeit that is a very useful thing to do until you get the problem sorted as described.

  • How do I make the file extension (ie:  .tif, .jpg, .eps) in OS 9.2 visible?

    I'm trying to transfer files from an old G3 (OS 9.2) to a new G5 (OS 10.5.8). Most files do not show the extension in their name. For example, an Illustrator eps has the file name "layout_final". When I transfer it to the new machine, it recognizes it as an .EXE file and cannot open. If I type in the .eps file extension, where is now reads "layout_final.eps", it then opens in Illustrator. I don't want to have to resort to manually adding in the file extension to every file. Is there a way in OS 9.2 to automatically show/turn on the extension in the file name?
    Thanks for the help!
    Steve

    How are you transferring the files ?
    It sounds like you're going through some sort of Windows / DOS formatted media.
    If you can network the two Macs together instead, do so.
    If you can burn a CD or two on the Mac G3, do so.
    If you have to use a USB stick, format it to Mac HFS Extended (aka HFS+) on either and use that.
    The key is that if you transfer the files using something formatted for Mac, the file metadata should not be lost, and the files will appear on the G5 as expected, assuming that you have suitable apps to open the files in OSX 10.5

Maybe you are looking for

  • VAMT Queries

    -          Can we activate office 2013 pro plus volume license edition using VAMT 2.0

  • Show calculate field blank on a fillable form

    Hi I have created a form with a sum calculation. Does anyone know how to show the total blank before the form is filled in. At the moment the total shows 00.00 This needed so people have the alternative to print it out blank and fill it in by hand. I

  • Two yaxis on one graph

    I bet this has been asked a million times before but the search function on this bloody website never works. To prove this I typed array in the search and I got no hits back!! I have 4 thermocouples two at 400degC and two at 20degC would like to disp

  • 5.1 surround sound from macbook pro, external soundcard (USB)

    I've been spending lots of hours searching for some kind of a external soundcard that is compatible with mac. I have a logitech x-530 and need to find a solution on how to get it working. (true surround..) Im not sure what you call it, but i think it

  • WAD 7 + Clear variables issue

    Hello Guys, I'm trying to clear the variables, but it doesn't work. I use he standard command in template properties, but no result. Please help me with this issue. Regards, Renato.