A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: X and Y madness

  1. #1
    Senior Member
    Join Date
    Dec 2000
    Posts
    147

    X and Y madness

    Hi, I am having trouble getting a movie clip to move around a specific and limited area of my movie. I want "dis_arrow" to only be able to move "up" when it isnt at the following coordinates: x = 353.1 y = 214.7. Any ideas whats wrong with the following code?


    up_bt.onRelease = function(){
    if ((dis_arrow._x = 353.1) and (dis_arrow._y = 214.7)) {
    Void
    } else {
    dis_arrow._y-=19.5;
    }
    }
    mileso

  2. #2
    Senior Member
    Join Date
    Oct 2008
    Posts
    227
    PHP Code:
    up_bt.onRelease = function(){
    if (
    dis_arrow._x == 353.1 && dis_arrow._y == 214.7) {
    } else {
    dis_arrow._y-=19.5;
    }

    This is the proper syntax to use... If its in a "if" statement, "=" should be "==".
    Also, "&&" represents "and"

  3. #3
    Senior Member
    Join Date
    Dec 2000
    Posts
    147
    Mmmmm that doesnt work?
    mileso

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