Playing frames only when certain criteria are met?

I hope I can explain this well.

First, here’s the movie in question:

the fla is here:

The concept is, you have this big picture and when you hover over a label the picture zooms in and you get a detail.

Problem is, say you’re hovering over “Operations” then you just move your mouse down to “Customers”. The movie sorta stutters over from Operations to Customers. What I would LIKE it to do is act as if I had removed my mouse from the button, THEN hovered over the next item.


  1. User sees big picture

  2. User hovers over “Operations”

  3. Movie Zooms In to Operations.

  4. User hovers over “Customers”

key -->5. Movie zooms all the way back out, THEN zooms into “Customers”

so on…

I hope this makes sense.

So far I’ve tried to put a switch into the frames where the movie is zoomed all the way out. something saying “ok, we’re ready to zoom in” then have the buttons say “if the frame says “we’re ok” then we can zoom in”. But that didn’t work for me.



Yeah it does look funky. But i can’t help.

do something like:

for zoomin:

if (_root.zoomout) {
_root.zoomout = false;
// trigger zoom in

and on the zoomout code, have something like:

// after the zoomout script completes, set this
_root.zoomout = true;

may need modification to suit your needs, but this should prevent the clip zooming in before it has zoomed out fully.

Right, like a switch. I’m trying and trying but I just can’t get it to work. I don’t know what’s going on.

At the frames where I want the clip to soom I say I make a var and call it “Ready” and make it true. All the other intermediate clips are empty (false).

On the button I say “if ready is true then go and play X”. But it plays X regarless.


You could make each section zoom back to the wide view (quickly) before zooming to the new close-up. I got this from Flashkit last year, and it works pretty smooth:

sounds wierd. Run a trace on ‘ready’, and watch what it does when you click the button, that might help narrow down the problem.

That would come in very handy. I sort of have a feeling I might just be confused about something silly…but how do you do that?

I’m fairly new to Actionscript. In asp I would have it spit out the currentWhatever or in JS I could have an alert popup with the variable I’m looking at, but I haven’t been able to find a way to do that with AS. Stupid question?

when it comes to AS, there are no stupid questions.

to run a trace, simply put


it will output the contents of that variable to the output window when you compile/run the movie.

if you’re running a lot of traces (I do, because I write inherently buggy code) try it like:

trace("this variable = "+variable);

replace ‘variable’ with the path/name of what you want to trace, ie.




Ah, I see. I appreciate your continued support!

Well I finally got trace to spit out “true”. So now I’m trying to get the movie clip to only play when it says true…but it’s playing regarless.

Is it a problem that the zoom effect is done with tweens and “gotoandplay()” statements instead of actionscript?

On frame 2 of the tweens, you should have a loop that’s like:

if (!_root.finished) {

on the first two frames, have no animation at all, as it will flip between these two frames while the ‘other’ effect is finishing. When the other effect is complete, and sets _root finished=true, then this loop will not run, and the movieclip will start playing.

so now when you click on a button, it runs through that loopand waits, until the other button is finished.

Hope this is what you’re after.

OR an easier way have an onClipEvent(enterFrame) to check where it is currently zoomed in to (use a variable for this, eg. name as currZoom) and if it isnt the same as targZoom tell it to run the zoomout anim. And on the zoomed out anim have it check where to zoom in via the variable targZoom… on rollover your buttons simply set the variable targZoomequal to where you wanna go!

one variable for where you want to zoom, one for where it is zoomed to
one check when it is zoomed all the way in, one check for when its not

hope i make sense here!