Skip navigation
Currently Being Moderated

Why does Flash generate invalid class names for library items?

Jul 9, 2013 8:23 AM

I imported a bunch of bitmaps (PNGs).  The library symbol names all included the full file name and its extension.  When I check "export for actionscript" it generates a class name based on the symbol name, and it includes the ".png", even though that's invalid in a class name.

 

When I select multiple bitmaps and choose properties and export for actionscript, it has a note saying that classnames will be automatically generated for all items, but it does the same thing... including the ".png" in all the class names.  Is this a problem?  Wouldn't it save time if Flash would automatically strip the file extension from the instance name of bitmap library symbols when generating class names?

 
Replies
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 9, 2013 9:56 AM   in reply to James22s22

    there's nothing invalid about those class names.

     

    those names probably are NOT what you want but they could be used so, flash won't complain.

     

    p.s.  flash cc handles that issue differently from previous flash versions.

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 9, 2013 9:58 AM   in reply to James22s22

    Hi James,

     

    This is how it used to work in Flash CS 6 wherein, the auto-generated class name for any library item used to be the same as the item's name. You would then have to manually correct the name if required.

    This behavior has been changed in Flash CC. The class names are now generated correctly (special characters get removed, symbol names starting wit a digit get preceded by an underscore and for all bitmaps, the extension gets stripped off the class name). You may still modify the classnames manually to suit your naming convention .

     

    Hope this helps.

     

    Thanks!

    Nipun

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 10, 2013 1:01 PM   in reply to James22s22

     

    kglad, what I'm saying is that an image file name like "ball.png" is not a valid "class name", because it contains a period, which is reserved as a package delimiter.

    like i said, it's still a valid class name. and, like i said, it may not be what you want.

    bottomline:  it's a valid class name.  i'm not arguing that it's desireable or expected or useful (though there is, at least, one situation where it would be useful).

     

    This problem has been fixed beautifully in Flash CC.

    yes, like said.

     

    Nipun, it would actually be very helpful to have a little more control over the class naming conventions.  For example, if I wanted all my BitmapData classes to exist in an "images" folder or package, it would be helpful if in the batch properties window I could specify a package name for all the auto-generated class names.  When importing hundreds of images, it's very tedius to have to edit them individually and I don't always have time to write a JSFL script.  There's room in that window to add a text field for a package name.  Thanks!

    write 1 jsfl file and reuse it.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Jul 12, 2013 12:36 PM   in reply to James22s22

    camera.jpg

     

    if you think adobe should use "fully qualified class name" and "fully qualified base class name" instead of "class" and "base class" submit your request here:  https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform

     

    also, you can submit your other (including textfield-related) requests there, too.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points