How to dedicate certain classes to certain frames?
I don't go through details at this stage and just explain my issue:
How can I assign different classes to different frames? For example class A to frame 1, classes B & C to frame 2, D to frames 6 and 10...
I'm programming a game by AS3 in Flash CS5 which I want different frames to act as a whole different game level and totally different classes except one, lets say THE HERO:p Which means I don't want to code the frames directly and just want them to read class files and then they do the job.
You may not need to read the rest but in case you have time:
"The whole game has some pages such as intro, personal profile, options etc and then levels, and all in different frames. Every frame has its own code and the level frames may only share 1 or 2 custom classes. The point is I want to be able to have variables with the same name in different frames but not having the same meaning! var/function "a" is defined in 2 frames but not considered duplicated! And that's the reason i need to read different .as files in different frames and when going to next frame everything from the last one should be vanished, gone (except the user data such score which is saved in a specified class). The main reason I'm currently facing this issue is that I've already coded the whole game in the Main Class and put/removed all the backgrounds, objects, eventListeners as the player goes through levels, dynamically and the variety of values is killing me. So i decided to program every frame as a whole new level and place the visual objects of my scenes by Hand on the screen!"
Please tell me if the path I've taken is totally wrong. This is the first semi-complicated game I'm making and I wish to learn the correct way to program such games having many different levels in the mean of code and visual objects. Any suggestion?
I apologize for my poor grammar and misspellings.
