SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    director behavior big to few lines

    Hello...

    I've 33 sprites to 'manipulate' on this behavior. I want to know if there is another way, besides the example below, to do it? Or I've to do it line by line?


    on mouseDown
    repeat while the mouseDown
    if sprite(2).locH > -250 then
    sprite(2).locH = sprite(2).locH - 2
    if sprite(3).locH > -250 then
    sprite(3).locH = sprite(3).locH - 2 .
    if sprite(4).locH > -250 then
    sprite(4).locH = sprite(4).locH - 2
    ......
    ......
    ......

    end if
    end if
    end if
    updateStage
    end repeat
    end



    Bye::::::::::::::::::::::::::

  2. #2
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm not exactly sure what you are trying to accomplish, but can you use a Select Case statement? here is a statement I've used in a navigation scheme, the numbers refer to the channel the sprite is on. I use one cast member with this script on it. that way i can re-use the cast member multiple times (multiple sprites - one cast member):

    case the rollOver of
    28: set framePos = "philo"
    29: set framePos = "exp"
    30: set framePos = "prod"
    31: set framePos = "prof"
    32: set framePos = "serv"
    33: set framePos = "cont"
    end case

    (framePos is a variable that tells the playback what marker to jump to) does this make sense? case statements can be more compact...

    btw, can you help me out on some lingo i have posted on this thread ?
    Last edited by bbolte; Mar 7, 2002 at 14:11.

  3. #3
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well...something like this....

    From to sprite 2 to sprite 33 do this:

    sprite(x).locH > -250 then
    sprite(x).locH = sprite(x).locH - 2

    All the statement functions in that array...

    Understand me?!


    I use one cast member with this script on it. that way i can re-use the cast member multiple times (multiple sprites - one cast member):


    Yes! But I've multiple cast members and multiple sprites.

  4. #4
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,301
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    this is a guess - try a "repeat with" loop:

    on mouseDown
    repeat with x = 2 to 33
    if sprite(x).locH > -250 then
    sprite(x).locH = sprite(x).locH - 2
    end if
    update stage
    end repeat
    end

  5. #5
    SitePoint Evangelist
    Join Date
    Jan 2001
    Location
    earth
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll try that.

    See u soon.


Bookmarks

Posting Permissions

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