Mouse movement while scrolling

Wow .. alright 2 questions for 2 days
Ok so i got the scrolling by this code

Code:
var TheChild = getChildByName("Player");
         
         y = -TheChild.y + 280;
         x = -TheChild.x + 340;


where TheChild is my character so basically my camera follows the character. Good so far but....
I use the mouse click to drop an object .. lets say box .. When the game starts everything is fine .. the mouse moves and when i click the box is spawned from my mouse position .. but when my character starts walking deeper in the level the boxes spawn at the beginning. well the Y position of the boxes change according to my mouse Y position but the X just stays the same ( well not the same but around e certain point).. I think thats because the camera follows the character as he walks but the mouse stays at the same X and Y positions... I dont even know how to explain this -.-... If someone got it and can help thx but i can also make a video showing whats wrong if you dont understand .
Better show us your swf file..

Spawn the box at x+mouseX?

Hard to help, this piece of code is too short.
Neosano wrote:
Better show us your swf file..

Spawn the box at x+mouseX?

Hard to help, this piece of code is too short.


Lol actually you answered my question here 🙂 i was using

Code:
public function mousePressed(e:MouseEvent) {
      
         if (long) {
            CreateBox(e.localX, e.localY, 35, 70, false, new Ground())
         }
         if (short) {
            CreateBox(e.localX, e.localY, 300, 10, false, new Ground())
         }
         
      }



but when i place mouseX and mouseY instead of e.localX and e.localY it works 🙂 thank you
Sorry 😕

Original thread: https://box2d.org/forum/viewtopic.php?t=2597