-
I have 1600 squares that i have to give seperate instance names, 1-1600. Im doing this to make a map editor for a game. I was wondering if there was any way to name them all in actionscript. If any one knows, please help! Im too lazy to name each one!
PS - How do you get the flash banner in your signature?
-
Heres how:
put this code on one frame:
set variable: "wide" = "how may cells wide"
set variable: "high" = "how may cells high"
then create a movieclip for your cells and name it "movA1"
then put this code:
Set Variable: "/:x" = GetProperty ( "/movA1", _x)
Set Variable: "/:y" = GetProperty ( "/movA1", _y)
Set Variable: "/:h" = GetProperty ( "/movA1", _height)
Set Variable: "/:w" = GetProperty ( "/movA1", _width)
Set Variable: "/:row" = "0"
Set Variable: "/:col" = "1"
Set Variable: "/:i" = "1"
Set Variable: "/:f" = "1"
Set Variable: "/:max" = (/:wide*/:high)-1
Set Variable: "/:d" = "2"
Loop While (/:i<(/:max+1))
Set Variable: "/:b" = /:i-/:a
If (/:b =/:wide)
Set Variable: "/:a" = /:a+/:wide
Set Variable: "/:row" = /:row+1
Set Variable: "/:col" = "0"
Set Variable: "/:what" = /:i
End If
Duplicate Movie Clip ("/movA1", /:i+1, /:i+1)
Set Property (/:i+1, X Position) = /:x+(/:w*/:col)
Set Property (/:i+1, Y Position) = /:y+(/:h*/:row)
Set Variable: "/:i" = /:i+1
Set Variable: "/:d" = /:d+1
Set Variable: "/:col" = /:i-/:what
If (/:d=27)
Set Variable: "/:d" = "1"
End If
End Loop
Stop
that will duplicate the movielcips and align them correctly!!
Hope thats Saved u some time!!
Regards FlashGuru
p.s youll have to experiment with the wide and high variables cos the number of cells it duplcaites is wide X high
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
|