Copy link to clipboard
Copied
Hi i have a little problem in flash cs4 , there are two items with drag and drop event...
code for box1_mc;
on (press) {
this.startDrag();
}
on (release) {
this.stopDrag();
this._x = orig_x;
this._y = orig_y;
if (eval(this._droptarget) == _level0.box2_mc) {
this._visible=false;
}
these codes working for but if i drag and drop my item to stage(!)
thats alwayz invisible, i mean i drag and drop my item to stage or another one , thats alwayz being invisible but i would invisible only if i drop it box2_mc
is that a bug or my fault can you explain me (sorry for english)
Copy link to clipboard
Copied
As long as you have the ending " } " that is not shown, there is nothing wrong with that code and it works fine when I test it. If there is a bug, it might be in your file, but it is not a bug of Flash. Use the trace() function to see the status of things... see if they agree with what you expect.
Copy link to clipboard
Copied
you are right i have tried now and its worked fine idk but on my projects if i click the items its being invisible.Thanks researching my fail..but hard to find it
Copy link to clipboard
Copied
i found something my movieclips on different layers (for example box1mc on rooms layer other items in objects layer)Action script searchs my item in current layer , it being invisible coz its not on same layer , its on different layer.If i put my items same layer its working fine.Omg how to fix it i dont know
(if acs cant find my item in same layer , onrelease codes working automaticaly and dont see drag drop)
Find more inspiration, events, and resources on the new Adobe Community
Explore Now