swapDepths and Try with attachMovieClip??


hello,

i have project wihich has multiple frames. user drag numbers (movie clips) area in proper order, can move second tier. user drag remaining proper numbers (movie clips) next branch or section.

the problem, of course is, swapdepth seem getting in way. happens dragged movieclips (placed on stage library) on next frame, dissapear. did trace, , depths seem jump original 20 -16352 or undefined (which dissapear) in next frame.

so, did read, , read, , read these mischievous swapdepths, , tried, , tried many ways around it, no avail. did finad using attachmoviecip or nature solve dilema, have not found sample code work in instance.

i have attached sample of script used on "placed" movieclips. show me example of or way use attachmovieclip item:

thanks in advance

hi

i have done little work swapdepths few pointers might help...

you cant have 2 dynamically created instances ocupying same depth in movie 1 or both disapear, got round by:

_global.depthcounter = 1; // create on _.root set variables movie
then each time swap depth use
this.swapdepths(_global.depthcounter++); // adds 1 depthcounter movieclip sit on new higher depth each time
nb. may add many depths movie depending on how many times use careful im not sure how many levels flash allows!

attachmovie useful because can attach instance library , set depth , remove easly using removemovieclip() example below, have figure out how work application though:

first @ instance in library, right click on , select properties.
then tick box marked export actionscript. adds instance name identifier box. name use when doing call using attachmovie()

_root.attachmovie("movieslibraryname","newname",1); // 1 = depth

you can set _x & _y positions, scale using _xscale & _yscale, set alpha value _alpha... amost other things.
newname._x = 100;

to remove dynamically created instance use newname.removemovieclip();

hope

claire wall


More discussions in Adobe Animate CC - General


adobe

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62