-
path naming conventions
hi,
i'm working on a student flash standalone application with a friend. we split our work such that we create separate games which will be put together in a single flash movie.
usually i just call my variables by _root.something, but now should i call it by _root.myGame.something or there is a better way to go about it? I am afraid we might have trouble integrating our games into a single movie after we finished them.
thanks.
-
Retired Mod
how will you integrate the two games? They will be separate SWFs loaded into a single holding SWF?
-
yes, that's right. in fact there will b more than 2 games. because they r goin 2 share some variables, like perhaps username.
-
Senior Member
Using _root is liable to mess everything up once a movie is loaded into another.
If you want to put you variables in a place you can access easily from anywhere, you should use _global.
As for having conflicting variable names, the only real solution to this is to use a naming convention so that you and your friend don't ever accidentally overwrite each others stuff.
Probably the best way to do this is to make a global container for each movie's variables.
So you'd do something like:
code: _global.footballGame.var1
or
code: _global.sam.var1
The best thing to do is to agree on a strategy for naming and then both of you stick to it; it'll save a lot of headaches in the end.
Sam
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|