A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] Custom Class named the same as Flash Class, problems?

  1. #1
    Senior Member
    Join Date
    Jan 2006
    Posts
    133

    resolved [RESOLVED] Custom Class named the same as Flash Class, problems?

    All,

    I understand it's probably best practice to name your custom classes differently than the built-in AS3.0 classes; however, what kind of problems could I run into if I don't?

    Specifically, I have a class which, ideally I want to name DataProvider. But, as you know, there is already a DataProvider class on the Flash platform (used for list-based components and such).

    Now, I don't think I'll ever use BOTH of those classes, so I'm assuming as long as I reference the correct DataProvider class in my import statements I should be ok?

    What if I DO need to use both, is that even possible?

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Yes, it's perfectly possible. Your DataProvider will be in a different package from the built in DataProvider. If you're using one or the other, just make sure you include the right one.

    If for some weird reason you need to use both, you'll need to fully qualify the type name when you use it, which can be annoying.

  3. #3
    Senior Member
    Join Date
    Jan 2006
    Posts
    133
    Thanks, I'll probably just call my class DataSource or something, sometimes the best names are already taken by Flash, so it just got me thinking.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center