Hi Simon,

As you've discovered Flash and Director don't exactly work the same way. Filmloops 
really can't function like movieclips and controlling them is tricky. (Although people 
have been asking for this functionality long before movieclips were even on the scene.)

It seems to me that the solution for your problem is to rethink the way you are 
approaching your animation cycle.
There is a good article on animating a character at 
http://www.director-online.com/accessArticle.cfm?id=1028

The idea is that instead of using filmloops you structure your movie to swap in the 
appropriately labelled cast members in the correct sequence.

With your multiple unit movement you will have to track position as you are doing and 
use a little math to limit the movement of your character.

If you wanted to use filmloops for the animation you still could but you only need 2 
loops, one for walking left the other for right. The sprite would start off showing 
the static standing still member. If the user clicks on something to move 3 units to 
the left I would swap in the walking left loop (which is basically a loop of walking 
on the spot) then I would use lingo to slide the sprite
to the left by 3 units over a given amount of time. The combination of the loop of 
walking on the spot while sliding the sprite will look like the character walking to 
the new position. Once the sprite has reached the destination stop the sliding, switch 
the spritemember back to the stationary member and wait for the next command. If you 
want to be able to have the user click on sequence of
moves, lets say 3 to the left, 2 right and 2 left then store the sequence in a list 
and as each series of movements are complete remove that instruction from the list and 
move on to the next instruction. If the list is empty then movement is complete so 
switch back to the static member

Even if I was building this in flash I don't think I would create different animation 
cycles for the 1 2 3 and 4 unit movements, unless each of those cycles was truly 
unique, but would do a similar thing as above. Two movie clips with left and right 
motion, and then load them as appropriate into the clip on stage and move that clip 
around using the x and y position.

Does that help any or just make things worse?

later,

Rob

PS, I think if you continue along your path with the filmloops you're asking for 
trouble especially if you want to do collision detection of your character with walls 
or something. If collsion detection is your ultimate goal then I wouldn't even go the 
filmloop swap root I mention but swap members in a manner similar to that mentioned in 
the article (unless you simply want to use the rect of
the sprite for collision detection)



Simon Wheatley wrote:

> Hi Rob
>
> Thanks for taking an interest.
>
> I'm trying to animate a little man walking along between bars on a screen,
> at any moment he may be required to go left or right a number of units from
> 1 to 4. So rather than have seperate animations from 1 to 2, 1 to 3, 1 to 4,
> 1 to 5, 2 to 1, 2 to 3, 2 to 4, etc etc I've been trying to keep it to an
> animation each of him moving 1, 2, 3 or 4 places left and the same going
> left, each starting and ending in the same pose. Then I dynamically placing
> the filmloops on the stage a positioning them appropriately.
>
> My questions have all centred around this and I'm nearly there now. I need
> to be able to detect the end of a filmloop so I can decide if I (or rather
> my little man) have arrived where I want to be, or if I/he need to be
> somewhere else (ie another button has been clicked while he was walking.)
> Originally I was intending to keep all the animation inside one filmloop,
> moving it around on the stage and moving between markers on the filmloop...
> I quickly decided this was a bad idea, Flash works like this and Director
> doesn't :) The solution I am using is to keep track of where my man is
> actually on the stage (global coordinates as a Flasher might say) and keep
> this updated by knowing how far he walks in each animation, and have an
> adjustment value instead of being able to set the regpoints.
>
> Does this make sense? What do you reckon to it as a solution?


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to