comparisons and depth

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default comparisons and depth

    sorry to post two questions in one day, but i have run into a second problem. i have a looping movie clip which changes _y position randomly with every loop. that is working fine. but what i want to do is is have it check on the first frame of that loop for its _y position and adjust its depth based on that location.
    right now i have tried this code

    onClipEvent (enterFrame) {
    if (_root.dad._y<=200) {
    _root.dad.swapDepths(1);
    } else {
    _root.dad.swapDepths(100);
    }
    }

    which is on a mc in the first frame of the dad movie clip.
    sorry if this is a dumb question. i have primarily done animation and am teaching myself more advanced code stuff.

    actually what i am really looking to do is campare the _y of _root.tractor to the _y of _root.dad and if tractor._y > dad._y then the depth of tractor > depth of dad and if tractor._y < dad._y then depth of tractor < depth of dad.

    any advice from out there???

    thanks in advance.



    chicken king webforumsuser@macromedia.com Guest

  2. Similar Questions and Discussions

    1. batch reducing image depth without affecting image depth
      Hi All, I have to optimise a project for a client, the main part is reducing all the image bit depths from 32 bit to 16 bit. I was just going to...
    2. #26080 [NEW]: Comparisons always true in xml.c
      From: AxelLuttgens at swing dot be Operating system: Darwin 7.0.0 (Panther) PHP version: 4.3.3 PHP Bug Type: Compile Warning...
    3. chaining comparisons
      When I learned python I was overjoyed that I could evaluate 1 < 2 < 3 and get "true". I just realized that you can't do that in Ruby. Is there a...
    4. NASA G5 v PC speed comparisons
      It seems NASA thinks that G5s are pretty fast, and they're independant http://www.macobserver.com/article/2003/07/04.7.shtml PK
    5. Date comparisons
      Hi. I'm using ADO.NET to retrieve data from SQL Server via stored procedures. Lately I found the following problem: There's a stored procedure...
  3. #2

    Default Re: comparisons and depth

    sorry. i am a putz. i got it figured out. i just put this on an mc in the main timeline:

    onClipEvent (enterFrame) {
    if (_root.tractor._y>=_root.dad._y) {
    _root.tractor.swapDepths(2);
    _root.dad.swapDepths(1);
    }
    }
    onClipEvent (enterFrame) {
    if (_root.tractor._y<=_root.dad._y) {
    _root.tractor.swapDepths(1);
    _root.dad.swapDepths(2);
    }
    }


    thanks for all the help y'all have given me.


    chicken king webforumsuser@macromedia.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139