flash - Dynamic MC's path with localToGlobal Problems -


I am adding several examples of one MC (bread_mc) in a container MC (wall_mc). Wall_mc has been added to a shop category and this is where I have scrolled the wall_mc apart from my other works and on the right mousex and amp; Mousewise Price I have set a function to add Roti_MC to the wall on separate x / y positions.

Function Call:

  BhelShelvs (bread_mc, bread, 600,200);  

Function:

  Fill the function Sails (Product MAC: Movie Clip, Classname: Class, Product X: Number, Manufacturer: Number) {newProduct = new ClassName (); NewProduct.x = productX; NewProduct.y = productY; Shelf_mc.addChildAt (newproduct, 1); NewProduct.addEventListener (MouseEvent.MOUSE_DOWN, dragProduct, Incorrect, 0, true); }  

I have added a drag / drop where the roti_mc will return to its shelf x / y position. Although I would like that when the user is added to the highest depth at MoUISEUINA bread_mc, while dragging, it remains countless of other MC (for example, a person with a shopping cart).

My problem is, whenever I call the function dragProduct ();

  function dragProduct (e: MouseEvent): zero {currMC = (e.target as a movie clip); This.addChild (currMC); Forum. AddEventListener (MouseEvent.MOUSE_UP, dropProduct); }  

Damn roti_mc I click on the trick with the same amount I have scrolled through the wall. I_mc I have tried to stick Kirkromacy with mouse x / y, but it An ENTER_FRAME function will be required and it seems that it is very complex.

I researched and found localityGlobal methods of this type:

  point = new point (currMC.x, currMC.y); CurrMC.localToGlobal (point); Trace (point.x);  

I do not even know that I am using it right, but I feel that my problem lies in the fact that to visit and meet the tree of the exhibition list I need a cruel race path for the global phase X / Y status I am not even convinced how local techniques implement a dynamic path with global method.

Any help would be appreciated. Even if he is going here> read it. Thanks

Your dragged bread_mc driver moves because it contains a separate container In a different original fill_heli function, you are adding bread_mc as a child of shelf_mc . But in the dragProduct function you are adding it to this . Just try adding bread_mc to shelf_mc with this .

When you call addChild , then it will target all its brothers' front.


Comments