SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .X and .Y coordinates of movieClip

    I am creating a game and in the game the user is able to hold spacebar and during that process there is a concrete that will come out of the end of the boom on a pump truck. My problem is that when I try and link the concrete's x and y coordinates to the end of the boom truck (the movieclip of the boom truck) it either shows up in the left corner of the stage or not at all. The final boom arm on the truck is an embedded movieclip. (Example:
    Concrete.x = Truck.Arm_One.Arm_Two.Arm_Three.Arm_Four.Arm_Five. x;
    Concrete.y = Truck.Arm_One.Arm_Two.Arm_Three.Arm_Four.Arm_Five. y

    Does the problem occur because there is too many embedded movie clips inside each other or is there something else that needs to be done?

    Any Suggestions?

    -Script_Goo_Roo-

  2. #2
    SitePoint Guru [Paul Ferrie]'s Avatar
    Join Date
    Oct 2007
    Location
    Glasgow, Scotland, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try
    Code:
    Concrete._x = Truck.Arm_One.Arm_Two.Arm_Three.Arm_Four.Arm_Five._x;
    Concrete._y = Truck.Arm_One.Arm_Two.Arm_Three.Arm_Four.Arm_Five._y
    .:To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Glasgow Flasher
    bringmadeleinehome.com

  3. #3
    SitePoint Guru krityx's Avatar
    Join Date
    Jan 2006
    Location
    Around
    Posts
    634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe he's using AS3.
    I'd say to make sure your paths are all good and maybe instead of arm_one you can name the variable a1 and so on to avoid that mess in the code. Since your code seems correct(if you're scripting AS3) then it must be a problem with those paths.


  4. #4
    SitePoint Guru [Paul Ferrie]'s Avatar
    Join Date
    Oct 2007
    Location
    Glasgow, Scotland, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by krityx View Post
    Maybe he's using AS3.
    He's not stated either so obvious for me is AS2
    .:To me AS is like LEGO, Only for the big Kids :.
    - Site - Blog - Glasgow Flasher
    bringmadeleinehome.com

  5. #5
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am actually using AS3 ... I will try to reset the names of the variables and see if that works ... if not, any other suggestions?

  6. #6
    SitePoint Member
    Join Date
    Jul 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    After Changing the variable names to A1.A2.A3.A4.A5 and even changing the main MC to Truck instead of CIC_Truck, I still have an issue. The concrete only shows up 20 pixels left of the left corner of the stage. I am not sure what I am doing wrong or what Needs to be done. I am using ActionScript 3.0.

    Any Suggestions?

    -Script_Goo_Roo-

  7. #7
    SitePoint Wizard jim_morrison3's Avatar
    Join Date
    Apr 2004
    Location
    UK
    Posts
    2,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is the concrete inside another movieclip ? Maybe you need to use localToGlobal property.
    Good Luck!
    There are things known and Things unknown
    And in between are the Doors.
    I love hand Coding.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •