A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] What the hell, you have load classes on every frame ? :(

  1. #1
    Junior Member
    Join Date
    Dec 2006
    Posts
    13

    [F8] What the hell, you have load classes on every frame ? :(

    I have a custom class I wrote and in every frame I want to instentiate the class into an object I must use the ...... import com.lib.*; command ?

    Am I right or did I miss something ?
    Is there a way to load ( import ) the class libs on the first keyframe of the actions layer and make it available througout ?

    Regards,

    Sean.

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    The import statement does not actually include the class into the frame - it just means you can reference the class without typing the full classpath everytime...ie, both of the following are essentially the same:
    code:

    //---- using import:
    import com.package.MyClass;
    var instance=new MyClass;

    //---- alternately:
    var instance=new com.package.MyClass;


    HTH,

    K.

  3. #3
    Junior Member
    Join Date
    Dec 2006
    Posts
    13
    Thanks for the quick reply.
    Yes, I understand ...

    But, I would like to ( if possible ) do the import just once ( anywhere ... I don't care ... ) and have the class code be available throughout the actions timeline ...

    Is that possible ?

    Thank you for all the help,
    Sean.

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