Swapping a member with another that is exactly 27 cast members ahead

Ask a Question related to Macromedia Director Lingo, Design and Development.

  1. #1

    Default Re: Swapping a member with another that is exactly 27 cast members ahead

    Try this



    property oldmem

    on mouseEnter me
    oldmem = sprite(me.spriteNum).memNum
    sprite(me.spriteNum).memNum = oldmem + 27
    end


    on mousLeave me -- in case you need to restore
    sprite(me.spriteNum).memNum = oldmem
    end


    -- double check my spelling recolection for memNum
    JB Guest

  2. Similar Questions and Discussions

    1. How to let objects in a cast member be a child of agroup(or a model) in another cast member?
      I want to add a model to the scene. I try this code: member('world').newgroup('gr2') member('world').group('gr2').addchild(member('r2').model(1)) ...
    2. cast members moved in cast - neet to get htem back!!!
      Hello I inadvertedly pasted a cast member into my cast and it bumped the rest of the members one number forward, screwing up my lingo all over the...
    3. Swapping cast member of a masked sprite..... not working.
      Hey guys, Have a semi diffucult one here. I have a cast member in sprite(1). It's castNum is 1. It's mask for that member is in memberNum 2....
    4. swapping video cast members
      Hey all, "Long time listener, first time caller"... I'm working on a director project with multiple movies playing on the stage, and am...
    5. Swapping cast Members
      I would like to swap one cast member with another one. depending on what button the uses clicks. I tried using the sprite(x).member=member...
  3. #2

    Default Swapping a member with another that is exactly 27 cast members ahead

    Hello

    Lingo - wow.

    I'm trying to get a cast member to swap with another on mouseEnter. The other member is exactly 27 spaces forward in the cast.

    I'd normally just swap it with the cast member's number, but I need to apply this script to several cast members, all of which have their "swapping" cousins residing 27 spaces forward in the cast.

    This would be easier than creating several dozed scripts and applying them to each sprite on the stage.

    Here's what I have so far. I'm new at this, so I'm hoping that the error is simple.



    on mouseEnter me
    set change = the currentSpriteNum of me
    set the member of sprite the currentSpriteNum to member (change + 27)
    end



    when I use the script, I get a "Property not found" error. I do not know what that means.

    Any help is appreciated. Thanks!

    -----------------S

    --------------------

    Steve Dorsey
    Dorsey Graphics

    :: 3D
    :: Animation
    :: Web Design
    :: Digital Media

    [url]http://www.dorseygraphics.com[/url]

    --------------------
    spdorsey webforumsuser@macromedia.com Guest

  4. #3

    Default Re: Swapping a member with another that is exactly 27 cast members ahead

    The item is "memberNum"

    This worked:



    property oldmem

    on mouseEnter me
    oldmem = sprite(me.spriteNum).memberNum
    sprite(me.spriteNum).memberNum = oldmem + 27
    end

    on mouseLeave me
    oldmem = sprite(me.spriteNum).memberNum
    sprite(me.spriteNum).memberNum = oldmem - 27
    end


    Thanks for the heads-up!
    Much appreciated!


    --------------------

    Steve Dorsey
    Dorsey Graphics

    :: 3D
    :: Animation
    :: Web Design
    :: Digital Media

    [url]http://www.dorseygraphics.com[/url]

    --------------------
    spdorsey 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