Skip to main content
Known Participant
August 5, 2013
Question

drag and drop bug in flash cs4

  • August 5, 2013
  • 1 reply
  • 686 views

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)

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
August 5, 2013

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.

Known Participant
August 5, 2013

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

Known Participant
August 5, 2013

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)