Think of something that you wish Authorware could do but it doesn't?  Let the our good friends at Macromedia know via the wishlist.

Please let us know if you find any of the materials on this site inappropriate or offensive. Please include the url and why the material should be reviewed.

Comments and questions about the site are also welcome. Please no Authorware questions, use the AWARE list.


B1016 - How do I make my own zooming effect?

by - Joseph Ganci

I need to make my own version of the ZoomRect function (whooshing rectangles from a point source to the full screen size) -- my version needs to start at a source rectangle (guaranteed to be smaller than the dest) and then whoosh to a destination rectangle (not necessarily the full screen).

Do you know if the source code for ZoomRect is available - or if there's some way to quickly duplicate this functionality?

I thought this would be easy to do in a Repeat loop, and it is, if you don't mind having all the rectangles stay on the screen until it's done. Most of the time, though, you want to have the rectangles erase right after they're drawn.

In either case, start with a calc icon at the top of your flowline that contains the following script:

rect size x := 200
rect size y := 100
num rects := 20
offset x := INT(rect size x / num rects)
offset y := INT(rect size y / num rects)
time interval := 0.01

Set the number of pixels the biggest rectangle will be for both x and y. This means you don't have to have perfectly square rectangles. Indicate how many rectangles to draw from the click point to the outer boundary. In the last line, indicate how many seconds to wait between each draw. In this case, 0.01 seconds are set.

In a hot spot response feedback, use one of the following two approaches:

Repeat loop approach. This does not erase the rectangles as they draw. Use a Calc icon that contains the following script:

repeat with i := 1 to num rects
    Box(1, ClickX - offset x * i, ¬ 
               ClickY - offset y * i, ¬
               ClickX + offset x * i, ¬
               ClickY + offset y * i)
    SyncWait(time interval)
end repeat
Decision icon approach (remember the Decision icon?). This will erase the rectangles as they draw.
1. Place a Decision icon set to Repeat num rects times. Leave all other defaults.
2. Attach to the Decision icon a Map icon.
3. In the Map icon place a Calc with the following script line:
Box(1, ClickX - offset x * RepCount, ¬
            ClickY - offset y * RepCount, ¬
            ClickX + offset x * RepCount, ¬
            ClickY + offset y * RepCount)

4. After the Calc, have a Wait icon set to time interval seconds.

Hope this helps! It looks great on my machine. I especially like the Decision icon approach.

There are 0 reviews
Add your review