A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: help with classes...

  1. #1
    Flash Incompetent ChaseNYC's Avatar
    Join Date
    Jun 2002
    Location
    new york city
    Posts
    693

    help with classes...

    So i've created a class, which as I have learned requires an external flash file and a command like:

    Code:
    import Class1.as;
    is there anyway to have the as file embedded into the fla so it doesnt need to call an external as file from the same directory? or if that isnt possible can it be called from anywhere on the internet like the following:
    Code:
    import http://www.blanksite/testing/Class1.as;
    mmm signature

  2. #2
    FK Slacker
    Join Date
    Jun 2000
    Location
    vancouver
    Posts
    3,208
    All Actionscript files are all embedded into the SWF when the swf is compiled - once you have created the swf you don't need to - in fact, can't - load the AS file from an external directory...

    K.

  3. #3
    All 1s and 0s dmonkey's Avatar
    Join Date
    Nov 2005
    Location
    Leeds, UK
    Posts
    606
    Hi,

    Firstly, when you import a class, you don't use the '.as' extension. It should look like this:

    code:

    import Class1;



    Secondly, as deadbeat says, once you have published your movie, the class becomes embedded in the .swf file. This means that you only need the class files before you publish your movie. After it is published, the movie will work fine without the .as file.

    Hope this helps.
    "If I have seen further, it is by standing on the shoulders of giants." - Sir Isaac Newton

  4. #4
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    really, you dont even need to use import class1 if you set the classpath to your classes folder, itll automatically do it. say you have a folder called 'project' where all your files are at. and inside that folder, you haev a folder called 'classes' which holds all your .as files, just set the classpath to .\classes and youll be good to go.

    [ps]you can set the classpath is under publish settings. click on as2.0 settings.

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