Implementing a Flash app- Questions

Status
Not open for further replies.
I'm designing an investment strategy suggestion Flash application, and am running into difficulties regarding accessible variables in a timeline.

The sequence of the app goes like
  • Ask user for initial investment, time, and possible withdrawal amt
    Display suggested strategies in the form of 3 100x300px vertical bars and text description overlay on the same view as above- will be made as graphical symbols
    user selects strategy, view changes to display the following:
    • -25 yr record of strategy performance
      -pie chart of portfolio breakdown
      -line graph of projected performance
    User selects create new acct, or goes back to the input view

So far, I have two graphical timeline layers, one contains the background, the second is split into two with keyframes. The first half is the ask information view, the second half is display past and projected performances of the selected strategy. I also have a script layer running the same length as the background layer, and this will have all my code.

Say I have a keyframe on the script layer at Frame 15 that is a stop point after clicking a button. From that frame, how can I access the variables from the previous frames?
 

Mile Zero

Ars Praetorian
578
Subscriptor++
daredevil82":2t4kypf3 said:
I'm designing an investment strategy suggestion Flash application, and am running into difficulties regarding accessible variables in a timeline.

The sequence of the app goes like
  • Ask user for initial investment, time, and possible withdrawal amt
    Display suggested strategies in the form of 3 100x300px vertical bars and text description overlay on the same view as above- will be made as graphical symbols
    user selects strategy, view changes to display the following:
    • -25 yr record of strategy performance
      -pie chart of portfolio breakdown
      -line graph of projected performance
    User selects create new acct, or goes back to the input view

So far, I have two graphical timeline layers, one contains the background, the second is split into two with keyframes. The first half is the ask information view, the second half is display past and projected performances of the selected strategy. I also have a script layer running the same length as the background layer, and this will have all my code.

Say I have a keyframe on the script layer at Frame 15 that is a stop point after clicking a button. From that frame, how can I access the variables from the previous frames?

Honestly, the solution is not to design your movie around timelines as a code layout tool. They're not very good at it. You should be looking at ways to encapsulate your two views into either MovieClip objects that you move on and off the stage, or as custom classes that you instantiate and destroy as needed. Do your animations in code using Tweens.

That said, within the MovieClip class (which is, actually, what Flash is compiling your frame-by-frame code into behind the scenes) anything that was declared at the "global" scope in previously-played frames will not vanish from the scope when you change frames. And the AS3 code itself has no concept of "layers"--they're an abstraction of the actual display tree. So don't worry about layer scope either.
 
Status
Not open for further replies.