-
does flash have variable indirection? if u dont know what that is, just read this...
im trying to make a game of tanks in flash and the terrain will be just a ton of little green squares beside each other to resemble a hill....
______________________________________________
var x, y
for (x=1;x<=Stage.width/5;x++) {
for (y=1;y<=Stage.height/2/5) {
}
duplicateMovieClip(Ground,#"Ground"&x&","&y,this.g etNextHighestDepth());
}
______________________________________
whoever has a Ti-89 titanium calculator and can program on it would recognize that "#" as the indirection symbol... well it didn't work in flash.
now what i want to happen is it duplicates the "Ground" movie clip (just a simple green square) and the new movie clip will be named "Ground12,13" for example. i want the name of the movie clip to include it's x and y coordinate, or simply an incrementing number value. how can i do that??
-
Uses MX 2004 Pro
You could use the depth of each new clip to differentiate the tiles. For example:
Code:
level=_root.getNextHighestDepth();
duplicateMovieClip(Ground,"Ground"+level,level);
I'm not really sure what you are trying to do (aside from creating tile effect), but I've attached an example file that may help you with the syntax you'll need to achieve your goal.
-
The Flashman
dont use the comma --> Ground12,13
use an Underscore instead ---> Ground12_13
duplicateMovieClip("Ground","Ground" + x + "_" + y, newLevel)
i eat actionscripts for breakfast
-
hey thanks that's what i needed to know
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
|