simple question for as developer

Posted on 2006-04-08
Last Modified: 2010-04-03
hello everyone, I know this is may be a stupid question, but I just started to code in AS few weeks ago. Instead of having the whole long confusing piece of code in one file, can I "scatter" the different classes in different files?
thanks k
Question by:kugo
    LVL 49

    Expert Comment

    You can use the #include '' statement (don't add a semicolon to the end).

    The path to the as file is calculated from the base of your .fla file.

    so when you have below filestructure and want to include from

    Then you would still have to use:
    #include 'as/'

    LVL 39

    Accepted Solution

    are you using AS2.0 or AS1.0?
    if you're using as2.0 each class needs to be in a separate class file, your class files can be located anywhere though would be most wise to set in one location so you can set your class path.
    also, in AS2.0 you wouldn't use include but rather import.

    in as1.0 you can do it as roonaan says.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now