Guest User

Untitled

a guest
Oct 28th, 2011
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. if(contentArray[0] == "cords"){
  2.  
  3. if(Boolean(this.getChildByName(contentArray[1]))) {
  4.  
  5. var mousex = contentArray[7];
  6. var mousey = contentArray[9];
  7.  
  8. var avatarx = contentArray[3];
  9. var avatary = contentArray[5];
  10.  
  11.  
  12.  
  13. if(contentArray[1] == "avatar"+id){
  14.  
  15. }else{
  16.  
  17. stage.addEventListener(Event.ENTER_FRAME, loop);
  18. function loop(Event)
  19. {
  20.  
  21. if (mousey>getChildByName(contentArray[1]).y)
  22. {
  23. getChildByName(contentArray[1]).y += movespeed;
  24. }
  25. if (mousey<getChildByName(contentArray[1]).y)
  26. {
  27. getChildByName(contentArray[1]).y -= movespeed;
  28. }
  29.  
  30. if (mousex>getChildByName(contentArray[1]).x)
  31. {
  32. getChildByName(contentArray[1]).x += movespeed;
  33. }
  34. if (mousex<getChildByName(contentArray[1]).x)
  35. {
  36. getChildByName(contentArray[1]).x -= movespeed;
  37. }
  38. }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment