Organization of document class?

Hi team,

I use a document class for a project to keep away the main timeline code - the only problem, it is now my document class is currently running at nearly 2,000 lines of code and becomes unwieldy to scroll and find stuff.  Is there a way I can better organize this? Or should I be building in a different way?

I don't really know very about how the classes actually work.  I had this working document class, but it's as good as it gets. Any help would be greatly appreciated.

see you soon

Void

When you are thousands of lines of code, there is not a lot you can do to avoid having to scroll through it to find things, you can do things to reduce the amount of scrolling necessary.

What you could do is to go through the code and organize it into functional sections.  To help the need to scroll to find things, you can use keywords in the form of comments in combination with the search tool (the magnifying glass in the toolbar) and use it to access the sections.

You could probably break down everything in separate class files, but then it might be more difficult to handle that you must remember what file you will have to look for different things.  However, for the major functional divisions, this can be useful.

Tags: Adobe Animate

Similar Questions

  • How to organize the documents and PDFs on a mini iPad 2

    Hello! I am new to Apple and I'm happy to have a mini iPad 2 and iPhone 4 s. I used to be a windows user and I am more familiar on how to organize my documents and pdf files. Can someone help me on how can I transfer some of my documents and my pdf files in my mini iPad 2 and used it? This will be very useful for me. Thank you

    Read here: http://help.apple.com/ipad/9/#/iPad5ecae3c6

    and here

    Sync a PDF file. On a Mac, add the PDF file to iBooks for OS X, open iTunes, select the PDF, and then synchronize. In iTunes on your Windows computer, choose file > Add to library, select the PDF, and then synchronize. See iTunes help for more information on synchronization.

  • How can I organize my documents in alphabetical order in their folders?

    I can't find a way to organize my documents or images in alphabetical order inside of a folder - I have tons of photos too with numbers and title as 002Crystal_Vase in the example and I was not able to organize, by number, the way it was in XP. I use Windows 7. If I choose (arrange the name"docuents in the folder just 'disappear' so the only option is"organize them by folder", which is not in a logical order!)
     
    Thank you very much!
    Karla

    Hey Kaka1004,

    With arrange by: option set for the folder, try to set the sorting: option for the name. You can do this by using the context menu or by following these steps:

    • Open the folder in question
    • Press Alt + V on your keyboard
    • Click on organize by
    • Click the folder
    • Press Alt + V on your keyboard
    • Click on sort by
    • Click on the name

    Hope that helps.

  • Can extend us the document class with a custom flash as3 class?

    Hello
    Can extend us the document class with a custom flash as3 class?

    Thank you
    Mallek

    Try:

    amishap67776642 wrote:

    package

    {

    public class accessories extends ScreenBase

    {

    public void accessories()

    {

    Super();

    addEventListener (Event.ADDED_TO_STAGE, onAddedTostageHandler)

    }

    private void onAddedTostageHandler(e:Event):void

    {

    Super.init ();

    }

    }

    }

    / * class ScreenBase * /.

    package

    {

    SerializableAttribute public class extends MovieClip ScreenBase

    {

    public void ScreenBase)

    {

    Super();

    }

    public void init (): void

    {

    MovieClip (that).tutorialBox_mc.visible = true;

    }

    }

    }

  • Access the function of the other class Document class

    I have this Enemy.as code that calls a function playerTurn() in Main.as, which is also the document class.

    var rootRef:Main;

    rootRef.playerTurn ();

    This is playerTurn()

    public void playerTurn(): void {}

    player_turn = true

    menu = battle_men

    menu.attackBtn.addEventListener (MouseEvent.CLICK, atkClicked);

    }

    After this code runs, I get

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    at CharacterClasses::Enemy/initEnemyTurn() [C:\Users\***\Documents\SonicUltimateSceneCreat or\CharacterClasses\Enemy.as:23]

    Line 23 Enemy.as is rootRef.playerTurn ();

    Why I get this error?

    I got it.

    Object (parent) .playerTurn () worked well, but the function in which this line was performed was based on an event listener, as follows

    public void initEnemyTurn(evt:Event):void {}

    removeEventListener (Event.ENTER_FRAME, initEnemyTurn);

    player_turn = Main.player_turn;

    {if (player_turn)}

    addEventListener (Event.ENTER_FRAME, initEnemyTurn);

    }

    else {}

    Object (parent) .playerTurn ();

    }

    }

    initEnemyTurn is attached to an ENTER_FRAME listener, which was not readded in the else statement, thereby breaking the code.

    The reason why it was delete in the first line of initEnemyTurn is so does not run twice while the first tries to determine the player_turn.

    So it turns out that none of this had to do with the access to the function...

    Thanks for the help!

  • How a textInput variable can access a document class?

    I have a document class that creates a body of text on the fly during execution.  I am trying to understand (although I have not taken measures to do it again) how to use a field textinput onstage of a Flash document that calls the Document class "MyClass" (just for the sake of the example").  The class file is located in the same directory as the FLA and SWF resulting is MyClass.as  I wish that this value textInput.text to change the text of the body of the text MyClass.  I use MyClass is because I'm the scene special visualizations with text that are encapsulated in MyClass.

    Thanks in advance for any comments.

    -markerline

    a reference to the main timeline will reference the document class.

  • Do not load, HELP document class!

    It happened all of a sudden, after I started having some weird (not valid, I swear!) errors in a class (cannot access undefined property... THERE TAKES PLACE)

    After awhile, I just removed everything in the class and began to add parts back little by little.

    But then all of a sudden there was an empty window when I tested it... So I checked (button Edit) the document Main.as class, and it was a default one created by flash!

    I tried different solution to workaround: Rename .fla, rename Main.as, but nothing works! It will not just load the document class

    I just want to know if there may be something obvious I did not see or think.

    Thank you.

    [Win7 64 bit, sublime text 3]

    EDIT: I want to just emphasize that while debugging, I noticed my sources files had disappeared from the AS3 properties... until everything points to a corrupt file.

    I don't see a way to export all the assets of a CFC, but by registering as uncompressed xfl, but then is it possible to import all the ASSETS folder?

    Well, yet another bug?, probably a corrupt file that I invited.

    Copied the entire library of select all > copy and pasted into a new Florida... now its working, I just have to reconfigure all the...

  • class does not not with the document class

    I created classes that is available to my level. So level 1 includes a table like:

      floor1[0] = [2,1,1,1,1,1,2];
      floor1
    [1] = [1,1,1,1,1,1,1];
      floor1
    [2] = [1,1,1,2,1,1,1];
      floor1
    [3] = [1,1,1,1,1,1,1];
      floor1
    [4] = [1,1,1,2,1,1,1];
      floor1
    [5] = [1,1,1,1,1,1,1];
      floor1
    [6] = [2,1,1,1,1,1,2];

    And level 2 would contain a different as configuration:

    Floor2 [0] = [1,1,1,3,1,1,1];
    floor2[1] = [1,2,1,3,1,2,1];
    floor2[2] = [1,1,1,3,1,1,1];
    floor2[3] = [1,1,1,2,1,1,1];
    floor2[4] = [1,1,1,3,1,1,1];
    floor2[5] = [1,2,1,3,1,2,1];
    floor2[6] = [1,1,1,3,1,1,1];

    Here's my problem. These classes are not connect with my document class. My document has an empty array named createFloor which will equal level 1 first. Once this level is completed, it will be equal to floor2 and so on. The code is below:

    for (var y = 0; Y < createFloor.length;. Y++)

    {

    for (var X:int = 0; X < createFloor [Y] .length; X++)

    {

    var cell: MovieClip = new Tile (X, Y);

    cell.gotoAndStop(createFloor[Y][X]);

    Cell.x = ((X-Y) * tileh) 365;

    Cell.y = ((X+Y) * tileh/2) + 70;

    addChild (cell);

    cell.addEventListener (MouseEvent.CLICK, mouse click);

    cell.addEventListener (Event.ENTER_FRAME, onGame);

    }

    }

    I don't know how to get the document classes and level to talk with each other. I tried to do the level class to extend the hand, but I fugre that had nothing to do with it. All ideas

    change your class Level1:

    package {}

    import flash.display.MovieClip;

    SerializableAttribute public class extends MovieClip {} Level1

    public var floor1:Array;

    public void Level1() {}

    Level 1 = new Array();

    LEVEL 1 [0] = [2,1,1,1,1,1,2];

    LEVEL 1 [1] = [1,1,1,1,1,1,1];

    LEVEL 1 [2] = [1,1,1,2,1,1,1];

    LEVEL 1 [3] = [1,1,1,1,1,1,1];

    LEVEL 1 [4] = [1,1,1,2,1,1,1];

    LEVEL 1 [5] = [1,1,1,1,1,1,1];

    LEVEL 1 [6] = [2,1,1,1,1,1,2];

    }

    }

    }

    until level 1 is in the same directory as your document class, in your document class you can use:

    private var level1:Level1 = new Level1();

    trace (Level1.Floor1);

  • access the value in the document class

    Hello I am trying to access a value in the document class. but I can't make it work.

    what I have is:

    can someone tell me how to access the value of myArray?

    Bomberman.As:

    package {}

    import flash.display.MovieClip;

    public class bomberman extends MovieClip {}

    public var myArray:Array = []; trying to access this value

    public void bomberman() {}

    init();

    trace (document.docClass);

    }

    private void init() {}

    var square: Array = [];

    for (var i: Number = 0; i < 11; i ++) {}

    for (var j: Number = 0; j < 11; j ++) {}

    var temp: grassSquare;

    If (i == 0 |) I == 10) {}

    Temp = new grassSquare (i * 50, j * 40);

    addChild (temp);

    Square.push (temp);

    } Else if (i %2! = 0) {}

    If (j == 0 | j == 10) {}

    Temp = new grassSquare (i * 50, j * 40);

    addChild (temp);

    Square.push (temp);

    myArray.push (false);

    } else {}

    myArray.push (true);

    }

    } else {}

    If (j %2 == 0) {}

    Temp = new grassSquare (i * 50, j * 40);

    addChild (temp);

    Square.push (temp);

    myArray.push (false);

    } else {}

    myArray.push (true);

    }

    }

    }

    }

    }

    }

    }

    Bomberman.fla:

    import flash.events.KeyboardEvent

    var User1:Player1 = new Player1;

    stage.addEventListener (KeyboardEvent.KEY_DOWN, User1.fl_SetKeyPressed);

    User1.x = 75;

    User1.y = 60;

    addChild (User1);

    Player1.as:

    package {}

    import flash.display.MovieClip;

    import flash.events.Event;

    import flash.events.KeyboardEvent

    import flash.ui.Keyboard

    SerializableAttribute public class extends MovieClip {Player1

    private var upPressed:Boolean = false;

    private var downPressed:Boolean = false;

    private var leftPressed:Boolean = false;

    private var rightPressed:Boolean = false;

    private var currentSquare:uint = 12;

    public void Player1() {}

    this.addEventListener (Event.ENTER_FRAME, fl_MoveInDirectionOfKey);

    stage.addEventListener (KeyboardEvent.KEY_DOWN, fl_SetKeyPressed);

    }

    public void fl_MoveInDirectionOfKey(event:Event)

    {

    If (upPressed & & this.y > = 100 /* & & document.myArray [currentSquare-1] * /)

    {

    This.y-= 40;

    upPressed = false;

    currentSquare-= 1;

    }

    If (downPressed & & this.y < = 340 / * & & this.myArray [currentSquare + 1] * /)

    {

    This.y = 40;

    downPressed = false;

    currentSquare += 1;

    }

    If (leftPressed & & this.x > = 125 / * & & /*this.myArray[currentSquare-11]*/)

    {

    This.x-= 50;

    leftPressed = false;

    currentSquare = 11;

    }

    If (rightPressed & & this.x < = 425 / * & & /*this.myArray[currentSquare+11]*/)

    {

    This.x += 50;

    rightPressed = false;

    currentSquare += 11;

    }

    trace (currentSquare);

    }

    public void fl_SetKeyPressed(event:KeyboardEvent):void

    {

    switch (event.keyCode)

    {

    case Keyboard.UP:

    {

    upPressed = true;

    break;

    }

    case Keyboard.DOWN:

    {

    downPressed = true;

    break;

    }

    case Keyboard.LEFT:

    {

    leftPressed = true;

    break;

    }

    case Keyboard.RIGHT:

    {

    rightPressed = true;

    break;

    }

    }

    }

    }

    }

    any class that is added to your list of display:

    MovieClip (root) .myArray

  • get a strange error in my document class

    I have two different external .swf files that load on a parent, I have the same code on each, one works very well but this is giivng me this error,

    TypeError: Error #1009: cannot access a property or method of a null object reference.

    to aavar / frame1)

    at flash.display::MovieClip/gotoAndStop()

    to aavar / mouseA)

    My FLA still works, but I'd like to work on what goes wrong.  I have not all references to this function in my document class, but he doesn't like it!

    What happens here?

    Here is the code that I have on my .swf which loads

    import flash.events.MouseEvent;

    stage.addEventListener (MouseEvent.MOUSE_MOVE, mouseA);

    2.

    function mouseA(event:MouseEvent) {}

    If (mouseX > = 125)

    this.gotoAndStop (1);

    }

    stage.addEventListener (MouseEvent.MOUSE_MOVE, mouseB);

    2.

    function mouseB(event:MouseEvent) {}

    If (mouseX < = 19)

    this.gotoAndStop (2);

    }

    As I said works but if I make mistakes, it cannot be good!

    See you soon

    void

    Sorry guys!

    I worked it out

    I had to use unloadAndStop() to kill the lisetener

    Thanks again for your patience, I think that I am really somewhere and appreciate really everyone's help.

    See you soon

    void

  • Flash CS5 - relative path of the document class and the location of the package

    It seems that I have no trouble to my class a FLA document class project when the FLA is the same root in the root directory of the package. However, if the FLA is nested within a subdirectory, then paths relative to a nested class in the package will not work.

    location of package & sample class: com.company.project.ClassName

    CASES1:

    Package location: \MyProject

    The FLA location: \MyProject

    where is the path of document class: ""./com/company/project " "

    Case 2 (does not work):

    Package location: \MyProject

    Location of the FLA: \MyProject\MySubFolder

    where is the path of document class: "... / com/company/project"

    If someone can provide an explanation as to why nested FLAs cannot point to custom packages to parent directories level OR show how this can be done, it would be much appreciated.

    Now that I think about, the two paths are relative, which makes it more confusing.

    Thank you.

    It works for me: http://www.kglad.com/Files/forums/tt.zip

  • Code moves the timeline to the document class Error 1067

    Hey dudes encoder that I need help on some actionscript 3.

    Im trying to move a part of the timeline code in the document class. Here is the code to the timeline:

    Import Memory.MemoryGame;

    Add memory game

    var memoryGame:MemoryGame = new MemoryGame (this, "settings.xml");

    Here is my attempt to move in the Document class:

    Import Memory.MemoryGame;

    -----

    SerializableAttribute public class MemoryGame extends Sprite

    {

    private var memoryGame:MemoryGame;

    public void init(e:Event_=_null):void

    {

    memoryGame = new MemoryGame (this, "settings.xml");

    addChild (MemoryGame);

    }

    Then I get the error: ActionScript Error #1067: Implicit coercion of a value of type to a type unrelated flash.display.DisplayObject class

    Please help guys :-(

    No, I checked just because you have dc.addChild (this); which is meaningless, unless there is an object of class MemoryGame in your library.  You can delete that.

    change

    public void MemoryGame (dc:DisplayObjectContainer, xmlPath:String)

    {

    Save the params

    This.dc = dc;

    Add to the form

    dc.addChild (this);

    var r: Shape = new Shape();

    r.graphics.beginFill (0x000000);

    r.graphics.drawRect (0,0,800,500);

    r.graphics.endFill ();

    addChild (r);

    load the xml file

    loader = new BulkLoader ("memoryGame");

    loader.addEventListener (BulkProgressEvent.COMPLETE, LoaderComplete);

    loader.addEventListener (BulkLoader.ERROR, LoaderError, false, 0, true);

    Loader.Add (xmlPath, {id: "xmldata"});

    Loader.Start ();

    Add preloader

    g_preloader_back = new Shape();

    g_preloader_back. Graphics.beginFill (0x000000);

    g_preloader_back. Graphics.drawRect (0, 0, 200, 5);

    g_preloader_back. Graphics.endFill ();

    g_preloader_back.x = stage.stageWidth/2 - g_preloader_back.width / 2;

    g_preloader_back.y = stage.stageHeight/2 - g_preloader_back.height / 2;

    addChild (g_preloader_back);

    g_preloader_bar = new Shape();

    g_preloader_bar. Graphics.beginFill (0xFFFFFF);

    g_preloader_bar. Graphics.drawRect (0, 0, 196, 3);

    g_preloader_bar.y = stage.stageHeight/2 - g_preloader_bar.height / 2;

    addChild (g_preloader_bar);

    g_preloader_text = new QuickText (g_preloader_back.x, g_preloader_back.y + 10, 'Loading XML...', 10, 0, false, false, false, null);

    addChild (g_preloader_text);

    UpdatePreloader (null);

    Add the sound Manager

    soundManager = new KSGSound();

    }

    TO

    public void MemoryGame()

    {

    Save the params

    If you use "this.dc" anywhere else, replace it with 'this '.

    This.dc = dc;

    Add to the form

    dc.addChild (this);

    var r: Shape = new Shape();

    r.graphics.beginFill (0x000000);

    r.graphics.drawRect (0,0,800,500);

    r.graphics.endFill ();

    addChild (r);

    load the xml file

    var xmlPath:String = "settings.xml";

    loader = new BulkLoader ("memoryGame");

    loader.addEventListener (BulkProgressEvent.COMPLETE, LoaderComplete);

    loader.addEventListener (BulkLoader.ERROR, LoaderError, false, 0, true);

    Loader.Add (xmlPath, {id: "xmldata"});

    Loader.Start ();

    Add preloader

    g_preloader_back = new Shape();

    g_preloader_back. Graphics.beginFill (0x000000);

    g_preloader_back. Graphics.drawRect (0, 0, 200, 5);

    g_preloader_back. Graphics.endFill ();

    g_preloader_back.x = stage.stageWidth/2 - g_preloader_back.width / 2;

    g_preloader_back.y = stage.stageHeight/2 - g_preloader_back.height / 2;

    addChild (g_preloader_back);

    g_preloader_bar = new Shape();

    g_preloader_bar. Graphics.beginFill (0xFFFFFF);

    g_preloader_bar. Graphics.drawRect (0, 0, 196, 3);

    g_preloader_bar.y = stage.stageHeight/2 - g_preloader_bar.height / 2;

    addChild (g_preloader_bar);

    g_preloader_text = new QuickText (g_preloader_back.x, g_preloader_back.y + 10, 'Loading XML...', 10, 0, false, false, false, null);

    addChild (g_preloader_text);

    UpdatePreloader (null);

    Add the sound Manager

    soundManager = new KSGSound();

    }

  • Help document class.

    Hey,.

    I have a class called 'Main' that functions as a document class, but the class, I want to work on a few images only. I can't use MyClass:Classname = new Classname(); because it works the same.

    What happened with it as the document class, it's all my functions game happened on all frames when I want the games functions to occur on some images.

    So my question is, how do you get a class to work the same a document for specific senior class?

    Is it possible to import the class 'Hand' that will work the same using the document class MyClass:Main = new Main();? Because of my knowledge which are objects.

    Thank you.

    Document class controls the behavior of the file file swf in full (the main timeline). You cannot assign just a class for specific frames, flash does simply not like that.

    If by 'functions of game', you mean listeners of mouse and keyboard, you must set the functions activateGameControls() and deactivateGameControls() in which you add or remove the eventListeners. Then, when you leave your "frames game" you call just deactivateGameControls() function.

  • AS3 preloader for a SWF with document class

    Hello

    I created 1, 5 MB swf file and I need of preloader for it. I don't have the code for any scenario in there. All written in OBJECT-oriented programming, based on the document class. I caught a preloader to my previous projects, but this one does not. The output is: ' TypeError: Error #1009: cannot access a property or method of a null to myDocumentClass() object reference '

    Basically, I want to load swf in my swf preloader or all that will work. I tried to add loaderInfo to my document class but complete event not triggered when everything is loaded, and nothing that before. Just a white screen.

    How to load my large swf with document class in preloader.swf?

    Strange that you don't get line numbers in error when running in debug mode. Try to enable debugging in settings of publication-> SWF-> Advanced-> permit debugging.

    Another strange thing is that error that says ' DocumentlClass()' but your document class is called 'CarouselClass '.

  • Creating a function gotoAndPlay a button in a document class

    Heya! I had a simple block of code that stops the main scenario on a certain range, but so far I've been unable to form a code which would be gotoAndPlay when mouse click happens on a button I've done, and you mind, I do this in a document class.

    I've heard different instructions how to make the key, some say make it a movieclip, some say nest within a clip... so if someone could point me to a tutorial how do for this to happen, or would have an idea on this, it would be welcome!

    Keep things simple for yourself and just create a movieclip and assign a code by clicking on it.  Create the movieclip and give it an instance name in the scene, maybe call it btn_mc.  Then add code for it in the scenario where the button is...

    btn_mc.addEventListener (MouseEvent.CLICK, goPlay);

    function goPlay(evt:MouseEvent):void {}

    gotoAndPlay (#);  # corresponding to any image you intend to go to play

    }

Maybe you are looking for

  • I want to change start page 'pages to the Canada' in Australia pages, how can I do this?

    I want to change my search return pages to the pages of the Australia. He went to get fixed last week, and it now shows pages in the Canada, which is not good for me since I live in Australia.

  • Watch for problems on Yosemite 10.10.5 on MacBook Pro

    I run my MacBook Pro (15-inch, mid 2010) with Yosemite 10.10.5. Since the loading of Yosemite, I have problems with the MacBook is running slowly. I think the problem is with the driver for my external monitor of LG W2240T. I can't type a 6 letter wo

  • UFFMQ. EXE

    I have the UFFMQ service. EXE listed.  He is stopped and disabled.  It is shown to be the... Settings\Temp folder, but the file is not there.  Don't know what program it came from.  Shows not all dependencies, so I would remove it.  Is anyway to remo

  • Vista - lost disk, need to reinstall

    lost the disk had to reinstall number

  • G42-230BR upgrade

    Hello. I would like to know how can I upgrade G42-230BR How can I exchange the i3 processor? Can I insert an i5 or i7 64 bit? It works well with the motherboard? If I install Windows 7 64 bit on G42-230BR before upgrade? Is there anything else I can