Skip to main content
Inspiring
August 19, 2010
Question

What is the proper way to structure AS3 script layer

  • August 19, 2010
  • 1 reply
  • 405 views

I have an all Flash based website with a few sections and UILoaders for PopUps which open up from image buttons from Product section. (my website is www.888acolyte.com)

PROBLEM:  I have assigned labels to each section of the website. Each section has its own image buttons which open different PopUps. This is the part where the sections differ from one another and thus require its unique part of AS3. However there are main menu buttons present on every section of the site. This is where the sections are identical and require one uniformed AS3.

PRESENT SOLUTION:  I have segmented the AS3 layer by keyframes to match the keyframes of the labeled section. I put the code for all the main menu buttons on the first opening keyframe which plays the intro sequence and the stop(); code as well. Then I put stop(); in the beginning of every single section afterwards, I did not repeat the code for the buttons from the first keyframe but started to add the code required by corresponding section only (i.e. products section has only products relative code, application section has only application relative code, etc. and none of the main menu buttons code from the first opening keyframe, even though the main menu buttons are present on every section).

QUESTION: Should the AS3 layer be one uninterrupted layer with all AS3 code needed for all of the website elements on the timeline or should it be segmented by keyframes per corresponding sections of the webstie and repeat all the code from section to section if the elements and functionality repeat as well?

This topic has been closed for replies.

1 reply

August 19, 2010

I wouldn't recommend using a script layer for something as large as website, it would much more dynamic and perferable if you created a DocumentClass and put the code there and addChild the pages to the screen when you select a new page and removeChild the old page from the screen when before you add the new one so all the main menu objects stay the same without having to duplicate their functionality.