A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Help timeline code to class as3

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    28

    Help timeline code to class as3

    Help..
    I have all my code in timeline, and I would like to put it in external classes, It would be easy if I had it all just in main timeline, but when I have code in children of main mc, and deeper, all communicating between themselves on child to parent basis, how to export those codes to separated classes, and keep their comunication? Any examples please?

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    What are the codes in main timeline?
    Give a sample of your fla. CS3.


    arkitx

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    28
    This is a mock up of my file, since its a mess, lets not waste Your time navigating through all code..Never done anything through Document or external classes, so Im totaly lost how to move out timeline codes to external ones..Im running CS 5.5, so the lowest ver of fla is in cs4 i guess..
    Attached Files Attached Files

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    The general principles of using external .as files are simple. To associate a .as file with your main timeline, set the Document Class property of your fla. Your document class .as must extend Sprite or MovieClip. Usually MovieClip, if you have any frames or timeline coding at all (even comments).

    To associate a symbol in your library with a class, set it to Export for Actionscript, and set the class name to match the desired .as class.

    You'll want to learn how packaging and imports work, too.

  5. #5
    Junior Member
    Join Date
    Feb 2010
    Posts
    28
    Ok, got that. Now I have problem of retaining the actual layer order from IDE..
    Main Mc has seven layers of which some are graphics(no instance names), and in IDE layer order they were above of animated stuff, covering it when they should. How I do that thru external class? Graphic (png) layer to stay over mc?

  6. #6
    Junior Member
    Join Date
    Feb 2010
    Posts
    28
    Nevermind..stupid question.. spending too much time on timeline can kill ones deduction..

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