Hopefully somone can help me with this one. I am working on a movie slider.
Here's the code to move the slider durring playback.


    ctime = sprite(2).currenttime
    -- 2 is the video sprite
    -- ctime is the current time code in ms
    
    cpart = ctime * (1/sprite(2).duration)
    -- cpart computes the current segment
    -- currenttime * 1/duration in MS 

    cloc = sprite(149).width * cpart
    -- width of entire slider * segment
    -- products the approximate number of pixels to move
    
    vcalc = integer(cloc)
    -- convert cloc to integer

    sprite(150).loch = vcalc + sprite(149).loch - (sprite(149).width/2)
    -- move slider control correct number of pixels
    -- based on left edge of slider bar

in the past I have hard coded:

cpart = ctime * (1/sprite(2).duration)

so it looked like:

 cpart = ctime * .000003620564808

but I would rather build this behavior to be drag and drop. My problem lies
in how Director is handle'n the math. In director 1/276200 = 0 where I need
it to = 3.62056480811006517016654598117306e-6. I read various technotes on
MM site but none seem to give any hint to a solution to this problem.
Reading about how Director handles floating point calculations it seems like
the issues are only when displaying numbers not the actual calculations but
the script doesn't function at all without hardcoding the number. This leads
me to belive that Director is using 0 as the solution to
(1/sprite(2).duration) .  Can anyone help here?

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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