Game Development Reference
In-Depth Information
Let's combine this with jqi?deh`naj inside a bkn loop to view the instance names of all the objects
on the stage:
1. Add the following code to the constructor method:
lq^he_bqj_pekjI]ej[>qc?]p_dan$%
w
]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjAjpanBn]ia%7
bnkc*]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjBnkcHkkg%7
bkn$r]ne6ejp9,7e8jqi?deh`naj7e''%
w
pn]_a$e'*'cap?deh`=p$e%*j]ia%7
y
y
2. Save the I]ej[>qc?]p_dan*]o file and test the project. This loop runs for as many times as
there are objects in the display list, which is the number provided by jqi?deh`naj. You'll see
something that looks similar to this in the Output panel:
,*ejop]j_a-
-*ejop]j_a4
.*s]pan
/*lh]uan
0*lh]pbkni0
1*lh]pbkni4
2*lh]pbkni5
3*lh]pbkni/
4*lh]pbkni2
5*lh]pbkni1
-,*lh]pbkni-
--*lh]pbkni.
-.*lh]pbkni3
-/*lh]pbkni,
-0*bnkc
You can see from this list that in order to get the _]p to appear above the other objects, you need to
move it to the end of the list, to position -0. Another built-in method called oap?deh`Ej`at can do
this for you.
To move the _]p to the end of the display list, you can use oap?deh`Ej`at to give it a position number
that is one less than the number provided by jqi?deh`naj (it has to be one less to compensate for the
fact that the list starts at zero). oap?deh`Ej`at takes two arguments: the name of the object and
the position you want to move it to.
1. Add the following to the constructor method:
lq^he_bqj_pekjI]ej[>qc?]p_dan$%
w
]``ArajpHeopajan$Arajp*AJPAN[BN=IA(kjAjpanBn]ia%7
 
Search Nedrilad ::




Custom Search