A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Detecting _x value???

  1. #1
    Junior Member
    Join Date
    Aug 2001
    Posts
    9
    i have a MC that will be moving using an acceleration action script. That means the x value will be changing. I need a statement that will look something like this:

    if (myMC._x > 1234.5) {
    myMC._x = 9876.5;
    }

    and i have the frame being repeteated. But some reason it does not work. I got the x values by moving the MC to where i wanted it on the timeline. But when i try this action some reason it does not work. What am i doing wrong?

    thanks

  2. #2
    Senior Member
    Join Date
    May 2002
    Posts
    248
    The only thing I can think of is that you have the path wrong? Like you need to put _root or whatever the correct path to the clip. Otherwise, it looks like it should work to me.

    -Dan

  3. #3
    Junior Member
    Join Date
    Aug 2001
    Posts
    9
    well hmm...it does move the MC right when it loads. It moves it somewhere ic ant see. So its probally my if _x value is wrong. How do i test for that?

  4. #4
    Senior Member
    Join Date
    May 2002
    Posts
    248
    Actually, yeah... your _x values are way high. The highest value of _x should be either the width of the stage, or the width of the stage plus the width of the clip. Anything higher than that, and the clip will be off the right edge of the stage.

    -Dan

  5. #5
    Junior Member
    Join Date
    Aug 2001
    Posts
    9
    no i just made those numbers up for exaple. My MC is very long because i have a stretch of pictures inside it. The real numbers for the if statement are around -5000. But im confused now becuase i have no clue how i am supposed to get the right _x value. How can i? thanks for your help.

  6. #6
    Senior Member
    Join Date
    May 2002
    Posts
    248
    What do you mean the 'right' _x value? What are you trying to do?

    Maybe you can use something else on your stage to align your clip with.

    -Dan

  7. #7
    Junior Member
    Join Date
    Aug 2001
    Posts
    9
    look im using a action script (acceleration) to move this MC. But i want ir to look like the MC keeps going and going. To do this i have a if statement. So right when the MC is about to go off the stage, the _x value changes and it goes back to where it started. How do i find the "if (_x = ???)" value so that it would look like that. Hope you understand.

    Thanks

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center