Hi list...

I'm really stumped.  I'm trying to zoom in to a particular known rect on
the stage, and I can't seem to get the math correct for drawRect to
work. The hitch is the rect and drawRect of the stage has previously
been resized to fit the user's monitor.  The original rect of the stage
was rect(0,0,1024,768), but in testing on my monitor, the stage becomes
rect(0,0,1600,1200).  Apparently (I think), whatever you resize the
drawRect to, it still counts as originally sized pixels.

Here's my script.  If anyone can help, I'd sure appreciate it.  The end
result is to double click a flash video on the stage and have it become
full screen video.

Thanks,
- Michael M.

on mExpandVideo()
         -- get rect of stage and rect of flash vid, expand vid to rect
of stage. (to full screen video)
         vid =
sprite(pData.pSprites.pFlashUI)._root.theContent.currentMC.theVids.vid
         upperLeft = point(vid._x + 170, vid._y +132) -- 132 + 170 are
constants based on regpoint and location of swf
         lowerRight = point(vid._x + vid._width + 170, vid._y +
vid._height + 132)
         coeffW = float((the stage).rect.width)/1024 -- at 1600x1200,
it's 1.5625
         coeffH = float((the stage).rect.height)/768 -- at 1600x1200,
it's 1.5625
         maxL = (-1 * coeffW * upperLeft[1])
         maxT = (-1 * coeffH * upperLeft[2])
         maxR = pData.pScreenInfo.pW + (1024 - lowerRight[1]) -- pW & pH
set on prepareMovie, is width of users monitor
         maxB = (coeffH * (pData.pScreenInfo.pH - (vid._y +
vid._height)))
         vidRectExpandedRect = rect(maxL,maxT,maxR,maxB)
         if (pData.pMaxVid = FALSE) then
         -- resize the video to full screen
         (the stage).drawRect = vidRectExpandedRect
              else
         (the stage).drawRect = pData.pOrigDrawRect -- recorded at init
         end if
         pData.pMaxVid = not pData.pMaxVid
end


[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