A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Switching between scripts/class

  1. #1
    Junior Member
    Join Date
    May 2008
    Posts
    19

    Question Switching between scripts/class

    What is the best way to swap/toggle between scripts when clicking on a button.
    i have two as files - one is for a drawing tool and the other is for a writing tool. I am trying to 'switch' between the two codes when clicking on a button labeled 'Write' and another button labeled 'Draw'.

    Is it possible to change the 'Document class'? I don't know if this makes sense

    Any input appreciated. Thanks

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    It is not possible to change which class is the document class on the fly. Generally what you'll want to do is have a main class (document class), which instantiates both writing and drawing, and swaps them in and out of the displayList as necessary.

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