Swapping a sprite with another that is exactly spaced in cast

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

  1. #1

    Default Swapping a sprite with another that is exactly spaced in cast

    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

  2. Similar Questions and Discussions

    1. 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....
    2. 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
    3. 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...
    4. SWAPPING A SPRITE FOR A FEW SECONDS
      Hi forum members I am wanting to make a function that will swap a sprite member for a few seconds then restore back. All that I really need to...
    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 Re: Swapping a sprite with another that is exactly spaced in cast

    Hi Steve,

    The way that you have that code written, you're telling your movie to
    look ahead in the cast 27 + the number of the current sprite channel.
    What you want to do is reference the member number of the member that's
    in the current sprite channel.

    Something like this:

    ---------
    property thisSprite
    property thisMember

    on beginSprite me
    thisSprite = me.spriteNum -- the current sprite channel number
    thisMember = sprite(thisSprite).member.memberNum -- the number of the
    member in the current sprite channel
    end

    on mouseEnter me
    sprite(thisSprite).member = member((thisMember + 27),1)
    end
    ----------

    You should always reference a member by it's number and the number of
    the cast that it resides in. The default cast is always cast 1.

    --
    Rob
    _______
    Rob Dillon
    Team Macromedia
    [url]http://www.ddg-designs.com[/url]
    412-243-9119

    [url]http://www.macromedia.com/software/trial/[/url]
    Rob Dillon 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